docs(ui): replace 49 hand-rolled docs.*.tsx thin routes with one dynamic docs.$slug.tsx route#8181
Closed
JSONbored wants to merge 1 commit into
Closed
docs(ui): replace 49 hand-rolled docs.*.tsx thin routes with one dynamic docs.$slug.tsx route#8181JSONbored wants to merge 1 commit into
JSONbored wants to merge 1 commit into
Conversation
…mic docs.$slug.tsx route
Every docs page carried an identical hand-rolled TanStack route file: a loader
calling getDocPage, head/og meta duplicating the .mdx frontmatter's own
title/description, and the same DocsPage + Suspense/LoadingState body. Adding
a page meant touching 5+ files and regenerating the route tree; two tests
pinned the route-file count and had to be bumped on every addition.
- One dynamic docs.$slug.tsx route replaces all 49 per-page files. title/
description come from frontmatter (already did); eyebrow (the one real
per-page datum, previously a hand-copied JSX prop) moves into frontmatter
too, via a new required field in source.config.ts's page schema.
- docs.index.tsx (a real static page) and docs.fumadocs-spike-api-reference.tsx
(a standalone Scalar widget, not DocsPage/MDX at all) stay as their own
routes -- audited, neither is boilerplate this replaces.
- Every literal `to="/docs/<slug>"` Link across the app (nav sidebar, footer,
header dropdown, home page, install flow, agents/miners/maintainers pages)
now uses the typed `to="/docs/$slug" params={{ slug }}` form instead --
done properly with real params, not a type-erasing cast, including fixing
two pre-existing `as "/docs"` casts in docs-nav.tsx/docs.index.tsx found
along the way.
- docs.miner-coding-agent.tsx's three exported data arrays (asserted against
by a test, unrelated to routing) moved to
src/lib/miner-coding-agent-docs-data.ts; their test moved alongside them.
- The two route-file-count-pinning tests (docs-source-server-isolation,
docs-routes-loading-state) now assert the single dynamic route's shape
instead of a per-page count.
- Three test-only `Link` mocks (docs.ams-observability-callout,
install, install.permissions) updated to interpolate $-params the same
way the real router resolves them, so their href assertions stay faithful.
Verified in the browser: real docs pages render correctly (title/eyebrow/
description/MDX content), sidebar nav renders + highlights the active page,
client-side navigation works, a nonexistent slug renders a real 404, the
docs index and the untouched Scalar API route both still work.
Closes #8151.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
loopover-ui | 32e8b17 | Commit Preview URL Branch Preview URL |
Jul 23 2026, 09:08 AM |
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Owner
Author
Merged
8 tasks
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.
Summary
Every docs page carried an identical hand-rolled TanStack route file: a loader calling
getDocPage, head/og meta duplicating the.mdxfrontmatter's own title/description, and the sameDocsPage+Suspense/LoadingStatebody. Adding a page meant touching 5+ files and regenerating the route tree; two tests pinned the route-file count and had to be bumped on every addition.docs.$slug.tsxroute replaces all 49 per-page files.title/descriptioncome from frontmatter (already did);eyebrow(the one real per-page datum, previously a hand-copied JSX prop) moves into frontmatter too, via a new required field insource.config.ts's page schema.docs.index.tsx(a real static page) anddocs.fumadocs-spike-api-reference.tsx(a standalone Scalar widget, notDocsPage/MDX at all) stay as their own routes -- audited, neither is boilerplate this replaces.to="/docs/<slug>"Linkacross the app (nav sidebar, footer, header dropdown, home page, install flow, agents/miners/maintainers pages) now uses the typedto="/docs/$slug" params={{ slug }}form instead -- done properly with real params, not a type-erasing cast, including fixing two pre-existingas "/docs"casts indocs-nav.tsx/docs.index.tsxfound along the way.docs.miner-coding-agent.tsx's three exported data arrays (asserted against by a test, unrelated to routing) moved tosrc/lib/miner-coding-agent-docs-data.ts; their test moved alongside them.docs-source-server-isolation,docs-routes-loading-state) now assert the single dynamic route's shape instead of a per-page count.Linkmocks (docs.ams-observability-callout,install,install.permissions) updated to interpolate$-params the same way the real router resolves them, so their href assertions stay faithful.Closes #8151.
Test plan
npm run --workspace apps/loopover-ui typecheck-- clean, zero errors (25 real type errors from the route collapse fixed with properparams, not casts).npm run --workspace apps/loopover-ui lint-- 0 errors (pre-existing repo-widereact-refresh/only-export-componentswarnings on route files, unrelated to this change).apps/loopover-uitest suite: 509/509 passing across 81 files.npm run docs:drift-check-- clean.npm run --workspace apps/loopover-ui build-- production build succeeds./docs/quickstart) renders correct title/eyebrow/description/MDX content; sidebar nav renders and highlights the active page; client-side navigation between docs pages works; a nonexistent slug renders a real 404 with a "Go home" link; the docs index (/docs) and the untouched Scalar API reference route (/docs/fumadocs-spike-api-reference) both still work.apps/**, outsidecoverage.include, so Codecov does not gate this patch (per the issue's own Test Coverage Requirements note).