Repository navigation
Conversation
Contributor
Code Metrics Report
Details | | main (1cae270) | #660 (6d0bdab) | +/- |
|---------------------|----------------|----------------|-------|
+ | Coverage | 89.5% | 89.5% | +0.0% |
| Files | 265 | 265 | 0 |
| Lines | 7590 | 7591 | +1 |
+ | Covered | 6799 | 6801 | +2 |
- | Test Execution Time | 2m40s | 3m37s | +57s |Code coverage of files in pull request scope (94.4% → 94.7%, patch 100.0%)
Reported by octocov |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Static navigation exposes redirecting paths with embedded dynamic parameters and their descendants as sidebar and Palette links containing literal placeholders such as :id.
1 open issue
What changed in this PR
This PR separates redirect behavior from navigation visibility so AppShell’s automatic sidebar and Command Palette retain redirecting pages and their visible descendants.
Changes:
- Keep redirect-only pages navigable at their original paths, including current-path-aware dynamic entries.
- Add regression tests for redirecting parents, componentless pages, and sidebar/Palette integration.
- Include a patch changeset describing the behavior change.
| File | Description |
|---|---|
packages/core/src/routing/navigation.tsx |
Preserve redirecting entries and descendants in navigation builders. |
packages/core/src/routing/navigation.test.tsx |
Cover redirects, dynamic paths, and componentless guard outcomes. |
packages/core/src/components/sidebar/default-sidebar.test.tsx |
Verify redirecting links and descendant Palette entries together. |
packages/core/src/components/command-palette/command-palette.tsx |
Update a comment to reflect componentless navigable pages; no functional change. |
.changeset/tidy-guards-navigate.md |
Document the navigation fix for a patch release. |
Review effort: Balanced
|
|
||
| const guardResult = await runGuards(module.guards); | ||
| if (guardResult.type !== "pass") return null; | ||
| if (guardResult.type === "hidden") return null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Motivation
A parent page that returns
redirectTo()currently removes its entire subtree from Command Palette entries and automatic sidebar navigation. This makes reachable child pages disappear even though page guards apply only to their own index routes, not to descendants.Redirect-only pages without a component are also valid navigation entry points, but were treated as non-navigable namespaces. Redirecting to a default child should not require a placeholder component or hide the parent link.
Design Decision
Keep redirect behavior separate from visibility
Only
hidden()prunes a navigation subtree. Aredirectresult makes the page navigable even without a component, while componentless pages returningpass()remain non-clickable. Links retain their original paths so the route guard runs on navigation rather than baking its redirect destination into the menu.This applies to both shared static navigation and current-path-aware dynamic Palette entries. AutoSidebar's display depth and page-guard inheritance remain unchanged.
Summary
pass()/hidden()behavior, and AutoSidebar/Palette integration.