From 6c75030420e750c3aca3786fc24de81a7e8dee5e Mon Sep 17 00:00:00 2001 From: iris Date: Mon, 1 Jun 2026 20:42:42 +0200 Subject: [PATCH] fix(#1015,#1016): declare overflow vars before syncTabFromHash() call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit overflowBtn/overflowDrop/overflowWrap were declared after syncTabFromHash() was invoked. activateTab() calls updateTabbarOverflow() which closes over these consts — hitting them in the TDZ threw ReferenceError on every page load, also preventing fetchAndRenderToolGroups() from running (tool-groups section stuck at loading). --- frontend/packages/dashboard/src/tabs.js | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/frontend/packages/dashboard/src/tabs.js b/frontend/packages/dashboard/src/tabs.js index 494ecb4d..e571a358 100644 --- a/frontend/packages/dashboard/src/tabs.js +++ b/frontend/packages/dashboard/src/tabs.js @@ -3487,16 +3487,6 @@ window.marked = marked; // so it stays fresh without an SSE channel. if (target === 'system') fetchAndRenderToolGroups(); } - function syncTabFromHash() { - const h = (window.location.hash || '#swarm').replace(/^#/, ''); - activateTab(h); - } - window.addEventListener('hashchange', () => { - syncTabFromHash(); - updateTabbarOverflow(); - }); - syncTabFromHash(); - // ─── tabbar overflow menu ──────────────────────────────────────────────── // Tabs with `data-overflow="default"` (LOGS, SETTINGS) always live in // the ⋮ dropdown. When the bar is too narrow to show all remaining tabs, @@ -3506,12 +3496,27 @@ window.marked = marked; // flex end. `tab-overflowed` hides a tab from the bar (display:none). // The dropdown is rebuilt from scratch on every call — it holds cloned // /