Skip to content

refactor(FR-3279): make the router own 404 via scoped catch-alls and a route error boundary#8208

Draft
yomybaby wants to merge 1 commit into
feat/FR-3057-routing-followup-fixesfrom
feat/FR-3279-router-owned-route-errors
Draft

refactor(FR-3279): make the router own 404 via scoped catch-alls and a route error boundary#8208
yomybaby wants to merge 1 commit into
feat/FR-3057-routing-followup-fixesfrom
feat/FR-3279-router-owned-route-errors

Conversation

@yomybaby

@yomybaby yomybaby commented Jul 8, 2026

Copy link
Copy Markdown
Member

resolves #NNN (FR-MMM)

Checklist: (if applicable)

  • Documentation
  • Minium required manager version
  • Specific setting for review (eg., KB link, endpoint or how to setup)
  • Minimum requirements to check during review
  • Test case(s) to demonstrate the difference of before/after

…a route error boundary

Resolves #8207 (FR-3279)

Route existence was decided OUTSIDE the router: extractRoutePaths re-scanned
the route tree into ROUTER_STATIC_PATHS / ROUTER_DYNAMIC_PATTERNS,
useWebUIMenuItems.isCurrentPageNotFound re-parsed the pathname against that
registry (+ menu keys + plugin pages), and MainLayout overrode the rendered
Outlet with Page404. Three sources of truth that can drift — the FR-3057
cross-scope 404 bug was exactly such a drift.

Now react-router matching IS the existence check:

- each scope subtree (project / project-admin / admin) and the root carry a
  'path: *' catch-all rendering the plugin-aware UnknownRoutePage: wait for
  the plugin list, stay empty for Lit plugin pages (they have no React
  routes), otherwise render the 404 page
- delete the parallel registry (extractRoutePaths, populateRouterPaths,
  ROUTER_STATIC_PATHS, ROUTER_DYNAMIC_PATTERNS), isCurrentPageNotFound
  (incl. the FR-3057 cross-scope special case — router matching now handles
  it naturally), and the now-dead scopeFeatureToMenuKey inverse lookup
- add RouteErrorBoundary on a pathless route inside MainLayout: thrown
  Response errors (404 / 401 / 403) from pages or future loaders render the
  shared route-error language INSIDE the shell; unexpected errors get a
  minimal notice
- 401/blocked guards in MainLayout are untouched — access-control
  restructuring (route-handle-declared access + throwing guards) is a
  separate follow-up

Net -204 lines.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions github-actions Bot added the size:L 100~500 LoC label Jul 8, 2026

yomybaby commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for react-coverage (./react)

Status Category Percentage Covered / Total
🔵 Lines 6.89% 2009 / 29154
🔵 Statements 5.6% 2259 / 40282
🔵 Functions 5.73% 329 / 5733
🔵 Branches 3.73% 1416 / 37941
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
react/src/routes.tsx 0% 0% 0% 0% 43-1472
react/src/components/RouteErrorBoundary.tsx 0% 0% 0% 0% 21-36
react/src/components/MainLayout/MainLayout.tsx 0% 0% 0% 0% 46-420
react/src/helper/pathBuilder.ts 100% 100% 100% 100%
react/src/hooks/useWebUIMenuItems.tsx 7.25% 3.29% 11.11% 10.36% 215, 246-836
react/src/pages/UnknownRoutePage.tsx 0% 0% 0% 0% 24-37
Generated in workflow #2628 for commit 269a0ec by the Vitest Coverage Report Action

@yomybaby

yomybaby commented Jul 10, 2026

Copy link
Copy Markdown
Member Author

🟢 Dev server up — box jongeun-calude-2 (@yomybaby)

📝 열린 비주얼 코멘트 **0건**

http://localhost:7777/?pr=8208 — opens on your own local board · read-only directory

Tunnel et -t "1356:1356" jongeun-calude-2
Dev URL https://routing-review.localhost:1356
Backend http://10.82.0.130:8090
Login not shown on a public repo — run registry.sh query 8208
CA cert registry/ca/jongeun-calude-2.pem

Last updated: 2026-07-10T15:16:05Z · registry.sh query 8208 for details · via fw dev-server-registry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant