Skip to content

fix(nav): drop duplicate child crumb from breadcrumb trails - #681

Open
chrisgeo wants to merge 1 commit into
mainfrom
fix/breadcrumb-duplicate-child-crumb
Open

fix(nav): drop duplicate child crumb from breadcrumb trails#681
chrisgeo wants to merge 1 commit into
mainfrom
fix/breadcrumb-duplicate-child-crumb

Conversation

@chrisgeo

Copy link
Copy Markdown
Contributor

Problem

The Improve → Automations page rendered its breadcrumb as Improve / Automations / Automations (reported via screenshot). The page itself was not broken — the empty "All monitored metrics are within thresholds" card is a legitimate `detectorReady === true` empty state.

Root cause

`navTrailForPathname()` is a complete trail builder: for a registered nav child it returns the full Area → Child pair (its unit-test contract asserts ["Admin","Connections"]), with the child as the link-less current crumb. Six pages appended a second hard-coded child crumb on top of that complete trail, and the accompanying .map(c => ({ ...c, href: c.href ?? area })) also forced an href onto the link-less current crumb — turning the duplicate into a stray link back to the area landing page.

Fix

Page Before After
improve/automations Improve / Automations / Automations Improve / Automations
ai/automations AI / Automations / Automations AI / Automations
ai/impact AI / Impact / Impact AI / Impact
ai/review-load AI / Review Load / Review Load AI / Review Load
ai/risk AI / Governance Risk / Governance Risk [/ tab] AI / Governance Risk [/ tab]
ai/impact/evidence AI / Impact / Impact / PR Evidence AI / Impact / PR Evidence
  • Simple child pages pass navTrailForPathname() through directly.
  • Sub-pages (ai/risk tabs, ai/impact/evidence) slice(0, -1) the trail's current-page crumb and re-add the parent as a filter-preserving link.
  • ai/attribution intentionally unchanged — its child is navVisible: false, so its trail is area-only and the manual append is correct.

No change to navTrailForPathname itself, so its unit-test contract is preserved.

Verification

  • tsc --noEmit: clean
  • Navigation unit tests: 169/169 pass
  • Prettier: clean on all 6 files
  • e2e ai-navigation: 6 passed · ai-governance-risk-tabs: 8 passed

@chrisgeo
chrisgeo force-pushed the fix/breadcrumb-duplicate-child-crumb branch from 49e636e to 52a2fb7 Compare June 13, 2026 05:00
@chrisgeo
chrisgeo force-pushed the fix/breadcrumb-duplicate-child-crumb branch from 52a2fb7 to d4eb79d Compare July 20, 2026 01:45
navTrailForPathname already returns the complete Area → Child trail (its
unit-test contract: ['Admin','Connections']). Six pages appended a second
hard-coded child crumb on top of it, rendering 'Improve / Automations /
Automations' (and likewise for AI Impact / Review Load / Automations /
Governance Risk / PR Evidence). The accompanying .map(href ?? area) also
forced an href onto the link-less current crumb, turning the duplicate
into a stray link back to the area landing page.

- Simple child pages now pass navTrailForPathname() through directly.
- Sub-pages (ai/risk tabs, ai/impact/evidence) slice off the trail's
  current-page crumb and re-add the parent as a filter-preserving link.
- ai/attribution is intentionally unchanged: its child is navVisible:false
  so the trail is area-only and the manual append is correct.

Verified: tsc clean, 169 nav unit tests pass, ai-navigation (6) and
ai-governance-risk-tabs (8) e2e pass.
@chrisgeo
chrisgeo force-pushed the fix/breadcrumb-duplicate-child-crumb branch from d4eb79d to 64b0c02 Compare July 25, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant