Back to Plate

slate v2 hidden content policy controls

docs/plans/2026-05-26-slate-v2-hidden-content-policy-controls.md

53.0.815.7 KB
Original Source

slate v2 hidden content policy controls

Objective: Implement hidden-content example controls in .tmp/slate-v2 for selecting DOM coverage policies, complete only when /examples/hidden-content-blocks exposes policy controls that cover selectionPolicy and adjacent hidden-content policies, Playwright proves the controlled policies across Accordion/Collapsible/Tabs including ArrowRight-at-tab-edge behavior, targeted Slate React/site typechecks and lint pass, and node .agents/rules/autogoal/scripts/check-complete.mjs docs/plans/2026-05-26-slate-v2-hidden-content-policy-controls.md passes. Preserve the current default safe behavior: editor ArrowRight at a visible tab edge must not switch tabs unless the example control explicitly opts into materialization.

Flow mode: one-shot execution

Goal plan: docs/plans/2026-05-26-slate-v2-hidden-content-policy-controls.md

Template: docs/plans/templates/task.md

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

Applied packs:

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

Task source:

  • type: user prompt
  • id / link: chat
  • title: Add hidden-content policy controls for coverage testing
  • acceptance criteria: /examples/hidden-content-blocks exposes controls for selectionPolicy and adjacent hidden-content policies; tests cover safe default tab-edge ArrowRight and explicit materialize opt-in.

Completion threshold:

  • Example controls cover selectionPolicy, copyPolicy, and findPolicy with safe defaults.
  • Playwright proves policy control behavior across shadcn Accordion, Collapsible, and Tabs, including that ArrowRight at the Overview tab edge does not switch tabs under the default policy and does switch/materialize only when the control is set to materialize.
  • Targeted package/site checks pass in .tmp/slate-v2.
  • node .agents/rules/autogoal/scripts/check-complete.mjs docs/plans/2026-05-26-slate-v2-hidden-content-policy-controls.md passes.

Verification surface:

  • .tmp/slate-v2: focused Playwright route test for hidden-content-blocks.
  • .tmp/slate-v2/packages/slate-react: focused keyboard-input-strategy-contract.test.ts.
  • .tmp/slate-v2: bun --filter slate-react typecheck, bun typecheck:site, and bun lint.
  • In-app Browser route proof at http://localhost:3100/examples/hidden-content-blocks.

Constraints:

  • Preserve existing user-facing behavior outside the task scope.
  • Preserve safe default: tab-edge ArrowRight does not switch tabs with selectionPolicy=boundary.
  • Do not create PRs, comments, commits, or pushes.

Boundaries:

  • Source of truth: latest user prompt plus live .tmp/slate-v2 route behavior.
  • Allowed edit scope: .tmp/slate-v2/site/examples/ts/hidden-content-blocks.tsx, focused Playwright tests, and this goal plan.
  • Browser surface: http://localhost:3100/examples/hidden-content-blocks.
  • Tracker sync: N/A: no tracker item.
  • Non-goals: raw Slate UI kit exports, broad DOM coverage API redesign, PR.

Blocked condition:

  • Block only if the route cannot run locally or a required external/user decision prevents choosing safe default control values after three attempts.

Task state:

  • task_type: browser-visible example/test coverage
  • task_complexity: normal
  • current_phase: closeout
  • current_phase_status: complete
  • next_phase: final response
  • goal_status: ready_to_complete

Current verdict:

  • verdict: implemented
  • confidence: high
  • next owner: final response
  • reason: route controls, tests, Browser proof, typecheck, lint, and scoped review are complete

Completion rule:

  • update_goal(status: complete) is legal only after this plan passes the autogoal checker.

Start Gates:

GateAppliesEvidence
Skill analysis before editsyestask + autogoal; Browser applies for route proof
Active goal checked or createdyesget_goal returned no active goal; created goal for this plan
Source of truth read before editsyeslatest user prompt and live hidden-content route files
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: narrow example/test change
TDD decision before behavior change or bug fixyesextended focused Playwright coverage around policy behavior
Branch decision for code-changing tasknoN/A: user did not ask for branch/PR; no proactive git hygiene
Release artifact decisionyesno new package behavior in this slice; existing prior package changeset remains separate
Browser tool decision for browser surfaceyesin-app Browser plus Playwright regression
PR expectation decisionnoN/A: no PR requested
Tracker sync expectation decisionnoN/A: no tracker
Browser pack selectedyesbrowser pack applied
Browser route / app surface identifiedyes/examples/hidden-content-blocks
Browser tool decision recordedyesin-app Browser requested by user context; Playwright for regression
Console/network caveat policy recordedyesPlaywright pageerror row and Browser console error log checked

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: controls belong in the example surface, not raw Slate UI kit APIs.
  • Release artifact requirement recorded: changeset, registry changelog, or N/A with reason.
  • Final handoff shape decided: concise implementation and verification summary.
  • Branch handling recorded for code-changing work: N/A: no branch/PR requested.
  • Local-env-rot retry policy recorded for any surprising repo-wide failure: N/A: rerun cleared transient site typecheck output; no reinstall signal.
  • Workspace authority recorded: every proof command names .tmp/slate-v2 or .tmp/slate-v2/packages/slate-react.
  • High-risk note recorded for public API, runtime, package-boundary, browser behavior, agent-action, or command-contract changes: Browser behavior changed only in the example controls; safe default remains clamped, and materialization is explicit through the control.
  • Review/autoreview target selected from actual diff state: local checkout, then scoped review prompt for the hidden-content control slice.
  • Agent-native review decision recorded for .agents/**, .claude/**, .codex/**, skills, hooks, commands, prompts, or user-action tooling: N/A: not touched.
  • 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 checksall commands below passed
Bug reproduced before fixnoN/Atask is coverage/control feature; prior ArrowRight repro already proven in Browser
Targeted behavior verificationyesRun focused test/proofPlaywright hidden-content-blocks, 3 passed; Browser proof recorded
TypeScript or typed config changedyesRun relevant typecheck.tmp/slate-v2: bun typecheck:site passed; bun --filter slate-react typecheck passed
Package exports or file layout changednoN/Ano package exports or barrels changed
Package manifests, lockfile, or install graph changednoN/Athis slice did not change manifests/lockfile
Agent rules or skills changednoN/Ano agent rules/skills changed
Workspace authority proofyesRun checks in owning workspacechecks ran in .tmp/slate-v2 and package subdir
Browser surface changedyesCapture Browser proofBrowser showed default boundary keeps Overview active; materialize activates Details
Browser final proofyesRecord exact browser verification caveatno screenshot requested; exact Browser state and empty error logs recorded
CI-controlled template output changednoN/Ano templates touched
Package behavior or public API changednoN/Aexample controls only in this slice
Registry-only component work changednoN/Ano registry-only Plate component work
Docs or content changedyesVerify source-backed claimsthis plan updated; no user docs changed
High-risk mini gateyesRecord failure mode and proof planfailure mode: policy controls accidentally make tab-edge ArrowRight switch by default; proof: Playwright + Browser
Agent-native review for agent/tooling changesnoN/Ano agent/tooling files changed
Local install corruption suspectednoN/Atransient typecheck output passed on rerun; no install corruption signature
Autoreview for non-trivial implementation changesyesRun helper and close accepted findingsCodex helper hung twice; Claude fallback whole-diff findings were verified/rejected as unrelated or already satisfied; scoped Claude run exited clean
PR create or updatenoN/Ano PR requested
PR proof image hostingnoN/Ano PR
Tracker sync-backnoN/Ano tracker
Final handoff contractyesFill final handoff fieldsfilled below
Final lintyesRun lint.tmp/slate-v2: bun lint passed
Goal plan completeyesRun autogoal checkerto run after this plan write
Browser interaction proofyesExercise target routein-app Browser proof passed
Browser console/network checkyesRecord console/network stateBrowser tab.dev.logs({ levels: ['error'] }) returned []; Playwright pageerror row empty
Browser final proof artifactyesRecord exact proofexact Browser JSON state recorded in Timeline

Phase / pass table:

PhaseStatusEvidenceNext
Intake and source readcompleteplan, prompt, live files readimplementation
Implementationcompletepolicy controls and tests addedverification
Verificationcompletetests/type/lint/Browser/review donecloseout
PR / tracker synccompleteN/A: no PR/tracker requestedfinal response
Closeoutcompleteautogoal checker gate reached; final response nextfinal response

Findings:

  • The correct control surface is the example route: selectionPolicy, copyPolicy, and findPolicy are DOM coverage boundary props, not product block APIs.
  • Safe default stays selectionPolicy=boundary; materialize is explicit.
  • The Browser tool uses default data-testid, while this site uses data-test-id, so Browser proof used explicit selectors.

Decisions and tradeoffs:

  • Use shadcn Button segments instead of adding Select; this keeps controls dense, visible, and dependency-neutral because shadcn button already exists.
  • Apply policies globally across Accordion, Collapsible, and Tabs to maximize route coverage without turning the example into a per-node configuration UI.
  • Keep copyPolicy=include-model and findPolicy=not-native-until-mounted as defaults because those match the hidden-model demo intent.

Implementation notes:

  • site/examples/ts/hidden-content-blocks.tsx adds policy controls and badge outputs for selection, copy, and find policies.
  • The boundary props now read from context for Accordion, Collapsible, and Tabs.
  • playwright/integration/examples/hidden-content-blocks.test.ts covers copy policy exclude/materialize and selection policy boundary/model-backed/materialize.

Review fixes:

  • Whole-local Claude autoreview raised no in-scope current-slice defect; verified shadcn deps are devDependencies and site/tsconfig.json maps @/* to ./*.
  • Scoped Claude autoreview for the hidden-content policy controls slice exited clean with no accepted/actionable findings.

Error attempts:

Error / failed attemptCountNext different moveResolution
Codex autoreview helper hung before output2kill stale helper and retry fallback engineresolved by scoped Claude helper run
Browser getByTestId used default data-testid not site data-test-id1use explicit [data-test-id=...] locatorBrowser proof passed
Initial typecheck:site reported stale Slate React errors1format touched file and rerun exact checksrerun passed

Verification evidence:

  • .tmp/slate-v2/packages/slate-react: bun test:vitest -- keyboard-input-strategy-contract.test.ts passed, 10 tests.
  • .tmp/slate-v2: bun typecheck:site passed.
  • .tmp/slate-v2: bun --filter slate-react typecheck passed.
  • .tmp/slate-v2: PLAYWRIGHT_RETRIES=0 PLAYWRIGHT_WORKERS=1 bun playwright playwright/integration/examples/hidden-content-blocks.test.ts --project=chromium passed, 3 tests.
  • .tmp/slate-v2: bun lint passed.
  • .tmp/slate-v2: /Users/zbeyens/git/plate-2/.agents/skills/autoreview/scripts/autoreview --mode local --engine claude --no-tools --no-web-search --prompt "<hidden-content policy controls slice>" exited clean with no accepted/actionable findings.
  • Browser proof at http://localhost:3100/examples/hidden-content-blocks: default selection=boundary, copy=include-model, find=not-native-until-mounted; 40 ArrowRight presses kept Overview active and Details hidden; after switching Selection to materialize, 40 ArrowRight presses activated Details and hid Overview; console error logs were [].

Final handoff contract:

  • PR line: N/A: no PR requested.
  • Issue / tracker line: N/A: no tracker.
  • Confidence line: high.
  • Flow table:
    • Reproduced: prior Browser repro showed ArrowRight could switch tabs under materialize behavior.
    • Verified: safe default and explicit materialize opt-in covered by Browser and Playwright.
  • Browser check: passed with empty error logs.
  • Outcome: hidden-content route has controls for selectionPolicy, copyPolicy, and findPolicy.
  • Caveat: Codex autoreview helper hung twice; scoped fallback review was clean.
  • Design:
    • Chosen boundary: example-level shadcn Button controls over existing boundary props.
    • Why not quick patch: hard-coded props would not give coverage control.
    • Why not broader change: raw Slate should not ship Accordion/Tabs policy UI.
  • Verified: tests/type/lint/Browser/review evidence above.

Final handoff / sync:

  • PR: N/A.
  • Issue / tracker: N/A.
  • Browser proof: exact state recorded above.
  • Caveats: Codex autoreview helper hang; fallback scoped review clean.

Timeline:

  • 2026-05-26T17:37:14.646Z Task goal plan created.
  • 2026-05-26 Added policy controls and route tests.
  • 2026-05-26 Focused unit, site typecheck, package typecheck, Playwright, lint, Browser proof, and scoped review completed.

Reboot status:

QuestionAnswer
Where am I?Final response
Where am I going?Close the goal and report the result
What is the goal?Add hidden-content policy controls with coverage proof
What have I learned?Safe default must remain boundary; materialize is valuable as an explicit test control
What have I done?Added controls, tests, Browser proof, and verification

Open risks:

  • None for this execution lane.