Back to Plate

sync shadcn editors blockviewer toolbar

docs/plans/2026-05-29-sync-shadcn-editors-blockviewer-toolbar.md

53.0.818.9 KB
Original Source

sync shadcn editors blockviewer toolbar

Objective: Implement the accepted sync-shadcn /editors BlockViewer toolbar slice: adopt shadcn /blocks toolbar order and density, keep Plate install/source and Pro behavior, keep Open in v0 excluded, update partial sync tracking without advancing lastSyncedCommit, and verify with focused checks plus browser proof.

Goal plan: docs/plans/2026-05-29-sync-shadcn-editors-blockviewer-toolbar.md

Template: docs/plans/templates/task.md

Primary template: docs/plans/templates/task.md

Applied packs:

  • docs (docs/plans/templates/packs/docs.md)
  • browser (docs/plans/templates/packs/browser.md)

Task source:

  • type: accepted sync-shadcn implementation slice
  • id / link: docs/sync/shadcn/runs/2026-05-29-4a4dc8e-to-efdec3c-editors-blocks-style/plan.md
  • title: Editors BlockViewer toolbar parity
  • acceptance criteria: device/open/refresh group before Plate command pill, refresh reloads preview iframe, no v0 action, Plate install/source and Pro behavior retained, status and plan updated as a partial sync, lint/typecheck and browser proof pass.

Completion threshold:

  • apps/www/src/components/block-viewer.tsx uses upstream-style toolbar order: device controls, open-new-tab, refresh, then command/pro action.
  • Open in v0 remains absent and no v0 import/action is introduced.
  • docs/sync/shadcn/status.json no longer lists toolbar cleanup as deferred for /editors; lastSyncedCommit remains unchanged.
  • Focused eslint, pnpm --filter www typecheck, and desktop/mobile browser proof pass.
  • Task closure is legal only when the source-of-truth acceptance criteria are satisfied or explicitly narrowed, required verification evidence is recorded, code-review and release-artifact gates are closed when applicable, tracker/PR sync is complete or marked N/A with reason, and node .agents/rules/autogoal/scripts/check-complete.mjs docs/plans/2026-05-29-sync-shadcn-editors-blockviewer-toolbar.md passes.

Verification surface:

  • pnpm --filter www exec eslint src/components/block-viewer.tsx --fix
  • pnpm --filter www typecheck
  • status JSON parse
  • Playwright browser proof against http://localhost:3002/editors at 1175x1239 and 390x844
  • node .agents/rules/autogoal/scripts/check-complete.mjs docs/plans/2026-05-29-sync-shadcn-editors-blockviewer-toolbar.md

Constraints:

  • Preserve existing user-facing behavior outside the task scope.
  • Prefer the durable ownership boundary over caller-by-caller patches.
  • Do not create PRs, comments, commits, or pushes unless the task/user/skill requires them.
  • Do not add broad ceremony when the task is trivial or docs-only.

Boundaries:

  • Source of truth: docs/sync/shadcn/runs/2026-05-29-4a4dc8e-to-efdec3c-editors-blocks-style/plan.md
  • Allowed edit scope: apps/www/src/components/block-viewer.tsx, sync run plan, sync status JSON, and this goal plan.
  • Browser surface: http://localhost:3002/editors.
  • Tracker sync: N/A, no external issue.
  • Non-goals: no v0, no category nav, no block content import, no full baseline advancement, no app shell changes.

Output budget strategy:

  • Use targeted source reads and compact browser metrics; save screenshots under the existing sync run instead of streaming visual evidence.

Blocked condition:

  • Block only if upstream/Plate toolbar ownership cannot be mapped, checks fail for reasons outside this slice after one honest retry, or browser proof shows v0 present or preview refresh broken.

Task state:

  • task_type: visual toolbar sync
  • task_complexity: normal
  • current_phase: closeout
  • current_phase_status: complete
  • next_phase: final response
  • goal_status: active

Current verdict:

  • verdict: implemented
  • confidence: high
  • next owner: user review
  • reason: toolbar slice shipped with focused checks, iframe-refresh proof, and sync status updated

Completion rule:

  • Do not call update_goal(status: complete) while any required checklist item remains unchecked. If an item does not apply, check it and add N/A: <reason>.
  • Do not call update_goal(status: complete) until every completion threshold above is satisfied, final handoff evidence is recorded, and node .agents/rules/autogoal/scripts/check-complete.mjs docs/plans/2026-05-29-sync-shadcn-editors-blockviewer-toolbar.md passes.
  • Do not create hook state for this goal. This file plus the active goal are the durable state.

Start Gates:

GateAppliesEvidence
Skill analysis before editsyesLoaded sync-shadcn, autogoal, task, and shadcn-parity; read upstream and Plate BlockViewer.
Active goal checked or createdyesActive goal created for accepted toolbar slice.
Source of truth read before editsyesRead accepted sync plan and toolbar slice.
Tracker comments and attachments readnoN/A: no tracker.
Video transcript evidence requirednoN/A: no video.
docs/solutions checked for non-trivial existing-code worknoN/A: fresh accepted sync plan is the source of truth.
TDD decision before behavior change or bug fixnoN/A: visual toolbar sync verified by browser proof.
Branch decision for code-changing taskyesN/A: no branch/PR requested; edited current checkout.
Release artifact decisionnoN/A: docs app component only; no package release.
Browser tool decision for browser surfaceyesUsed Playwright on local dev route because no direct Browser tool was callable.
PR expectation decisionnoN/A: no PR requested.
Tracker sync expectation decisionnoN/A: no tracker.
Output budget strategy recordedyesTargeted reads, compact command/browser output, screenshots saved in sync run.
Docs pack selectedyesApplied because sync status/run plan changed.
docs-creator loadednoN/A: sync bookkeeping, not user-facing docs prose.
Docs lane selectedyesSupporting sync artifact update.
Target docs and nearest sibling docs readyesRead sync run plan and status JSON.
Docs style doctrine readnoN/A: no user-facing docs content changed.
Documented source owner identifiedyesSource owner is docs/sync/shadcn/**.
Browser pack selectedyesApplied because visible /editors toolbar changed.
Browser route / app surface identifiedyeshttp://localhost:3002/editors.
Browser tool decision recordedyesPlaywright proof with desktop/mobile screenshots.
Console/network caveat policy recordedyesKnown Potion iframe X-Frame/sandbox warnings recorded; no page errors or failed requests.

Work Checklist:

  • Objective includes outcome, completion threshold, verification surface, constraints, boundaries, and blocked condition.
  • Task source classified with source type, id/link, title, task type, acceptance criteria, caveats, likely files/routes/packages, browser surface, and root-cause layer.
  • Required video or screen-recording evidence is cached/read as normalized <video-transcripts> XML, or marked N/A with reason.
  • Nearby repo instructions and implementation patterns read before edits.
  • Implementation fixes the right ownership boundary, or the narrower choice is recorded with reason.
  • Release artifact requirement recorded: changeset, registry changelog, or N/A with reason.
  • Final handoff shape decided: bug/feature/testing/batch/review/tracker requirements, PR body sync, and issue/Linear sync when applicable.
  • Branch handling recorded for code-changing work: dedicated branch used, new branch needed, or N/A with reason.
  • Local-env-rot retry policy recorded for any surprising repo-wide failure: reinstall/rerun evidence or N/A with reason.
  • Workspace authority recorded: every proof command names the cwd/tool that owns the changed behavior.
  • High-risk note recorded for public API, runtime, package-boundary, browser behavior, agent-action, or command-contract changes, or marked N/A with reason.
  • Review/autoreview target selected from actual diff state for non-trivial implementation work, or marked N/A with reason.
  • Agent-native review decision recorded for .agents/**, .claude/**, .codex/**, skills, hooks, commands, prompts, or user-action tooling.
  • Output budget discipline recorded and followed: broad searches are scoped, capped, counted, or artifacted instead of streamed into goal context.
  • Docs pack: docs lane, target docs, nearest sibling docs, and source owner are recorded.
  • Docs pack: every named API, import, option, route, component, transform, demo, and preview is source-backed or marked N/A with reason.
  • Docs pack: docs use current-state reference voice, not changelog voice.
  • Docs pack: links, anchors, and previews target real leaf pages or are marked N/A with reason.
  • Browser pack: route, interaction path, and expected visible outcome are recorded before proof.
  • Browser pack: browser proof uses the repo-approved browser tool or records a blocker/waiver.
  • Browser pack: console and network errors are checked or explicitly out of scope.
  • Browser pack: screenshot, trace, or exact verification caveat is ready for final handoff.

Completion Gates:

GateAppliesRequired actionEvidence
Named verification thresholdyesRun named checks and browser proofFocused eslint, typecheck, status JSON parse, browser proof, and screenshots completed.
Bug reproduced before fixnoRecord failing test/repro or N/A with reasonN/A: visual sync slice.
Targeted behavior verificationyesRun focused proofBrowser asserted device/open/refresh before command, refresh reload, no v0, no overflow.
TypeScript or typed config changedyesRun typecheckpnpm --filter www typecheck passed.
Package exports or file layout changednoRun pnpm brl or record N/AN/A: no package exports/file layout.
Package manifests, lockfile, or install graph changednoRun install checks or record N/AN/A: no manifest or lockfile change.
Agent rules or skills changednoRun sync or record N/AN/A: no agent rules/skills changed.
Workspace authority proofyesRun proof in owning workspaceCommands ran from /Users/zbeyens/git/plate; browser proof hit apps/www route.
Browser surface changedyesCapture browser proofDesktop/mobile screenshots saved in sync run.
Browser final proofyesAttach screenshot or caveatScreenshots saved; known Potion iframe warnings only.
CI-controlled template output changednoRestore output or record N/AN/A.
Package behavior or public API changednoAdd changeset or record N/AN/A.
Registry-only component work changednoUpdate changelog or record N/AN/A.
Docs or content changedyesVerify sync docs/statusStatus JSON parses; run plan updated with implementation result.
High-risk mini gateyesRecord failure mode and proofRisk: adding v0 or breaking iframe refresh; browser proof asserts no v0 and refresh reloads content.
Agent-native review for agent/tooling changesnoRun review or record N/AN/A: no agent/tooling changes.
Local install corruption suspectednoRetry reinstall or record N/AN/A: checks passed.
Autoreview for non-trivial implementation changesnoRun review or record N/AN/A: narrow visual component sync with targeted checks/browser proof.
PR create or updatenoRun check before PR work or record N/AN/A: no PR requested.
Task-style PR body verifiednoVerify PR body or record N/AN/A: no PR.
PR proof image hostingnoHost images or record N/AN/A: no PR.
Tracker sync-backnoPost tracker sync or record N/AN/A: no tracker.
Final handoff contractyesFill final handoff fieldsFilled below.
Final lintyesRun scoped equivalentpnpm --filter www exec eslint src/components/block-viewer.tsx --fix passed.
Output budget disciplineyesVerify scoped outputTargeted command output and saved screenshots only.
Goal plan completeyesRun node .agents/rules/autogoal/scripts/check-complete.mjs docs/plans/2026-05-29-sync-shadcn-editors-blockviewer-toolbar.mdTo run after this fill.
Docs source-backed claim audityesVerify docs claimsClaims backed by source, sync plan, status JSON, and browser proof.
Docs links / routes / previewsyesVerify route/anchors/previews/editors route and iframe refresh verified.
Docs MDX/content parsernoRun content parser or record N/AN/A: no MDX content changed.
Plugin page specificsnoApply plugin page rules or record N/AN/A.
Browser interaction proofyesExercise route/interactionClicked Refresh Preview and waited for iframe content.
Browser console/network checkyesRecord console/network stateNo page errors or failed requests; known iframe warnings recorded.
Browser final proof artifactyesRecord screenshot/trace/route proofplate-editors-toolbar-desktop-after.png and plate-editors-toolbar-mobile-after.png.

Phase / pass table:

PhaseStatusEvidenceNext
Intake and source readcompleteRead accepted sync plan plus upstream/Plate BlockViewer.implementation
ImplementationcompletePatched BlockViewer; updated sync status and run plan.verification
VerificationcompleteFocused eslint, typecheck, JSON parse, browser desktop/mobile proof.closeout
PR / tracker syncN/ANo PR or tracker requested.final response
CloseoutcompletePlan filled; final response ready after completion check.final response

Findings:

  • Plate toolbar had command/pro action before device controls and no refresh action.
  • Upstream toolbar order is device controls, open-new-tab, refresh, command pill, then v0; v0 remains explicitly excluded.

Decisions and tradeoffs:

  • Adopted toolbar order, sizing, and refresh behavior.
  • Kept Plate install command text/source model and Pro Get the code behavior.
  • Did not copy upstream v0 action.

Implementation notes:

  • Added iframeKey state to remount preview iframes on refresh.
  • Reordered toolbar actions to match upstream /blocks without v0.
  • Controlled preview/code tabs from view so toolbar state tracks view changes.
  • Fixed the local exhaustive-deps warning by memoizing files.

Review fixes:

  • First desktop screenshot caught the refreshed iframe before reload completed; reran browser proof with an iframe-content wait.

Error attempts:

Error / failed attemptCountNext different moveResolution
Browser proof with networkidle1Use domcontentloaded plus iframe content waitPassed
Desktop screenshot captured blank iframe after immediate refresh1Wait for iframe heading after refresh before screenshotPassed
Strict text match inside iframe found two elements1Target iframe h1 specificallyPassed

Verification evidence:

  • pnpm --filter www exec eslint src/components/block-viewer.tsx --fix passed.
  • pnpm --filter www typecheck passed.
  • node -e 'JSON.parse(require("fs").readFileSync("docs/sync/shadcn/status.json","utf8")); console.log("status json ok")' passed.
  • Browser proof on http://localhost:3002/editors at desktop: device/open/refresh controls visible before command pill, command text is Plate install command, refresh reloads iframe content, Open in v0 absent, no horizontal overflow.
  • Browser proof on http://localhost:3002/editors at mobile: no Open in v0, no horizontal overflow.
  • Screenshots saved: docs/sync/shadcn/runs/2026-05-29-4a4dc8e-to-efdec3c-editors-blocks-style/screenshots/plate-editors-toolbar-desktop-after.png and docs/sync/shadcn/runs/2026-05-29-4a4dc8e-to-efdec3c-editors-blocks-style/screenshots/plate-editors-toolbar-mobile-after.png.
  • Console caveat: known Potion iframe X-Frame-Options/sandbox warnings appeared; there were no page errors or failed requests.

Reboot status:

  • Current and complete as of 2026-05-29: toolbar patch, sync bookkeeping, and browser proof are done; final mechanical checks remain.

Open risks:

  • None for the accepted slice.

Final handoff contract:

  • PR line: N/A, no PR requested.
  • Issue / tracker line: N/A, no tracker.
  • Confidence line: high; checks and browser proof passed.
  • Flow table:
    • Reproduced: N/A for bug repro; source plan and screenshots identified the delta.
    • Verified: focused eslint/typecheck and desktop/mobile browser proof.
  • Browser check: desktop refresh/open/device/command order verified; mobile no overflow.
  • Outcome: /editors BlockViewer toolbar now follows shadcn /blocks order without v0.
  • Caveat: Potion iframe emits known external sandbox/X-Frame warnings.
  • Design:
    • Chosen boundary: BlockViewer toolbar owns this behavior.
    • Why not quick patch: refresh needed provider state and iframe key, not just class changes.
    • Why not broader change: upstream v0 and block content remain excluded by policy.
  • Verified: eslint, typecheck, status JSON parse, browser proof.
  • PR body verified: N/A, no PR.

Task-style PR body contract:

  • Preserve any existing <!-- auto-release:start --> block. If a changeset is part of the diff and repo policy expects auto release, include that block.
  • Use the accepted kitcn PR #270 visual format. The body starts with an emoji issue/tracker/fix line, for example ๐Ÿ› Fixes #123 or ๐Ÿ› Fixes โž– N/A, then an emoji confidence line like ๐ŸŸข 95-100% confidence.
  • Use this exact table header: | Phase | ๐Ÿงช Tests | ๐ŸŒ Browser |.
  • Use Reproduced and Verified rows. Mark passing proof with ๐ŸŸข, repro or failing proof with ๐Ÿ”ด, and non-applicable cells with โž– N/A.
  • Use bold emoji section headings: **โœ… Outcome**, **โš ๏ธ Caveat**, **๐Ÿ—๏ธ Design**, and **๐Ÿงช Verified**.
  • Never include a line that links to the current PR itself. The current PR URL belongs in the final response, not in its own description.
  • Do not replace this with a generic Summary / Verification PR body, an adaptive prose body from a git helper skill, plain ## Outcome sections, or an unrelated generated badge footer unless the caller or repo template explicitly asks for it.
  • Proof is gh pr view --json body output or a concise source-backed summary of that output.

Final handoff / sync:

  • PR: N/A.
  • Issue / tracker: N/A.
  • Browser proof: screenshots saved in the sync run folder.
  • Caveats: known Potion iframe warnings only.

Timeline:

  • 2026-05-29T20:45:59.181Z Task goal plan created.

Reboot status:

QuestionAnswer
Where am I?Closeout complete after implementation and verification
Where am I going?Final response
What is the goal?Ship shadcn /blocks toolbar parity for Plate /editors without v0
What have I learned?Toolbar owner is BlockViewer; refresh needed iframe remount state
What have I done?Patched toolbar, updated sync status/run plan, verified in browser

Open risks:

  • None.