Skip to content

fix(settings): reset to General on bare /settings so browser Back can't strand a stale tab - #415

Merged
ruzin merged 1 commit into
stenolabs:mainfrom
Optic00:fix/405-bare-settings-tab-reset
Jul 24, 2026
Merged

fix(settings): reset to General on bare /settings so browser Back can't strand a stale tab#415
ruzin merged 1 commit into
stenolabs:mainfrom
Optic00:fix/405-bare-settings-tab-reset

Conversation

@Optic00

@Optic00 Optic00 commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #411 (which closed #405): one edge of the tab/URL divergence is still reachable.

The leftover bug

#411 made the route the single source of truth - nav-rail clicks now navigate /settings?tab=<id> and push entries onto the hash history. But the route->tab sync effect only reacts to a valid ?tab= param and ignores a bare /settings. So:

  1. Open Settings (bare /settings, General visible).
  2. Click any other tab in the nav rail (URL becomes ?tab=ai).
  3. Press browser Back - the URL returns to bare /settings, but the AI tab stays visible. Tab and URL have diverged again, and a subsequent navigate('/settings') from anywhere bails on the unchanged hash, so nothing ever corrects it.

Fix

  • One shared tabFromRoute resolver used by both the first-mount initialTab and the route-reactive sync effect, so their semantics can't drift.
  • The sync effect now treats an absent (or unknown) ?tab= the same way first mount does: reset to General.

Test

New T1 regression in settings-cmdk-search.t1.spec.ts: nav to AI via the rail, browser Back, assert the hash is exactly #/settings and General is visible again. Verified the test fails on current main and passes with the fix.

Verification


Summary by cubic

Fix Settings tab desync when going Back to bare /settings. If ?tab= is missing, the visible tab now resets to General so the tab and URL stay in sync after nav-rail clicks.

Written for commit 1c30d62. Summary will update on new commits.

Review in cubic

…'t strand a stale tab (stenolabs#405)

Follow-up to stenolabs#411: nav-rail clicks now push ?tab= entries onto the hash history, so browser Back can land on bare /settings - the route-sync effect previously ignored the absent param and left the old tab visible. Shares one tabFromRoute resolver between first-mount initialTab and the sync effect, and adds a T1 regression test.
@Optic00
Optic00 requested a review from ruzin as a code owner July 24, 2026 06:34

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

You’re at about 92% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Re-trigger cubic

@ruzin
ruzin merged commit fcd5681 into stenolabs:main Jul 24, 2026
10 checks passed
@Optic00 Optic00 mentioned this pull request Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Settings ⌘K search: tab state and URL diverge, then a search silently does nothing

2 participants