aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-08-22 18:03:57 +0200
committerChristophe Besson <cbesson@gmail.com>2026-08-22 18:03:57 +0200
commitb4baa4770d517ea7d1d25bb0ac50fc7c989531d6 (patch)
treeca536b4dad8a02395876d9f1a9e8ad85a54dd55b
parent9c136a0e37add42f5d0c8675a797969cfe690de0 (diff)
downloadmeshbay-b4baa4770d517ea7d1d25bb0ac50fc7c989531d6.tar.gz
fix(ui): reset Files navigation state when switching groups
GroupPage keeps the same component instance across a group switch (no key at the router), so currentPath/selected/filter were leaking from the group just left. A directory that exists in one group but not the other (e.g. "outputs") then showed an empty listing after switching. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016SF6RKNBKg9qejmoMJ9ybA
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/app.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/app.js b/packages/meshbay-hub/src/meshbay_hub/static/app.js
index 5c2bada..b863460 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/app.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/app.js
@@ -1669,6 +1669,10 @@ function GroupPage({ groupId, group, token, username, userId, userPrefs,
const defaultTab = (userPrefs && (userPrefs[`default_tab:${groupId}`] || userPrefs['default_tab'])) || 'chat';
const [tab, setTab] = useState(defaultTab);
useEffect(() => { setTab(defaultTab); }, [groupId]);
+ // A directory from the group just left rarely exists in the one just
+ // entered (e.g. "outputs" in one group, absent in another) — Files would
+ // otherwise show that stale path and list nothing.
+ useEffect(() => { setCurrentPath(''); setSelected(new Set()); setFilter(''); }, [groupId]);
const [groupMuted, setGroupMuted] = useState(() => !!(group && group.muted));
const _lastTouch = useRef(0);