| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Red on the wiring: NavigationItem still prefix-matches props.path, so /de is current on every subpage. Refs: nav double-active
Refs: nav double-active
| Back | FazBrowse Home | New Git URL |
Two nav items were highlighted at once on every subpage — reported from the Team page, where both "Übersicht" and "Team" were lit.
Cause
The prefix half is what keeps a section link current on its own subpages — /de/team staying lit on /de/team/someone. But the home link's path is the locale root, and /de is a prefix of everything under it. So "Übersicht" was current on Team, Blog, Community-POIs and the rest.
Measured on /de/team before the fix:
aria-current is the part that matters beyond the highlight — a screen reader announced two different links as the current page, which is a false statement about where the user is, not a styling nit.
Not a regression from the audit work
Worth stating, since that was the initial suspicion. The rule dates to f86f20b (#40); git log -S finds no other commit touching it. My #237 edited this file but only swapped variant from a frozen constant to withDefaults.
Checked rather than argued: at 7f0f2a6^ — the commit immediately before #237 — /de/team already served both links with aria-current="page".
Fix
Depth, not a hardcoded home path: a link matches by prefix only when it has a segment of its own below the locale root. Extracted to utils/navigation.ts so it can be tested without a runtime.
After, across six routes:
One thing that looks wrong in that output and is not
/de/blog also reports a second aria-current="page". It is the footer's blog link, and the attribute comes from Vue Router itself (router-link-exact-active), not from this component — a link that genuinely points at the current page. Inside the navigation, exactly one item is current.
The guard
The pure function is covered in both directions: exact match, section-with-subpage, locale root against every page, and a sibling that merely shares a prefix (/de/teams must not light /de/team — the old rule got that right too, via the trailing slash, and the new one keeps it).
One test holds the old implementation verbatim and asserts the two now disagree. Without it the suite would pass just as happily against the buggy version and prove nothing.
Gates
Suite: 154 tests, 50 files. Build green. Ratchet unchanged at 319 / 36 / 21.
🤖 Generated with Claude Code
https://claude.ai/code/session_017uWFJwn6dswmNtR8kKB86s