Skip to content

feat: mode-specific scene input rows for teaching + devotional (#1734)#1760

Merged
CraigBuckmaster merged 1 commit into
masterfrom
feature/issue-1734-mode-scene-rows
Apr 26, 2026
Merged

feat: mode-specific scene input rows for teaching + devotional (#1734)#1760
CraigBuckmaster merged 1 commit into
masterfrom
feature/issue-1734-mode-scene-rows

Conversation

@CraigBuckmaster
Copy link
Copy Markdown
Owner

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/setting for teaching; arrival for devotional). Quick and Deep stay information-only.

What

app/src/services/guidedStudy/types.tsGuidedSceneRow becomes a discriminated union:

type SceneInputKey = 'audience' | 'setting' | 'arrival';

type GuidedSceneRow =
  | { kind: 'display'; label: string; value: string }
  | { kind: 'input'; label: string; placeholder: string; capturedKey: SceneInputKey };

The narrow SceneInputKey (instead of the spec's keyof CapturedInputs['scene']) keeps the TextInput binding type-safe — concepts: string[] and genre_response: string aren't surfaced as inputs in this card.

plan.ts — existing four rows tagged kind: 'display'; teaching mode appends Audience + Setting input rows; devotional appends What you bring. Quick and Deep are unchanged in row count.

StudySessionScreen.tsx

Tests

  • 20 plan.parity snapshots refreshed and manually inspected:
    • Teaching fixtures (gen_1, isa_53, prov_3, psa_23, rom_8) → 4 display rows + Audience + Setting inputs ✓
    • Devotional fixtures → 4 display rows + What you bring input ✓
    • Quick + Deep → 4 display rows, no inputs ✓

Acceptance criteria

  • Teaching shows Audience + Setting inputs; Devotional shows "What you bring"
  • Quick + Deep show no extra input rows
  • Typing persists via setCapturedInputs within ~500ms (debounced)
  • Reopening the session rehydrates typed values (initial getCapturedInputs load)
  • tsc / lint / full suite (3785 tests) clean

Rollback

Revert the PR. The captured-inputs columns from #1731 stay (nullable, append-only) and unused entries cause no issues.

Notes for Craig

  • Visual: spec mentioned base.bgInput; the palette uses base.bgSurface for input backgrounds (matches the existing observe TextInput) so I used that for consistency. Easy to swap if you'd rather a dedicated token.
  • Kanban move requires manual action.

Generated by Claude Code

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.
@github-actions
Copy link
Copy Markdown

Test Results

✅ All tests passed

Passed Failed Total
Tests ✅ 3785 ❌ 0 3785
Suites ✅ 509 ❌ 0 509

Coverage

Statements Branches Functions Lines

⏱️ Duration: 89.5s

@CraigBuckmaster CraigBuckmaster merged commit 363af0d into master Apr 26, 2026
6 checks passed
@CraigBuckmaster CraigBuckmaster deleted the feature/issue-1734-mode-scene-rows branch April 26, 2026 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Phase 2.5 — Mode-specific scene rows (Devotional/Teaching unique inputs)

1 participant