From a7481d42a283cf0238c31249a6c8f74ed215044c Mon Sep 17 00:00:00 2001 From: Koala <6156589+Shik3i@users.noreply.github.com> Date: Wed, 3 Jun 2026 12:09:35 +0200 Subject: [PATCH] fix(extension): resolve language selector UI overwrite and dynamic version reporting --- CHANGELOG.md | 8 ++++++++ extension/background.js | 6 +++--- extension/popup.html | 8 ++++---- extension/popup.js | 29 ++++++++++++++++++++++++++++- 4 files changed, 43 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66b6d28..54b762e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to the KoalaSync browser extension and relay server. --- +## [v2.0.8] — 2026-06-03 + +### Fixed +- Fixed a bug where switching language inside the extension popup overwrote dynamic fields (such as active room ID, connection status, active server details, and video debug info) with default localized placeholder texts. +- Fixed a version reporting mismatch where the copied logs (debug reports) and connection handshake parameters incorrectly reported the hardcoded `1.9.0` version instead of the actual installed manifest version. + +--- + ## [v2.0.7] — 2026-06-03 ### Added diff --git a/extension/background.js b/extension/background.js index 72a4606..b2f491e 100644 --- a/extension/background.js +++ b/extension/background.js @@ -1,4 +1,4 @@ -import { EVENTS, PROTOCOL_VERSION, OFFICIAL_SERVER_URL, OFFICIAL_SERVER_TOKEN, APP_VERSION, EPISODE_LOBBY_TIMEOUT, FORCE_SYNC_TIMEOUT } from './shared/constants.js'; +import { EVENTS, PROTOCOL_VERSION, OFFICIAL_SERVER_URL, OFFICIAL_SERVER_TOKEN, EPISODE_LOBBY_TIMEOUT, FORCE_SYNC_TIMEOUT } from './shared/constants.js'; import { generateUsername } from './shared/names.js'; import { loadLocale, getMessage, SUPPORTED_LANGUAGES } from './i18n.js'; @@ -457,7 +457,7 @@ async function connect() { url.pathname = '/socket.io/'; url.searchParams.set('EIO', '4'); url.searchParams.set('transport', 'websocket'); - url.searchParams.set('version', APP_VERSION); + url.searchParams.set('version', chrome.runtime.getManifest().version); url.searchParams.set('token', OFFICIAL_SERVER_TOKEN); socket = new WebSocket(url.toString()); @@ -1353,7 +1353,7 @@ async function handleAsyncMessage(message, sender, sendResponse) { reconnectSlowMode: reconnectFailed, roomId: currentRoom ? currentRoom.roomId : null, serverUrl: currentServerUrl, - version: APP_VERSION, + version: chrome.runtime.getManifest().version, protocolVersion: PROTOCOL_VERSION, roomPassword: currentRoom ? currentRoom.password : null }); diff --git a/extension/popup.html b/extension/popup.html index 22eeb37..8a2ed5d 100644 --- a/extension/popup.html +++ b/extension/popup.html @@ -375,9 +375,9 @@
-
NONE
+
NONE
-
Official Server
+
Official Server
@@ -519,13 +519,13 @@
- Disconnected + Disconnected
-
+
No tab selected or video detected.
diff --git a/extension/popup.js b/extension/popup.js index 18cb0e3..6df617d 100644 --- a/extension/popup.js +++ b/extension/popup.js @@ -157,6 +157,9 @@ async function init() { refreshLogs(); refreshHistory(); + // Default connection status (localized) before async check + applyConnectionStatus('disconnected'); + // Initial Status Check chrome.runtime.sendMessage({ type: 'GET_STATUS' }, async (res) => { if (chrome.runtime.lastError) { @@ -947,9 +950,33 @@ if (elements.langSelector) { await chrome.storage.sync.set({ locale: selectedLang }); await loadLocale(selectedLang); translateDOM(); + + // Re-apply connection and room UI state since translateDOM may overwrite dynamic elements + chrome.runtime.sendMessage({ type: 'GET_STATUS' }, async (res) => { + if (chrome.runtime.lastError) return; + if (res) { + localPeerId = res.peerId; + reconnectSlowMode = res.reconnectSlowMode || false; + applyConnectionStatus(res.status); + updatePeerList(res.peers); + lastKnownPeers = res.peers || []; + if (res.lastActionState) updateLastActionUI(res.lastActionState, res.peers); + + const data = await chrome.storage.sync.get(['roomId', 'password', 'useCustomServer', 'serverUrl']); + updateUI(data.roomId, data.password, data.useCustomServer, data.serverUrl); + + await populateTabs(res.peers, res.targetTabId); + if (res.episodeLobby) updateLobbyUI(res.episodeLobby, res.peers); + } else { + applyConnectionStatus('disconnected'); + const data = await chrome.storage.sync.get(['roomId', 'password', 'useCustomServer', 'serverUrl']); + updateUI(data.roomId, data.password, data.useCustomServer, data.serverUrl); + await populateTabs(); + } + }); + refreshLogs(); refreshHistory(); - populateTabs(); }); }