From b4baa4770d517ea7d1d25bb0ac50fc7c989531d6 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Sat, 22 Aug 2026 18:03:57 +0200 Subject: 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 Claude-Session: https://claude.ai/code/session_016SF6RKNBKg9qejmoMJ9ybA --- packages/meshbay-hub/src/meshbay_hub/static/app.js | 4 ++++ 1 file changed, 4 insertions(+) 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); -- cgit v1.2.3