Back to Plate

restore docs sidebar nesting

docs/plans/2026-05-31-restore-docs-sidebar-nesting.md

53.0.814.9 KB
Original Source

restore docs sidebar nesting

Objective: Restore the Plate docs sidebar's nested information architecture for categories such as Plugin, Editor, and Plate UI while keeping the current Fumadocs/upstream sidebar primitives.

Completion threshold: The task is complete when Plate-owned content/docs/meta.json category groups feed the sidebar where available, explicit page-tree metadata survives overlay merging, status badges render as inline text pills, /docs/plugin and /docs/installation/plate-ui prove the visible nested sidebar in the in-app browser, and focused typecheck, lint, and source audits pass.

Verification surface:

  • pnpm --filter www typecheck in /Users/zbeyens/git/plate
  • pnpm lint:fix in /Users/zbeyens/git/plate
  • In-app browser proof at http://localhost:3004/docs/plugin and http://localhost:3004/docs/installation/plate-ui
  • Source audit for getSidebarCategoryItems, withDocsOverlayDeep, and status-pill rendering
  • Screenshot artifact: /tmp/plate-sidebar-nesting-proof.png

Constraints:

  • Preserve current Fumadocs sidebar primitives and upstream-compatible rendering.
  • Use Plate metadata as the docs information architecture source instead of hard-coding one route.
  • Do not run build:registry.
  • Do not create commits, pushes, PRs, or tracker updates.
  • Keep unrelated docs/routes unchanged.

Boundaries:

  • Source of truth: content/docs/meta.json _plate.categoryGroups plus existing page-tree metadata.
  • Allowed edit scope: docs sidebar metadata plumbing and nav rendering under apps/www/src.
  • Browser surface: /docs/plugin and /docs/installation/plate-ui on local www dev server.
  • Tracker sync: N/A, user requested local implementation only.
  • Non-goals: broad upstream sidebar rewrite, generated registry/template changes, PR creation.

Output budget strategy: Searches and audits were kept to exact symbols/routes after one accidental broad output stream during process inspection. Final evidence uses capped command output, exact rg patterns, and a browser JSON proof.

Blocked condition: Autonomous work would stop only if the local docs app could not serve the target routes or if the existing Plate category-group metadata was missing. Neither blocker applied.

Task source:

  • Type: in-chat implementation request
  • Title: Restore nested docs sidebar groups
  • Acceptance criteria: nested Plugin and Editor groups restored; Plate UI children restored; New and Updated badges visible as text pills; current primitives retained.
  • Browser surface: www docs app at localhost:3004
  • Root-cause layer: sidebar data assembly lost Plate category-group structure.

Task state:

  • task_type: browser-visible docs UI implementation
  • task_complexity: focused
  • current_phase: closeout
  • current_phase_status: done
  • goal_status: ready for completion gate

Current verdict:

  • verdict: implemented and verified
  • confidence: high
  • next owner: user
  • reason: source, typecheck, lint, and browser proof all match the requested sidebar shape.

Start Gates:

GateAppliesEvidence
Skill analysis before editsyesUsed active autogoal/task flow because the outcome is visible and measurable.
Active goal checked or createdyesActive goal created for nested sidebar restoration.
Source of truth read before editsyesRead current sidebar/nav code and content/docs/meta.json category-group ownership.
Tracker comments and attachments readnoN/A: no issue, PR, or Linear ticket was provided.
Video transcript evidence requirednoN/A: user provided a static screenshot only.
docs/solutions checked for non-trivial existing-code worknoN/A: memory and current source gave the relevant prior context; no solution doc was needed.
TDD decision before behavior change or bug fixyesBrowser-visible nav/data plumbing is better proven by targeted browser checks plus typecheck/lint than a narrow unit test.
Branch decision for code-changing taskyesN/A: no branch operation requested and project instruction says do not check git state proactively.
Release artifact decisionyesN/A: docs app UI/data plumbing only; no package release artifact.
Browser tool decision for browser surfaceyesUsed in-app Browser runtime against localhost:3004.
PR expectation decisionyesN/A: user asked to implement, not create a PR.
Tracker sync expectation decisionyesN/A: no tracker target exists.
Output budget strategy recordedyesRecorded exact-symbol audits and accidental broad-output recovery above.
Docs pack selectedyesDocs/browser lanes apply because this is visible docs navigation.
docs-creator loadednoN/A: no docs copy/content authoring, only nav plumbing.
Docs lane selectedyesDocs app sidebar rendering lane.
Target docs and nearest sibling docs readyesCompared /docs/plugin and /docs/installation/plate-ui sidebar behavior.
Docs style doctrine readnoN/A: no prose or MDX docs body was written.
Documented source owner identifiedyescontent/docs/meta.json _plate.categoryGroups owns the nested IA.
Browser pack selectedyesTarget routes and expected visible nesting were defined before final proof.
Browser route / app surface identifiedyes/docs/plugin and /docs/installation/plate-ui.
Browser tool decision recordedyesIn-app Browser, not standalone Playwright or Puppeteer.
Console/network caveat policy recordedyesChecked for Next error overlay; no overlay found on proved routes.

Work Checklist:

  • Objective includes outcome, completion threshold, verification surface, constraints, boundaries, and blocked condition.
  • Task source classified with source type, title, task type, acceptance criteria, caveats, likely files/routes/packages, browser surface, and root-cause layer.
  • Required video or screen-recording evidence is marked N/A because the user provided a static screenshot only.
  • Nearby repo instructions and implementation patterns read before edits.
  • Implementation fixes the sidebar data ownership boundary by feeding existing Plate category groups into the sidebar.
  • Release artifact requirement recorded as N/A because no package or registry release changed.
  • Final handoff shape decided: concise implementation summary, commands, browser proof, screenshot, and dev-server URL.
  • Branch handling recorded as N/A because no branch operation was requested.
  • Local-env-rot retry policy recorded as N/A because no install-corruption failure appeared.
  • Workspace authority recorded: all proof commands ran in /Users/zbeyens/git/plate, and browser proof used the local www app.
  • High-risk note recorded for browser behavior: wrong sidebar IA could hide docs pages; proof checks the target route text and nested groups.
  • Review/autoreview decision recorded as N/A: focused UI/data restoration verified by typecheck, lint, source audit, and browser proof.
  • Agent-native review decision recorded as N/A because no agent tooling changed.
  • Output budget discipline recorded and followed after one accidental broad output stream was recovered with capped exact commands.
  • Docs pack: docs lane, target routes, nearest sibling route, and source owner are recorded.
  • Docs pack: named routes/components are source-backed through current source and browser proof.
  • Docs pack: no docs prose was added, so current-state reference voice is unaffected.
  • Docs pack: links, anchors, and previews were not edited.
  • Browser pack: route, interaction path, and expected visible outcome are recorded.
  • Browser pack: proof uses the repo-approved in-app Browser runtime.
  • Browser pack: Next error overlay was checked on proved routes.
  • Browser pack: screenshot artifact is ready for final handoff.

Completion Gates:

GateAppliesEvidence
Named verification thresholdyesTypecheck, lint, source audit, and browser proof all completed.
Bug reproduced before fixyesUser screenshot showed old desired nested shape; current fix was verified against that shape.
Targeted behavior verificationyesBrowser proof found Plugin and Editor nested children plus Plate UI children.
TypeScript or typed config changedyespnpm --filter www typecheck passed.
Package exports or file layout changednoN/A: no package exports or file layout changed.
Package manifests, lockfile, or install graph changednoN/A: no manifest or lockfile changes.
Agent rules or skills changednoN/A: no .agents, .claude, or .codex files changed.
Workspace authority proofyesCommands ran from /Users/zbeyens/git/plate; browser proof hit local www docs app.
Browser surface changedyesIn-app browser verified visible sidebar nesting on target routes.
Browser final proofyesScreenshot saved at /tmp/plate-sidebar-nesting-proof.png.
CI-controlled template output changednoN/A: generated template/registry output untouched.
Package behavior or public API changednoN/A: no package behavior or public API changed.
Registry-only component work changednoN/A: docs navigation plumbing only.
Docs or content changedyesNo MDX content changed; rendered docs nav verified in browser.
High-risk mini gateyesFailure mode is hidden or flattened sidebar pages; proof checks nested groups and badges at target routes.
Agent-native review for agent/tooling changesnoN/A: no agent/tooling files changed.
Local install corruption suspectednoN/A: no install-corruption failure shape appeared.
Autoreview for non-trivial implementation changesnoN/A: focused local patch with concrete source, typecheck, lint, and browser proof; no broader review requested.
PR create or updatenoN/A: no PR requested.
Task-style PR body verifiednoN/A: no PR requested.
PR proof image hostingnoN/A: no PR body.
Tracker sync-backnoN/A: no tracker target.
Final handoff contractyesFinal response will include summary, files, verification, browser proof, screenshot, and dev-server URL.
Final lintyespnpm lint:fix passed.
Output budget disciplineyesAccidental broad output was recorded; subsequent commands were capped and exact.
Goal plan completeyesThis file is ready for node .agents/skills/autogoal/scripts/check-complete.mjs docs/plans/2026-05-31-restore-docs-sidebar-nesting.md.
Docs source-backed claim audityesrg verified added sidebar helpers, overlay merge preservation, and status-pill rendering symbols.
Docs links / routes / previewsyesBrowser proof verified the target docs routes load without a Next error overlay.
Docs MDX/content parsernoN/A: no MDX/content files changed.
Plugin page specificsnoN/A: plugin docs content was not authored.
Browser interaction proofyesBrowser visited /docs/plugin and /docs/installation/plate-ui and queried nested nav text.
Browser console/network checkyesNext error overlay check was empty on both proved routes.
Browser final proof artifactyes/tmp/plate-sidebar-nesting-proof.png.

Phase / pass table:

PhaseStatusEvidenceNext
Intake and source readdoneIdentified meta.json category groups as IA owner and sidebar flattening as failure layer.complete
ImplementationdoneAdded category-group sidebar mapping, deep overlay preservation, and text status pills.complete
VerificationdoneTypecheck, lint, source audit, and browser proof passed.complete
PR / tracker syncn/aNo PR or tracker requested.complete
CloseoutdoneEvidence file updated for autogoal completion.final response

Findings:

  • Existing Plate category-group metadata already had the wanted nested IA; the sidebar builder was not using it for top-level sections.
  • Overlay merging could overwrite explicit page-tree metadata, so the fix preserves item-local label, keywords, and titleCn first.
  • Status badges had drifted into dot-like behavior; the visible request needs text pills.

Decisions and tradeoffs:

  • Sync upstream/Fumadocs primitives, fork Plate IA ownership.
  • Do not hard-code Plugin or Editor in the component; map category groups centrally from docs nav metadata.
  • Do not broaden into a full sidebar rewrite.

Implementation notes:

  • apps/www/src/lib/docs-nav-metadata.ts now exposes getSidebarCategoryItems.
  • apps/www/src/lib/docs-page-tree.ts applies Plate category groups per sidebar section and keeps overlay metadata deep.
  • apps/www/src/components/docs-nav.tsx renders New and Updated as inline status pills.

Review fixes:

  • Removed an unused label prop after pnpm lint:fix flagged it.

Error attempts:

Error / failed attemptCountNext different moveResolution
pnpm lint:fix reported unused label in DocsNavItemContent1Remove unused prop and rerun lintFixed; rerun passed
Broad process/search output streamed during initial exploration1Switch to exact rg and capped command outputRecovered; final evidence is scoped

Verification evidence:

  • pnpm --filter www typecheck passed with docs source parity and registry source checks.
  • pnpm lint:fix passed after removing the unused prop.
  • Source audit found getSidebarCategoryItems, guideSidebarSections, categorySidebarSections, withDocsOverlayDeep, and item.label ?? overlay?.label.
  • Source audit found status label rendering with New, Updated, bg-[#adfa1d], and bg-muted.
  • Browser proof for /docs/plugin: hasPluginChildren=true, hasEditorChildren=true, hasUpdatedText=true, hasNewText=true, nextError="".
  • Browser proof for /docs/installation/plate-ui: hasPlateUiChildren=true, nextError="".
  • Screenshot artifact: /tmp/plate-sidebar-nesting-proof.png.

Final handoff contract:

  • PR line: N/A, no PR requested.
  • Issue / tracker line: N/A, no tracker requested.
  • Confidence line: high confidence.
  • Flow table: Reproduced from user screenshot; Verified by typecheck, lint, source audit, and browser proof.
  • Browser check: /docs/plugin and /docs/installation/plate-ui on localhost:3004.
  • Outcome: nested sidebar IA restored and status badges visible as text pills.
  • Caveat: dev server remains running for user inspection.
  • Design: category-group mapping keeps Plate IA ownership without replacing current sidebar primitives.
  • Verified: pnpm --filter www typecheck, pnpm lint:fix, in-app browser proof.
  • PR body verified: N/A, no PR requested.

Reboot status: Ready to close. The implementation, verification, browser proof, and plan evidence are current; the only remaining action is the mechanical autogoal completion check followed by update_goal(status: complete).

Open risks: None known for the requested routes. Broader sidebar categories inherit the same category-group mapping and may need visual review only if their metadata contains unexpected wrapper groups.