Skip to content

feat(navigation): add route defined tabs - #1272

Merged
tannerlinsley merged 3 commits into
TanStack:mainfrom
harry-whorlow:route-defined-tabs
Nov 1, 2026
Merged

tannerlinsley merged 3 commits into
TanStack:mainfrom
harry-whorlow:route-defined-tabs

Conversation

@harry-whorlow

@harry-whorlow harry-whorlow commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Added configurable documentation tabs for chart and highlight tools, including catalog and theme-editor navigation.
    • Added route-based tab selection and full-width layouts for selected Examples, npm statistics, catalog, and theme-editor pages.
  • Improvements
    • Improved active-tab and menu expansion behavior for custom tool destinations.
    • Custom tool links navigate directly without route preloading.

@harry-whorlow harry-whorlow changed the title feat(navigation): add route defiend tabs feat(navigation): add route defined tabs Sep 14, 2026
@coderabbitai

coderabbitai Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 306ed33d-a883-475b-a2f2-b87450107a24
Commits

Reviewing files that changed from the base of the PR and between 4a522ab and 7ef865f.

Files selected for processing: 9
  • src/components/LibraryLayout.tsx
  • src/components/library-layout-navigation.ts
  • src/libraries/custom-tool-tabs.ts
  • src/router.tsx
  • src/routes/_library/$libraryId/$version.docs.framework.$framework.examples.$.tsx
  • src/routes/_library/charts.catalog.tsx
  • src/routes/_library/highlight.$version.theme-editor.tsx
  • src/utils/docsNavTabs.ts
  • tests/charts-sidebar-navigation.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Walkthrough

The change adds custom tool tab definitions and route metadata. Library navigation and layout logic now use library-aware custom targets and route-provided tab settings. Charts-specific menu handling is removed, and navigation tests cover the updated configuration and helper signatures.

Changes: Custom library tool tabs

Layer / File(s) Summary
Tab contracts and route metadata
src/libraries/custom-tool-tabs.ts, src/router.tsx, src/routes/_library/..., src/utils/docsNavTabs.ts
Custom tool tab definitions and route docsTab metadata are added. Tab configuration accepts custom tools, and active-tab selection accepts an override.
Custom target navigation
src/components/library-layout-navigation.ts, tests/charts-sidebar-navigation.test.ts
Navigation helpers use typed LibraryId values and classify targets with isCustomToolTarget. Tests cover chart and highlight tabs and updated helper arguments.
Library layout integration
src/components/LibraryLayout.tsx
Charts-specific menu entries are removed. Configured tabs and route metadata control tab selection and full-bleed layout. Custom-tool links use updated route-origin and intent-preload behavior.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant RouteStaticData
  participant LibraryLayout
  participant customToolTabs
  participant NavigationLink
  RouteStaticData->>LibraryLayout: Provide docsTab metadata
  LibraryLayout->>customToolTabs: Check library and target
  customToolTabs-->>LibraryLayout: Return custom target status
  LibraryLayout->>NavigationLink: Configure route origin and preload behavior
Loading

Possibly related PRs

  • TanStack/tanstack.com#1168: Introduced Highlight theme-editor navigation and custom-tool route handling, which this change configures through shared tab definitions and route metadata.

Suggested reviewers: ladybluenotes, tannerlinsley

Merge Risk: Minimal · up to 7ef86

No merge-blocking issue was identified.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the main change: adding route-defined navigation tabs. It is concise and directly related to the changeset.
Docstring Coverage Passed Docstring coverage is inconclusive: files from earlier reviews still need to be rechecked within the check's analysis limits. Not blocking.
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.
Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@tannerlinsley
tannerlinsley merged commit 9b3c43b into TanStack:main Nov 1, 2026
@changeset-bot

changeset-bot Bot commented Nov 1, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 7ef865f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@tannerlinsley

Copy link
Copy Markdown
Member

Thanks for putting this together! The route metadata also fits the theme editor that's on main now. The branch is updated against main, with a correction to keep the existing chart links under one Examples tab.

AI review notes:
Pushed 7ef865f9ae794ff8410b4d9eb8255366e05cfd35 to this branch. The original helper plus current Charts config produced two Examples tabs: the existing examples tab held the menu groups, while the active catalog tab had none. The update reuses the examples identity and preserves its groups while overriding the destination. It also wires the existing Highlight theme editor into the route metadata and keeps main's content-width behavior.
Full pnpm test and the normal commit hook passed: TypeScript and lint, 690 unit tests with 5 skipped, 2,278 chat tests with 6 skipped, and 20 desktop tests with 1 skipped. Focused regressions cover group preservation, a config without an Examples group, and the versioned theme-editor destination.
In fresh Chromium, the actual candidate layout with current public Charts config supplied through its query cache showed one active Examples tab and 188 links inside the expanded Individual Charts group on desktop and mobile. The theme editor also rendered with its active tab. This is local app and controlled config verification, not a production deployment of this change.
The unmodified local catalog detail hit a missing d3-sankey package-metadata error; the same server error occurred with main's source, while the public production detail loaded successfully. That local detail limitation is separate from the navigation checks. New-head CI is running, so this is not merged yet.

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.

2 participants