Surfc UI/UX Overhaul — Branch 1 (Codex Sub-Agent Execution Plan)
Surfc UI/UX Overhaul — Branch 1 (Codex Sub-Agent Execution Plan)
0) Mission + operating mode
Objective: Implement the Capture-First redesign by replacing the Home → Review → Note flow with a Capture → Note flow, adding Sources and Active Ideas screens, and preserving all existing data/sync boundaries.
Execution mode: This plan is written for a coordinator agent + sub-agents.
- Coordinator owns sequencing, integration, regression checks, and final PR.
- Sub-agents each own a scoped change-set with explicit file ownership.
Canonical product spec: docs/ui-ux/user-journey-v2.md.
Branch policy:
- Base:
main - Feature branch:
design/ui-structure-overhaul
1) Global constraints (apply to every sub-agent)
- Do not alter architecture boundaries:
- Dexie-first persistence and outbox sync remain unchanged.
- Keep existing
db.js+cloudWritepathways for data writes.
- No new stores/tables/APIs for this branch.
- UI-only extractions for new screens (
SourcesScreen,IdeasScreen). - Capture-first launch must become default (
mobileView = 'capture'). - Remove
reviewstate andReviewScreenentirely. - Auto-discover chaining must run once per successful capture via
hasAutoDiscovered. - Note form persistence in DOM: keep NoteForm mounted while navigating between
note,sources, andactive-ideas. - Icon policy:
@phosphor-icons/reactwithweight="light". - Style tokens: use existing
tokens.cssvariables only.
2) Recommended execution graph
Phase A (foundation)
- Sub-agent A1:
FUNCTIONAL.mdcontract update. - Sub-agent A2: Navigation state machine (
useUI.js). - Sub-agent A3: Note form orchestration (
useNoteForm.js).
Phase B (screen components)
- Sub-agent B1:
SourcesScreen.jsx. - Sub-agent B2:
IdeasScreen.jsx. - Sub-agent B3:
HomeScreen.jsxrewrite. - Sub-agent B4:
CaptureScreen.jsxnav removal. - Sub-agent B5:
NoteForm.jsxrewrite. - Sub-agent B6:
IndexScreen.jsxheader/settings update.
Phase C (integration + styling)
- Sub-agent C1:
App.jsxintegration rewrite. - Sub-agent C2:
styles.cssappended styles.
Phase D (verification + cleanup)
- Sub-agent D1:
capture.test.jsxrewrite + any requiredApp.behaviour.test.jsxskips. - Sub-agent D2: delete
ReviewScreen.jsx, final build/tests. - Coordinator: reconcile, run final suite, prepare PR.
3) Sub-agent task cards
Each card includes scope, hard requirements, and done criteria.
A1 — Functional contract doc
Files: FUNCTIONAL.md
Action: Replace with updated 9-rule contract from the source plan.
Done when: File content exactly reflects capture-first + auto-discover + navigation + animation + error-copy contracts.
A2 — Navigation state machine
Files: src/hooks/useUI.js
Action: Replace file with capture-first navigation model.
Hard requirements:
- default
mobileView = 'capture' - add
sourcesandactive-ideasroutes - remove
reviewroute semantics - preserve existing idea-related computed state and actions
goBackFromNotereturns to prior note-opening context Done when: All required navigation actions are exported and consumed cleanly byApp.jsx.
A3 — Note form orchestration + auto-discover
Files: src/hooks/useNoteForm.js
Action: Replace file with new implementation.
Hard requirements:
- add
hasAutoDiscovered - auto-run
callDiscoverIdeas(...)once after successful transcription - no auto-run when transcription fails or no text
- expose
dismissTranscribeError,addBookDirectly - remove local
bookTitle/bookAuthorform state from this hook - reset
hasAutoDiscoveredonclearCapture()andsaveNoteForm()Done when: capture success chains transcription → discover ideas exactly once per capture event.
B1 — Sources screen
Files: src/components/SourcesScreen.jsx (new)
Action: Create component exactly as specified.
Hard requirements:
- local title/author inputs only
- delegates writes/deletes through callbacks
- settings gear in header Done when: screen renders list, add form, and delete action with no direct DB calls.
B2 — Active Ideas screen
Files: src/components/IdeasScreen.jsx (new)
Action: Create component exactly as specified.
Hard requirements:
- list active ideas by
ideaCounts > 0 - sort descending by note count
- selecting an idea routes to index via callbacks Done when: screen is pure UI, no data mutations.
B3 — Home screen rewrite
Files: src/components/HomeScreen.jsx
Action: Replace component with stat-box layout + CTA.
Hard requirements:
- top-right settings gear
- stat boxes for Notes / Ideas / Sources
- single
Start CapturingCTA Done when: no legacy nav assumptions remain.
B4 — Capture screen cleanup
Files: src/components/CaptureScreen.jsx
Action: Remove internal nav and keep capture/manual buttons only.
Done when: shared bottom nav in App.jsx is sole mobile nav.
B5 — Note form UI rewrite
Files: src/components/NoteForm.jsx
Action: Replace component with new source select + inline transcription status UX.
Hard requirements:
- remove in-form source creation UI
- add source
<select>and+ Add new sourcelink - inline transcription error banner with approved copy
- show manual Discover fallback only when
!hasAutoDiscovered && !aiLoading && noteText.trim() - include X cancel + retake affordance Done when: form supports both capture and manual entry paths under new contract.
B6 — Index header gear
Files: src/components/IndexScreen.jsx
Action: add Gear import + onOpenSettings prop + header button.
Done when: settings gear appears without changing core index behavior.
C1 — App integration rewrite
Files: src/App.jsx
Action: Replace file with capture-first orchestration.
Hard requirements:
- add
SourcesScreen/IdeasScreenimports - remove
ReviewScreenimports/render - keep NoteForm always mounted; hide via CSS class when not active
- hide bottom nav on
home - 3-button nav: Home / Capture / Index
- wire all new props/actions end-to-end Done when: app compiles and routes work per journey v2.
C2 — Styles append
Files: src/styles.css
Action: append provided style blocks; do not remove existing styles.
Done when: new screens and note form variants render with token-based styling.
D1 — Tests update
Files:
src/test/capture.test.jsx- optionally
src/test/App.behaviour.test.jsx
Action: Rewrite capture tests for v2 flow.
Hard requirements:
- no helper for navigating to capture at startup
- remove ReviewScreen assumptions
- assert new error copy
- add auto-discover tests
- if legacy library-tab tests break, skip with comment:
// Library tab removed in v2 — functionality moved to SourcesScreenDone when:capture.test.jsxpasses and full suite is green (or known skips are explicit).
D2 — Cleanup + verification
Files: src/components/ReviewScreen.jsx (delete)
Action: remove obsolete screen and verify no import leftovers.
Done when: build + full tests pass.
4) Integration protocol for coordinator
- Merge/sequence sub-agent outputs in phase order.
- Resolve conflicts in
App.jsx,styles.css, and tests first. - Run mandatory checks:
npm run test:run -- --reporter=verbose src/test/capture.test.jsxnpm run test:runnpm run build
- If failures occur, assign focused repair task (single file owner) and rerun impacted checks.
- Remove stale imports and dead files (especially
ReviewScreen).
5) Commit strategy (squash-friendly)
Use atomic commits grouped by concern:
docs(functional): update capture-first contract and UX rulesfeat(ui): update navigation state for capture-first flowfeat(noteForm): auto-discover chaining and source helpersfeat(ui): add SourcesScreen and IdeasScreenfeat(ui): rewrite Home/Capture/NoteForm/Index screensfeat(app): integrate capture-first routing and shared navstyle(ui): add v2 home/sources/ideas/note-form stylestest(ui): update capture flow tests for v2chore(ui): remove ReviewScreen
Coordinator may squash to 1–3 commits before PR if team policy prefers.
6) PR template (for coordinator)
Title: feat: Capture-First UI overhaul — Branch 1 (structure)
Body:
- Summary bullets for: capture-first default, new screens, removal of review screen, note form changes, nav changes, tests/build status.
- Link spec:
docs/ui-ux/user-journey-v2.md. - Test checklist:
npm run test:runnpm run build- manual smoke flow for launch/capture/note/sources/ideas.
7) Out of scope (Branch 2)
Do not implement animation branch here.
Branch 2 (design/capture-animations) will handle:
- card-slide capture animation,
- ink-bleed transcription reveal,
- idea-chip enter animations, with separate PR and no data/nav architecture changes.