Skip to content

feat(renderer): adopt data router navigation - #3593

Merged
setchy merged 3 commits into
mainfrom
feat/renderer-data-router
Nov 1, 2026
Merged

setchy merged 3 commits into
mainfrom
feat/renderer-data-router

Conversation

@setchy

@setchy setchy commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Moves the renderer from the declarative react-router-dom@7.18.5 <HashRouter> + <Routes> tree to a single React Router 8 data-router table.

  • Replaces react-router-dom@7.18.5 with react-router@8.5.0 and updates every renderer/test import, mock, and the packaged-dependency check.
  • Adds router.tsx as the single route table with createHashRouter and RouterProvider from react-router/dom.
  • Adds a RootLayout route for the app shell (sidebar, global shortcuts, routed <Outlet />) and a ProtectedLayout route for the login guard.
  • Shares sidebar destinations and shortcut routes through nav.ts; the active destination is exposed with aria-current while every control stays an IconButton.
  • Returns to the originally requested destination after login and adds a catch-all route for unknown hashes.
  • Keeps the existing sidebar toggle behavior (clicking an active Filters/Settings returns home).

Verification

  • pnpm check
  • pnpm test — 2090 passed
  • pnpm test:visual — 176 passed in the pinned Linux container
  • pnpm build

Deferred

  • The Electron React DevTools profile for the Inbox ↔ Filters toggle (planned as task 7.1 in 08-adopt-data-router-navigation) is not recorded yet. The router change is not presented as a fix for that toggle.
  • Router error boundaries are a separate follow-up PR.

Replace the declarative HashRouter/Routes tree with a single
createHashRouter route table and RouterProvider. Move the window chrome,
global shortcuts, and sidebar into a root layout route, and the login
guard into a protected layout route.

Share sidebar destinations and shortcut routes through nav.ts, render
route destinations as NavLinks, and return to the requested destination
after login. Add a catch-all route for unknown hashes.

Upgrade react-router-dom@7.18.5 to react-router@8.5.0, update imports,
test helpers, mocks, and the packaged-dependency check.
@github-actions github-actions Bot added dependency Dependency updates enhancement New feature or enhancement to existing functionality labels Nov 1, 2026
Restore literal t() keys for the sidebar copy so removeUnusedKeys keeps them, and leave nav.ts as paths and shortcuts only.
Expose the active destination with aria-current instead of rendering route controls as links. This avoids the Primer link-specific icon sizing workaround and keeps the existing toggle behavior without click interception.
@sonarqubecloud

sonarqubecloud Bot commented Nov 1, 2026

Copy link
Copy Markdown

@setchy
setchy marked this pull request as ready for review November 1, 2026 20:25
@setchy
setchy requested a review from afonsojramos as a code owner November 1, 2026 20:25
@setchy
setchy merged commit cdf770b into main Nov 1, 2026
27 checks passed
@setchy
setchy deleted the feat/renderer-data-router branch November 1, 2026 20:25
@github-actions github-actions Bot added this to the Release 8.0.0 milestone Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependency Dependency updates enhancement New feature or enhancement to existing functionality

Development

Successfully merging this pull request may close these issues.

1 participant