From 39125b50281d0cf2b2834c0ebe804fd71ee5ae9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Fri, 7 Aug 2026 12:45:59 +0000 Subject: [PATCH] let the router decide which nav item is active Dock, Header and the mobile sheet were computing active state from useLocation with two copies of the same startsWith helper. react-router's NavLink already knows. end is set for Home only: without it NavLink treats '/' as an ancestor of every route, and with it on the others a detail route would lose its highlight. Segment matching is stricter than the string prefix it replaces, which is what was meant all along. Co-Authored-By: Claude Opus 5 --- docs/navigation-audit.md | 12 ++-- .../Screens/Dashboard/Layout/Dock.tsx | 60 +++++++++-------- .../Dashboard/Layout/Header/Header.tsx | 67 ++++++++++--------- 3 files changed, 75 insertions(+), 64 deletions(-) diff --git a/docs/navigation-audit.md b/docs/navigation-audit.md index f68f1b3f..f1e415da 100644 --- a/docs/navigation-audit.md +++ b/docs/navigation-audit.md @@ -86,7 +86,7 @@ are good building blocks. The **Workspace/Panel framework** contains **zero** ro | ~~M7~~ | ~~`workspaces/components/Combobox.tsx:53`~~ | caller-supplied route | — | **Deleted, not fixed.** "Every caller inherits the opaque click" was the reason this ranked MEDIUM, and it is wrong: `Combobox` has **no callers**. Nothing has imported it since the initial commit, there is no barrel export, and nothing anywhere sets `href` on a `SelectOption` — so the navigate, the separator that only showed for `href` options, and the `href` field on both declarations of the type were all unreachable. Writing anchor semantics into a component that is never rendered is building, not fixing. Its `Command` primitives stay; `AIHarnessesSection` uses them. | | ~~M8~~ | `Layout/Header/UserMenu.tsx` | — | — | **Done.** Removed rather than routed: nothing had ever been built behind `/settings/resources`, so the item was a bounce to `/` dressed as navigation. Its `header.userMenu.resources` locale keys went with it. | | ~~M9~~ | `Screens/Dashboard/Plans/index.tsx` | a plan document | `/plans/:name` | **Done.** Route pair, no `Navigate` guard — the bare route means "no plan open", which is a real state, so the auto-select-first effect was deleted rather than turned into a redirect. The `` on purpose (chrome for one document, not a master list) and therefore genuinely has no cmd-click — a native `