feat: mode-specific scene input rows for teaching + devotional (#1734)#1760
Merged
Merged
Conversation
Phase 2.5 of epic #1725. Two modes ask the user about their situation before they study; this card captures those situational inputs so later steps can reference them. - types.ts: GuidedSceneRow becomes a discriminated union of { kind: 'display'; label; value } | { kind: 'input'; label; placeholder; capturedKey: SceneInputKey }. SceneInputKey narrows to the three string-valued scene capture keys ('audience'|'setting'| 'arrival') so TextInput binding stays type-safe. - plan.ts: existing four scene rows tagged kind:'display'; teaching appends Audience + Setting inputs; devotional appends 'What you bring'. Quick + Deep get no extra rows. - index.ts: re-export SceneInputKey. - StudySessionScreen.tsx: * loads CapturedInputs once per session via getCapturedInputs * branches scene-row render on row.kind ('display' -> existing label/value Text; 'input' -> TextInput bound to capturedInputs.scene[capturedKey]) * 500ms-debounced setCapturedInputs flush per keystroke; pending timer cleared on unmount; per-session timer reset when sessionId changes * matches existing observe-input visual (bgSurface bg, border, body font 14/21) - 20 plan.parity snapshots refreshed; manually inspected. Teaching fixtures gain 2 input rows; devotional gain 1; quick + deep unchanged in shape (just kind:'display' tag added). tsc / lint / 3785 full-suite tests green.
Test Results✅ All tests passed
Coverage
⏱️ Duration: 89.5s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1734. Phase 2.5 of epic #1725.
Why
Teaching and Devotional are the two modes whose output depends on the user's situation, not just the chapter. This card extends the Scene step to actually capture that situation (
audience/settingfor teaching;arrivalfor devotional). Quick and Deep stay information-only.What
app/src/services/guidedStudy/types.ts—GuidedSceneRowbecomes a discriminated union:The narrow
SceneInputKey(instead of the spec'skeyof CapturedInputs['scene']) keeps the TextInput binding type-safe —concepts: string[]andgenre_response: stringaren't surfaced as inputs in this card.plan.ts— existing four rows taggedkind: 'display'; teaching mode appendsAudience+Settinginput rows; devotional appendsWhat you bring. Quick and Deep are unchanged in row count.StudySessionScreen.tsxCapturedInputsonce per session (getCapturedInputs) and rehydrates inputs (acceptance Merge pull request #3 from CraigBuckmaster/codex/review-recent-master… #4)row.kind—displaykeeps existing label/value pair;inputrenders aTextInputstyled to match the existing observe input (bgSurfacebackground,borderborder, body 14/21)setCapturedInputs(acceptance Merge pull request #2 from CraigBuckmaster/master #3); per-session timer reset onsessionIdchange; pending timer cleared on unmountTests
plan.paritysnapshots refreshed and manually inspected:Audience+Settinginputs ✓What you bringinput ✓Acceptance criteria
setCapturedInputswithin ~500ms (debounced)getCapturedInputsload)Rollback
Revert the PR. The captured-inputs columns from #1731 stay (nullable, append-only) and unused entries cause no issues.
Notes for Craig
base.bgInput; the palette usesbase.bgSurfacefor input backgrounds (matches the existing observe TextInput) so I used that for consistency. Easy to swap if you'd rather a dedicated token.Generated by Claude Code