From 99f95dadee1a3c892bb0bc87e3564f71d07c88e0 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Tue, 15 Sep 2026 02:48:25 +0200 Subject: fix(ui): a group opened directly lands on the preferred app once preferences load Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01XuNrwLf5EFWCMHzfoEvnpm --- packages/meshbay-hub/tests/test_group_tab_fallback.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'packages/meshbay-hub/tests/test_group_tab_fallback.py') diff --git a/packages/meshbay-hub/tests/test_group_tab_fallback.py b/packages/meshbay-hub/tests/test_group_tab_fallback.py index 6310b9c..634c5eb 100644 --- a/packages/meshbay-hub/tests/test_group_tab_fallback.py +++ b/packages/meshbay-hub/tests/test_group_tab_fallback.py @@ -67,6 +67,25 @@ def test_a_preference_that_names_nothing_falls_back(cases): assert cases["preference names nothing real"]["active"] == 0 +def test_a_preference_that_arrives_after_the_group_opened_applies(cases): + """The reported bug: Videos chosen in Settings, and a group opened directly + (a reload, a link) still landed on Chat. + + app.js fetches the preferences after sign-in; GroupPage chose its tab at + mount and never looked again. + """ + case = cases["preference arrives after the group opened"] + assert case["active"] == 2, ( + f"the preference arrived and was ignored: landed on tab {case['active']}") + + +def test_a_late_preference_does_not_undo_a_tab_the_reader_chose(cases): + """Arriving late must not yank someone off a tab they just clicked.""" + case = cases["tab chosen before the preference arrives"] + assert case["active"] == 1, ( + f"the reader clicked Files and was moved to tab {case['active']}") + + def test_a_preference_the_group_offers_is_kept(cases): """The fallback must not become 'always the first app'.""" case = cases["preferred app present"] -- cgit v1.2.3