Skip to content

Added a navigation seam over the settings routing provider - #29762

Merged
9larsons merged 2 commits into
mainfrom
slars/settings-navigation-seam
Aug 5, 2026
Merged

9larsons merged 2 commits into
mainfrom
slars/settings-navigation-seam

Conversation

@9larsons

@9larsons 9larsons commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

First step toward native settings routing. Settings is the last consumer of the deprecated admin-x-framework RoutingProvider; replacing it means touching every navigation call site, so this PR routes them all through one settings-local seam first — the upcoming router swap then happens inside a single hook without touching screen call sites again.

What changed

  • New useSettingsNavigation() in apps/admin/src/settings/app/hooks/use-settings-navigation.ts — a pass-through to the framework's useRouting() (same route/updateRoute/loadingModal surface).
  • All 65 files that called useRouting() now call the seam instead (143 updateRoute call sites). No behavior change by construction: the hook delegates to the same provider.
  • Deliberately untouched (they are the router swap's own surface, not screen call sites): the RoutingProvider mount in app.tsx, settings-router.tsx's useRouteChangeCallback (the same-path re-scroll consumer), and the type-only RoutingModalProps imports.

Contract the seam preserves for the swap: same-path navigation stays history-entry-free — a sidebar re-click re-scrolls via the routeChange event without pushing a history entry.

Verification

  • Unit: 125 files / 1320 tests pass
  • Acceptance: 55 files / 406 tests pass (includes all settings navigation/modal specs, unchanged)
  • tsc -b, full lint clean
  • Independent review agent machine-verified all 65 files are import-line-only changes (non-import diff empty vs main) and that the dropped eventTarget field has zero consumers in the settings tree

- settings is the last consumer of the deprecated admin-x-framework RoutingProvider; replacing it requires touching every navigation call site, so this routes all of them through one settings-local hook first
- useSettingsNavigation() is a pass-through to useRouting() today; the router swap happens inside the hook without touching call sites again
- contract note for the swap: same-path navigation must stay history-entry-free (sidebar re-click re-scrolls via the routeChange event without pushing an entry)
@coderabbitai

coderabbitai Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Added useSettingsNavigation, which exposes route, updateRoute, and loadingModal through the settings app. Replaced direct useRouting usage across settings providers, pages, navigation controls, and modals. Existing route destinations and update calls remain unchanged.

Possibly related PRs

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: adding a settings-local navigation seam over the existing routing provider.
Description check ✅ Passed The description directly explains the new hook, the affected call sites, preserved behavior, and verification results.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch slars/settings-navigation-seam

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit fd22998

Command Status Duration Result
nx run @tryghost/admin:test:acceptance ✅ Succeeded 6m 11s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-08-05 13:48:06 UTC

@9larsons
9larsons merged commit d871246 into main Aug 5, 2026
81 of 83 checks passed
@9larsons
9larsons deleted the slars/settings-navigation-seam branch August 5, 2026 13:49
9larsons added a commit that referenced this pull request Aug 5, 2026
…29763)

ref #29762

`SettingsModal` (shade) and `PreviewModalContent` (settings) could only
close through NiceModal's `modal.remove()` — and `useModal()` throws
when a component mounts outside a NiceModal context. That blocks
mounting settings modals as route elements, which the upcoming router
swap needs.
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.

1 participant