Back to Plate

sync shadcn codeblock wrapper

docs/plans/2026-05-30-sync-shadcn-codeblock-wrapper.md

53.0.812.1 KB
Original Source

sync shadcn codeblock wrapper

Objective: Sync mdx/codeblock-collapsible-wrapper by porting upstream CodeCollapsibleWrapper behavior into Plate's CodeBlockWrapper while keeping Plate's full, open, and expandButtonTitle props, then mark the dashboard row synced after verification.

Flow mode: One-shot sync-shadcn apply implementation mode. The user accepted the row by answering ok go after choosing sync instead of fork.

Goal plan: docs/plans/2026-05-30-sync-shadcn-codeblock-wrapper.md

Primary template: docs/plans/templates/sync-shadcn.md

Applied packs:

  • browser

Sync source:

  • upstream repo: shadcn-ui/ui
  • upstream clone: ../shadcn
  • upstream app: ../shadcn/apps/v4
  • Plate docs app: apps/www
  • durable state: docs/sync/shadcn/status.json
  • durable policy: docs/sync/shadcn/decisions.md

Completion threshold: Complete when apps/www/src/components/code-block-wrapper.tsx uses upstream top-right expand/collapse controls, separator, bottom gradient trigger, closed-state content-visibility:auto, and cleaner figure/pre handling while preserving Plate full, open, and expandButtonTitle; the dashboard row is synced; dashboard artifacts are regenerated; lastSyncedCommit remains unchanged; typecheck, lint, JSON/script checks, source audit, browser proof, and autogoal completion pass.

Verification surface:

  • apps/www/src/components/code-block-wrapper.tsx
  • apps/www/src/components/mdx-components.tsx
  • apps/www/src/components/component-source.tsx
  • ../shadcn/apps/v4/components/code-collapsible-wrapper.tsx
  • docs/sync/shadcn/deltas.json
  • docs/sync/shadcn/dashboard.json
  • docs/sync/shadcn/dashboard.html
  • docs/sync/shadcn/status.json

Constraints:

  • Do not run build:registry.
  • Do not edit generated registry/template output.
  • Do not advance lastSyncedCommit; this is a partial row apply.
  • Do not remove Plate-only full, open, or expandButtonTitle support.
  • Use browser proof because this touches visible docs UI.

Boundaries:

  • In scope: wrapper component, dashboard metadata, dashboard generation, focused verification, browser proof, and this goal plan.
  • Out of scope: broader MDX component adoption, content rewrites, package changes, upstream full-range planning, registry output, and baseline advancement.

Output budget strategy: Use focused file reads and rg audits only. Avoid broad upstream diffs; the accepted row already names the upstream and Plate owner files. Keep browser proof to one docs route that renders ComponentSource.

Blocked condition: Blocked only if the wrapper cannot preserve Plate props while compiling, the dashboard cannot regenerate, or browser proof cannot load a docs page using ComponentSource after a real repair attempt.

Sync state:

  • base commit: 4a4dc8eb0fc793d8e9225e780183ad605f15d2c2
  • target commit: efdec3ca4523e5edd8a714f633002a7addc203a1
  • range kind: accepted dashboard row implementation
  • run directory: N/A for apply mode
  • implementation status: complete
  • baseline status: unchanged

Current verdict:

  • verdict: complete
  • confidence: high
  • recommended next owner: sync-shadcn
  • reason: upstream wrapper behavior is implemented, Plate props are preserved, row state is synced, and focused verification passed

Start Gates:

GateAppliesEvidence
autogoal loaded and active goal checked/createdyesActive goal created for the accepted row implementation.
sync-shadcn skill/rule readyesUser supplied the skill body and row came from dashboard apply flow.
Output budget strategy recorded before broad upstream commandsyesFocused row files only; no broad upstream diff.
docs/sync/shadcn/status.json readyesBaseline fields read and checked unchanged.
docs/sync/shadcn/decisions.md readyesDurable Plate docs sync policy read before implementation.
Prior migration plans/solution notes checkedyesMemory confirmed ../shadcn/apps/v4 as the upstream reference and Plate docs has product-owned forks.
../shadcn clone exists and was fetched/pulled intentionallyyesExisting clone file ../shadcn/apps/v4/components/code-collapsible-wrapper.tsx read.
Base and target refs resolved to exact SHAsnoDirect row implementation used existing dashboard target; no new range plan.
Base ancestry or ref problem provennoDirect row implementation used existing dashboard target; no new range plan.
Planning-only vs implementation mode decidedyesUser said ok go after choosing sync; implementation mode active.
User-review boundary recordedyesUser accepted the row; no additional review stop before implementation.

Work Checklist:

  • Objective, threshold, verification surface, constraints, boundaries, and blocked condition are filled from the active goal.
  • Read upstream wrapper implementation.
  • Read Plate wrapper implementation.
  • Found local wrapper entry points and prop usage.
  • Ported upstream wrapper behavior while preserving Plate props.
  • Marked codeblock-collapsible-wrapper synced in deltas.json.
  • Regenerated dashboard artifacts.
  • Ran source audit, JSON/script checks, typecheck, lint, and browser proof.
  • Recorded final evidence and closeout status.

Completion Gates:

GateAppliesRequired actionEvidence
Named verification thresholdyesProve implementation, synced row, and verificationSource audit, dashboard JSON, typecheck, lint, and browser proof passed.
Upstream range artifacts existnoApply-mode row implementation exceptionNo new run artifacts required.
Inventory completenessnoApply-mode row implementation exceptionRow came from existing dashboard inventory.
Decision accountingyesVerify only accepted row changedcodeblock-collapsible-wrapper is the only row intentionally changed in this slice.
Status JSON parse and semanticsyesVerify baseline unchangedlastSyncedCommit remains 4a4dc8eb0fc793d8e9225e780183ad605f15d2c2.
Source-backed Plate mappingyesAudit wrapper props and upstream behaviorrg found Separator, top-right control, content-visibility:auto, bottom gradient, and preserved props.
Visual comparison screenshotsyesBrowser-proof a docs page using the wrapper/docs/kbd loaded with source wrapper class present, source content present, and no Next error overlay.
Planning-only no implementation editsnoImplementation acceptedUser said ok go.
Accepted implementation verificationyesRun focused typecheck/lint/source/browser proofVerification commands listed below passed.
Browser surface changedyesBrowser proof requiredIn-app browser loaded http://localhost:3004/docs/kbd; GET returned 200.
Package manifests, lockfile, or install graph changednoNo package changesNo install graph command needed.
Agent rules or skills changednoNo agent source editsNo generated skill sync needed.
CI-controlled generated outputyesAvoid registry/template generationNo registry build was run; only sync dashboard artifacts regenerated.
Baseline advancementnoKeep baseline unchangedPartial row apply cannot advance lastSyncedCommit.
User review boundaryyesUser accepted implementationok go after sync/fork decision.
Output budget disciplineyesKeep evidence focusedOne accidental broad ps output occurred; recovery recorded below and no further broad process output used.
Goal plan completeyesRun autogoal completion checkReady for final closeout command.

Phase / pass table:

PhaseStatusEvidenceNext
Intake and baseline readdoneSource files and row context readnone
ImplementationdoneWrapper source updatednone
Sync metadatadoneDashboard row marked synced and regeneratednone
VerificationdoneTypecheck, lint, JSON, source, and browser checks passednone
CloseoutdoneThis plan records final evidencenone

Decision counts:

DecisionCountNotes
synced1codeblock-collapsible-wrapper implemented and verified.

Recommended merge slices:

OrderSliceClassFilesWhyVerification
1Codeblock collapsible wrapper implementationsyncedapps/www/src/components/code-block-wrapper.tsx, docs/sync/shadcn/deltas.jsonUpstream wrapper behavior is better; Plate props remain local API.Passed.

Questions:

  • N/A.

Findings:

  • Plate had two wrapper entry points: MDX CodeBlockWrapper and ComponentSource.
  • Current content renders ComponentSource with full by default, so browser proof validates the current visible full branch; collapsed branch behavior is source-audited because no current docs content directly renders the non-full wrapper.

Decisions and tradeoffs:

  • synced is the right dashboard state. This is not a fork because upstream behavior is adopted; the preserved Plate props are local API compatibility, not a deliberate divergent implementation.
  • lastSyncedCommit remains unchanged because this is one dashboard row, not full-range accounting.

Error attempts:

Error / failed attemptCountNext different moveResolution
Broad process inspection printed an unrelated long process argument1Stop process-argument inspection and return to focused source/JSON/browser evidenceRecovered; no further broad process output used.
Autoreview helper produced no output and was killed1Report the blocked helper honestly; rely on focused verification and source review for this sliceHelper was not counted as a clean review result.

Verification evidence:

  • pnpm sync-shadcn dashboard passed and regenerated docs/sync/shadcn/dashboard.html plus docs/sync/shadcn/dashboard.json.
  • node -e JSON parse passed for deltas.json, dashboard.json, and status.json.
  • node --check .agents/rules/sync-shadcn/scripts/build-dashboard.mjs passed.
  • Focused rg source audit found the imported Separator, top-right control, content-visibility:auto, bottom from-code/70 gradient, preserved full, preserved open, preserved expandButtonTitle, and synced dashboard row state.
  • pnpm --filter www typecheck passed after lint formatting.
  • pnpm lint:fix passed after checking 3154 files and formatting two files.
  • Browser proof on http://localhost:3004/docs/kbd: page title Kbd - Plate, basic-marks-kit source content present, 12 code surfaces found, one wrapper class sample md:-mx-1 relative overflow-hidden rounded-md, no Next error overlay text, and dev server logged GET /docs/kbd 200.

Final handoff:

  • Range: direct dashboard row apply.
  • Plan artifact: docs/plans/2026-05-30-sync-shadcn-codeblock-wrapper.md
  • Inventory artifact: N/A apply-mode row implementation.
  • Decision counts: one synced row.
  • Recommended first slice: N/A; slice implemented.
  • Review request: N/A; user accepted with ok go.
  • Question: N/A.
  • Status JSON: unchanged.
  • Verification: passed except autoreview helper blocked with no output.
  • Baseline: unchanged.

Timeline:

  • Goal created for accepted sync row.
  • Upstream and Plate wrapper files read.
  • Wrapper implemented with upstream behavior and preserved Plate props.
  • Dashboard row marked synced and regenerated.
  • Typecheck, lint, JSON/script, source, and browser proof passed.
  • Autoreview helper attempted, hung without output, and was killed.

Reboot status:

QuestionAnswer
Where am I?Implementation and verification are complete.
Where am I going?Run autogoal completion check, close goal, and hand off.
What is the goal?Sync the codeblock collapsible wrapper row.
What have I learned?The visible current route exercises the full branch; the collapsed branch is future-facing for direct MDX wrapper usage.
What have I done?Implemented wrapper behavior, synced metadata, regenerated dashboard, and verified.

Open risks:

  • Autoreview helper did not return a clean result. Focused source review and verification passed, and there are no known actionable issues in this slice.