Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Preview build of published Zudoku package for commit 1a7b616. See the deployment at: https://0bb54732.cosmocargo-public-package.pages.dev Note This is a preview of the Cosmo Cargo example using the Zudoku package published to a local registry to ensure it'll be working when published to the public NPM registry. Last updated: 2026-02-13T16:00:29.985Z |
There was a problem hiding this comment.
Pull request overview
Adds a declarative navigationRules configuration to transform generated navigation (especially OpenAPI-derived sidebars) without changing source schemas, and wires those rules through the Vite virtual module into the runtime navigation context.
Changes:
- Introduces
navigationRulesconfig schema/types and Vite virtual module export for resolved rules. - Adds rule application utilities (
pathMatcher,applyRules) with Vitest coverage. - Updates runtime navigation + a few UI components to consume rule-modified navigation and reuse shared navigation helpers.
Reviewed changes
Copilot reviewed 22 out of 26 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/zudoku/src/vite/plugin-navigation.ts | Resolves navigation + navigation rules and exports both via virtual:zudoku-navigation. |
| packages/zudoku/src/types.d.ts | Updates virtual module typings to include configuredNavigationRules. |
| packages/zudoku/src/lib/plugins/openapi/OperationList.tsx | Uses usePrevNext for pagination fallback based on navigation order. |
| packages/zudoku/src/lib/navigation/pathMatcher.ts | Adds path parsing/matching for rule targets (label/index paths). |
| packages/zudoku/src/lib/navigation/pathMatcher.test.ts | Adds unit tests for path matching behavior (incl. negative indices). |
| packages/zudoku/src/lib/navigation/applyRules.ts | Applies insert/modify/remove/sort rules to navigation trees with warnings. |
| packages/zudoku/src/lib/navigation/applyRules.test.ts | Adds extensive unit tests for rule application and scoping. |
| packages/zudoku/src/lib/core/ZudokuContext.ts | Adds navigationRules to context options/state. |
| packages/zudoku/src/lib/components/navigation/utils.ts | Adds getItemPath/getFirstMatchingPath, tweaks list item spacing, updates shouldShowItem signature. |
| packages/zudoku/src/lib/components/navigation/NavigationWrapper.tsx | Adjusts wrapper layout classes (gap removal). |
| packages/zudoku/src/lib/components/navigation/NavigationItem.tsx | Updates shouldShowItem call site; doc-item label/badge rendering tweak. |
| packages/zudoku/src/lib/components/context/ZudokuContext.ts | Applies navigationRules to the computed sidebar navigation (with dev warnings). |
| packages/zudoku/src/lib/components/TopNavigation.tsx | Uses shared helpers and updated shouldShowItem signature. |
| packages/zudoku/src/lib/components/MobileTopNavigation.tsx | Updates shouldShowItem call site for mobile top nav. |
| packages/zudoku/src/config/validators/validate.ts | Adds navigationRules to config validation/types. |
| packages/zudoku/src/config/validators/NavigationSchema.ts | Adds resolved rule types + NavigationResolver.resolveRules() and initialization caching. |
| packages/zudoku/src/config/validators/InputNavigationSchema.ts | Adds Zod schemas/types for navigation rules (insert/modify/remove/sort). |
| packages/zudoku/src/app/main.tsx | Passes configuredNavigationRules into app options. |
| examples/cosmo-cargo/zudoku.config.tsx | Demonstrates navigationRules usage in an example config. |
| examples/cosmo-cargo/pages/api-shipments/getting-started.mdx | Adds example doc content referenced by rules. |
| docs/sidebar.ts | Adds the new Navigation Rules guide to docs sidebar. |
| docs/public/docs/navigation-rules/insert-doc-end.png | Adds screenshot asset for the guide. |
| docs/pages/docs/guides/navigation-rules.mdx | Adds a practical guide for using navigation rules. |
| docs/pages/docs/configuration/navigation.mdx | Adds configuration reference section for navigation rules and updates code fence. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
41b35db to
a5053a6
Compare
a5053a6 to
b8acac3
Compare
# Conflicts: # examples/cosmo-cargo/zudoku.config.tsx
b8acac3 to
05d5fa5
Compare
05d5fa5 to
df84f73
Compare
3de66ac to
1a7b616
Compare
navigationRulesconfig for declaratively transforming navigation itemsinsert,modify,remove,sort, 'move'Shipments/Domestic)Docs preview
Supersedes: #1904