Skip to content

feat: replace docs section dropdown with Vercel-style breadcrumbs - #104

Merged
charlesrhoward merged 1 commit into
mainfrom
feat/docs-breadcrumbs
Aug 16, 2026
Merged

feat: replace docs section dropdown with Vercel-style breadcrumbs#104
charlesrhoward merged 1 commit into
mainfrom
feat/docs-breadcrumbs

Conversation

@charlesrhoward

@charlesrhoward charlesrhoward commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

What

Removes the centered Docs ⌄ section picker from the docs header and makes the article breadcrumb the primary wayfinding element, Vercel-docs style: Docs › Section › … › Page.

Changes

  • src/components/docs-breadcrumbs.tsx (new) — server component that walks the fumadocs page tree to the current page. Docs links to /, intermediate folders link to their index pages, last crumb is plain text with aria-current="page". Uses a small local trail walker because fumadocs' getBreadcrumbItems with includeRoot labels the root crumb with the tree title ("Mogplex Documentation") instead of the section name.
  • src/components/docs-header.tsx — drops DocsSectionPicker, its trigger/popover, and the now-unused usePathname/isActivePath helpers. Section navigation still exists via the sidebar tabs and mobile drawer.
  • src/app/(docs)/[[...slug]]/page.tsx — disables fumadocs' built-in breadcrumb slot, renders DocsBreadcrumbs above the title.
  • src/app/global.css — removes picker CSS; restyles .docs-breadcrumb from tiny mono/uppercase to 13px muted sans with chevron separators and hover states.
  • src/lib/layout.shared.tsx — removes the orphaned docsSectionItems export.

Verified

  • /cliDocs › CLI › Overview; /cli/concepts/architectureDocs › CLI › Concepts › Architecture; /Docs › Welcome to Mogplex
  • Dark and light mode
  • pnpm lint, pnpm types:check, pnpm test (17/17), pnpm build

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Remove the centered "Docs" section picker from the header and make the
article breadcrumb the primary wayfinding element instead: a tree-derived
trail (Docs / Section / ... / Page) with chevron separators, muted sans
styling, linked ancestors, and aria-current on the current page.
@vercel

vercel Bot commented Aug 16, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
mogplex-docs Ready Ready Preview Aug 16, 2026 12:49am

Request Review

@mogplex

mogplex Bot commented Aug 16, 2026

Copy link
Copy Markdown

Mogplex PR Review

Status: No material issues found

Reviewed PR #104 — replacing the docs section dropdown with breadcrumb-based wayfinding. No critical or blocking issues found.

Correctness assessment: The findTrail recursive walker in docs-breadcrumbs.tsx is sound. It handles nested folders correctly (each folder crumb includes node.index?.url, so folders without index pages render as plain text rather than dead links), the empty-trail fallback (?? []) produces a safe "Docs-only" breadcrumb for pages not found in the tree, and the root page case works (both / crumbs can coexist without conflict since only the last has aria-current="page").

Accessibility: The nav has aria-label="Breadcrumb", the last crumb has aria-current="page", and chevron icons are aria-hidden. Solid implementation of the ARIA breadcrumb pattern.

Cleanup: All newly-orphaned code (DocsSectionPicker, usePathname, isActivePath, docsSectionItems, picker CSS) was removed — no leftover dead code. ChevronDown is retained because DashboardMenu still uses it. 'use client' status on docs-header.tsx is correct because useDocsLayout, useDisclosureMenu, and sidebar slot hooks all require client-side rendering.

CSS: Removal of .docs-section-trigger[aria-expanded='true'] svg from the shared compound selector (leaving .docs-dashboard-more[aria-expanded='true'] svg) is accurate. The .docs-header-center removal from the responsive media query is fine since the class no longer exists.

Suggestion (non-blocking): The findTrail recursive function has several edge cases worth unit-testing — folders without index pages, root-level pages, deep nesting, and the not-found fallback. Extracting it into a shared util and adding a small test would be consistent with the project's existing test suite (17 tests). This is a suggestion, not a blocker; the visual verification in the PR description is sufficient for a server-rendered breadcrumb component of this size.

View check run

@charlesrhoward
charlesrhoward merged commit abe71f5 into main Aug 16, 2026
8 checks passed
@charlesrhoward
charlesrhoward deleted the feat/docs-breadcrumbs branch August 16, 2026 00:54
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