Skip to content

Keep generated sidebar links aligned with toolkit routes#1066

Open
jottakka wants to merge 1 commit into
split/validate-toolkit-doc-routesfrom
split/sync-toolkit-sidebar-routes
Open

Keep generated sidebar links aligned with toolkit routes#1066
jottakka wants to merge 1 commit into
split/validate-toolkit-doc-routesfrom
split/sync-toolkit-sidebar-routes

Conversation

@jottakka

@jottakka jottakka commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • reuse the canonical toolkit-slug contract when generating sidebar metadata
  • normalize invalid categories and safely serialize generated labels and keys

Dependency

Depends on #1065 for the shared route and slug contract.

Test plan

  • pnpm exec vitest run --root toolkit-docs-generator --config vitest.config.ts tests/scripts/sync-toolkit-sidebar.test.ts

Note

Low Risk
Docs-generator-only changes with stricter slug/category validation; depends on the shared slug module from #1065.

Overview
Generated integrations sidebar metadata now uses the shared getToolkitSlug helper instead of local slug parsing, so nav hrefs match app static routes and unsafe docsLink segments fall back to kebab-case or normalized IDs.

Category paths are clamped with normalizeCategory: only known category keys are used; anything else (e.g. path-like values) is routed under others. _meta.tsx output uses JSON.stringify for titles, hrefs, and non-identifier keys so quotes, backslashes, and newlines in labels cannot break the generated file.

Tests cover unknown categories, bad docsLink slugs, legacy toolkit IDs, and label escaping.

Reviewed by Cursor Bugbot for commit 6a921fc. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jul 16, 2026 8:21pm

Request Review

Reuse the canonical toolkit slug and category validation when rendering sidebar metadata, including safely escaped labels and keys.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jottakka
jottakka force-pushed the split/sync-toolkit-sidebar-routes branch from 6a921fc to 7f18a7e Compare July 16, 2026 20:18
@jottakka jottakka self-assigned this Jul 16, 2026
@jottakka
jottakka marked this pull request as ready for review July 18, 2026 21:53
@cursor

cursor Bot commented Jul 18, 2026

Copy link
Copy Markdown

Current version of PR was reviewed by /review-bugbot on Jul 16, 15:31 GMT-3. It flagged 0 findings.

Bugbot on commit 7f18a7e is skipped.

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