Skip to content

fix: nav active-state reflects the map renderer (Diorama vs Atlas), not just pathname#335

Merged
TortoiseWolfe merged 1 commit into
mainfrom
fix/nav-active-highlight
Jul 19, 2026
Merged

fix: nav active-state reflects the map renderer (Diorama vs Atlas), not just pathname#335
TortoiseWolfe merged 1 commit into
mainfrom
fix/nav-active-highlight

Conversation

@TortoiseWolfe

Copy link
Copy Markdown
Owner

Follow-up to #334. usePathname() is query-blind, so both map links resolve to /chatt and 'Atlas' stayed highlighted even on the diorama. The highlight now reflects the actual renderer (selectRenderer(window.location.search), read client-side behind a mount flag to avoid a hydration mismatch; the map links full-navigate so the nav re-mounts and re-reads on each switch). Verified locally: on ?diorama, Diorama is the active item (desktop + mobile); /chatt keeps Atlas active. type-check + lint green.

…just pathname

usePathname() ignores the query, so both map links resolve to /chatt and the
active-state lit up 'Atlas' even while the diorama (?diorama) was showing. Base
the highlight on the actual renderer via selectRenderer(window.location.search),
read client-side (mount flag) to avoid a hydration mismatch — the map links
full-navigate, so the nav re-mounts and re-reads on every switch. Other nav
items keep the pathname-based active check.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@TortoiseWolfe
TortoiseWolfe merged commit 3215b06 into main Jul 19, 2026
6 checks passed
@TortoiseWolfe
TortoiseWolfe deleted the fix/nav-active-highlight branch July 19, 2026 19:42
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.

2 participants