Skip to content

fix: gate dev-error routes centrally and exclude from breadcrumbs#662

Merged
robertocarlous merged 1 commit into
Neurowealth:mainfrom
sammajayi:fix/isolate-dev-routes
Jul 26, 2026
Merged

fix: gate dev-error routes centrally and exclude from breadcrumbs#662
robertocarlous merged 1 commit into
Neurowealth:mainfrom
sammajayi:fix/isolate-dev-routes

Conversation

@sammajayi

@sammajayi sammajayi commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Closes #331


Summary

Dev error-boundary test pages under /dashboard/dev-errors were individually guarded but still appeared in breadcrumbs. This PR centralizes the gate and excludes them from breadcrumb navigation.

Changes

New: src/app/dashboard/dev-errors/layout.tsx

  • Single NODE_ENV !== "production" gate via notFound() — replaces 3 per-page guards
  • Wraps child routes in a dashed-border "Internal — dev-only route" banner for visual clarity

Removed per-page guards

  • dev-errors/page.tsx — removed DEV_ERRORS_ENABLED check + notFound()
  • dev-errors/boundary-error/page.tsx — same
  • dev-errors/route-error/page.tsx — same

src/lib/routeMetadata.tsx

  • buildBreadcrumbsFromPath() now skips devOnly route segments
  • /dashboard/dev-errors/boundary-error renders as Home > Dashboard (not Home > Dashboard > Dev Errors > Boundary Error)

src/lib/routeMetadata.test.ts

  • New test: breadcrumbs skip devOnly routes — verifies dev-errors segments are excluded

What was already working (no changes needed)

  • Sidebar/mobile nav: already excluded devOnly routes via .filter(!devOnly)
  • Command palette: already excluded via !definition.devOnly in isCommandPaletteRoute()
  • Playwright tests: URLs unchanged, dev server runs in development mode so layout.tsx gate passes

Acceptance criteria

  • Scope limited to the files listed (plus layout.tsx)
  • 546/546 tests pass including new breadcrumb test
  • No behavior regressions — routes still accessible in dev mode
  • No new abstractions

Suggested labels

cleanup, routing, testing

- Add dev-errors/layout.tsx as single NODE_ENV gate (replaces 3
  per-page notFound() guards)
- Filter devOnly routes from buildBreadcrumbsFromPath() so
  /dashboard/dev-errors/... no longer shows in breadcrumb navigation
- Add breadcrumb test verifying devOnly segments are skipped
- Command palette and sidebar nav already excluded devOnly routes
- Playwright smoke tests unchanged (URLs preserved)
@drips-wave

drips-wave Bot commented Jul 26, 2026

Copy link
Copy Markdown

@sammajayi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@robertocarlous
robertocarlous merged commit a3667bb into Neurowealth:main Jul 26, 2026
1 check failed
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.

Isolate dev error routes from normal app structure

2 participants