Ui Ux Overhaul Branch2 Codex Subagents
Surfc UI/UX Overhaul — Branch 2 (Codex Subagent Plan)
For Codex orchestration: run this plan with
superpowers:codex-subagents(preferred) or fall back tosuperpowers:executing-plans. Keep every checkbox in sync with PR progress.
Mission Context
- Goal: stack three CSS-only animations on top of Branch 1 — capture card slide-down, ink-bleed text reveal, staggered chip fade-in.
- Architecture tweak:
useNoteForm.handleImageSelectedmust callnav.onCaptureReady(image)soApp.jsxgates navigation untilanimationendfires. Ink bleed and chip logic remain insideNoteForm.jsx. - Tech stack: React 18, Vite, Vitest + @testing-library/react, CSS
@keyframes, existingtokens.cssvariables. - Spec references:
docs/ui-ux/user-journey-v2.md§5 andFUNCTIONAL.mdRule 8 (no JS animation loops, no blocked controls). - Branch lineage:
design/capture-animationscut from mergeddesign/ui-structure-overhaul.
Codex Subagent Topology
| Agent | Focus | Key Outputs |
|---|---|---|
| A. CSS + Tests | Create src/test/animations.test.jsx, append keyframes + utility classes in src/styles.css. | Green tests proving class wiring; lint-clean CSS block appended after @keyframes grain. |
| B. Capture Nav | Update src/hooks/useNoteForm.js, src/components/CaptureScreen.jsx, src/App.jsx so App manages capture animation + navigation. | captureAnimImg state, onCaptureReady, onCardSlideEnd, prop plumbing, animation preview. |
| C. NoteForm FX | Refactor src/components/NoteForm.jsx for ink bleed overlay + chip stagger inline delays. | Word-group logic, temporary overlay, chip delays, zero regression in save gating. |
| D. QA & Release | Enforce Rule 8, run targeted + full tests, npm run build, branch push + PR. | Passing suites, compliance notes, PR body referencing manual QA list. |
Agents must commit only the files in their lane, then hand off. Agent D owns integration once Agents A–C signal done via checklist.
Repo & Branch Guardrails
- Checkout & branch (git pull failed: missing credentials, branch assumed current)
Terminal window git checkout design/ui-structure-overhaulgit pullgit checkout -b design/capture-animations - Baseline tests (
npm run test:run) before edits — required screenshot/log for the PR attachment.
File Map (source of truth for codex agents)
| File | Change Owner |
|---|---|
src/styles.css | Agent A appends card-slide, ink-bleed, chip-fade sections + comments. |
src/test/animations.test.jsx | Agent A creates test suite validating DOM class hooks, inline delays, animation events. |
src/hooks/useNoteForm.js | Agent B swaps goToNote calls for onCaptureReady fallback. |
src/components/CaptureScreen.jsx | Agent B renders .capture-card-preview and onAnimationEnd plumbing. |
src/App.jsx | Agent B adds captureAnimImg state + handlers, passes props to CaptureScreen, injects onCaptureReady into the hook. |
src/components/NoteForm.jsx | Agent C adds ink-bleed overlay, textarea visibility toggle, chip delay styles. |
src/test/capture.test.jsx | Agent B extends existing tests only if regressions appear (no change expected). |
Phase Plan
Phase 0 — Pre-flight sync (Owner: Lead agent)
- Confirm workspace clean:
git status. - Document baseline
npm run test:runoutput. - Share branch + context with subagents A–D.
Phase 1 — CSS + animation tests (Agent A)
- Author failing tests first: create
src/test/animations.test.jsxper spec (CaptureScreen preview, ink bleed transitions, chip delays). Use a header comment to note jsdom limitations. - Run targeted suite to prove failure:
Terminal window npm run test:run -- --reporter=verbose src/test/animations.test.jsx - Append CSS blocks to
src/styles.cssafter@keyframes grain. Include comments separating each animation. Useanimation-delayonly via inline styles. - Re-run targeted suite; expect CaptureScreen tests still failing until wiring lands.
- Stage + commit:
Terminal window git add src/styles.css src/test/animations.test.jsxgit commit -m "chore: add capture animation tests and keyframes" - Signal done in checklist + unblock Agents B/C.
Phase 2 — Capture navigation wiring (Agent B)
src/hooks/useNoteForm.js: destructure{ goToNote, onSaveSuccess, onCaptureReady }. InhandleImageSelected, replace eachgoToNotecall withonCaptureReady ? onCaptureReady(compressedImage) : goToNote?.()while leaving error handling untouched.src/components/CaptureScreen.jsx: acceptcaptureAnimImg,onCardSlideEnd; render.capture-card-previewoverlay (absolute, pointer-events none) only when image exists, callonCardSlideEndonanimationend.src/App.jsx: addconst [captureAnimImg, setCaptureAnimImg] = useState(null);plushandleCaptureReady(sets image) andhandleCardSlideEnd(clears image, callsui.goToNote()). PassonCaptureReadyin the hook nav config and feed the new props toCaptureScreen.- Update or extend
src/test/capture.test.jsxonly if new behavior requires coverage (the new animation tests should already cover most cases). - Run the animation test file; expect CaptureScreen block to pass while NoteForm block still fails.
- Commit changes.
Phase 3 — NoteForm ink bleed + chip stagger (Agent C)
- In
src/components/NoteForm.jsx, importuseEffect,useRef,useStateif needed. Add helpertoWordGroups(text, size = 4). - Track previous
transcribeLoadingvia ref. When it transitions true→false andnoteText.trim()exists, compute word groups, setisInkBleeding = true, store groups, and start a timeout to revert after(groups.length - 1)*50 + 300 + 100ms. Clean up the timer on unmount. - Wrap the textarea inside
.note-text-field. Applytext-hiddenclass while the ink bleed overlay is active. Render.ink-bleed-displaywith.ink-bleed-groupspans using inlineanimationDelay: ${i * 50}ms. - Apply the same inline delay pattern to
.idea-chipbuttons (pendingTags.map). EnsurecanSavelogic continues to ignoreisInkBleeding. - Run the animation test file — all blocks should now pass.
- Commit NoteForm changes.
Phase 4 — Quality gates (Agent D)
- Execute
Terminal window npm run test:run -- --reporter=verbose src/test/animations.test.jsxnpm run test:run - Enforce Rule 8 checks:
rg "requestAnimationFrame|setInterval" src→ expect no matches.- Confirm Save button gating via NoteForm source (no
isInkBleedingincanSave). - Verify
.capture-card-previewis separate from any camera element; no transforms applied to<video>or file input elements. - Ink bleed filter only on
.ink-bleed-groupspans.
- Production build:
Terminal window npm run build - If tests/build fail, loop the issue back to the owning agent; document fix commits.
- Once green, push branch and open PR:
Terminal window git push -u origin design/capture-animationsgh pr create --title "feat: capture animations" --body <summary matching plan> - PR body must list manual QA (card slide, ink bleed, chip fade) and cite Rule 8 compliance statements.
Delivery Checklist
- Phase 0 complete (branch + baseline tests).
- Phase 1 CSS/tests merged.
- Phase 2 navigation wiring merged.
- Phase 3 NoteForm overlay merged.
- Phase 4 QA/build complete.
- Rule 8 compliance notes added to PR description.
-
docs/ui-ux/user-journey-v2.md§5 referenced in PR summary. - Screenshots or short videos of animations attached to PR (optional but recommended).
Keep this file updated as tasks finish; unchecked boxes block promotion to Branch 3.