Skip to content

Add shared form controls for settings - #218

Merged
raiseCatError merged 1 commit into
feature/166-actionsfrom
feature/167-form-controls
Sep 30, 2026
Merged

raiseCatError merged 1 commit into
feature/166-actionsfrom
feature/167-form-controls

Conversation

@raiseCatError

Copy link
Copy Markdown
Owner

Implements #167.

Stacked on #217 (feature/166-actions), which is stacked on #203. Merge order: #203, #217, then this PR; retarget each to dev after its base merges.

What changed

  • src/ui/formControls.ts: toggle, select, multi-select, text field and confirmation. Key handlers return the proposed value (or nothing) and never store or write it; the owning feature persists.
  • Rendering has a plain path with no escape sequences. Focus is a > marker, changed state is (changed) and errors are Error: ... text, so none of them depend on color.
  • renderField composes label, control, description, changed state and error, and truncates to narrow widths.

Consumers

  • Settings boolean and enum rows step through the shared toggle and select behavior.
  • The Settings search box edits through editText. This also makes paste and delete-word work in the search box.
  • Multi-select and confirmation have no consumer yet; Settings experience v2: searchable registry and progressive disclosure #169 is expected to use them (reset-current-setting confirmation, module lists). They are small and tested here.

Verification

tests/formControls.test.ts covers proposals, keyboard-only use, plain rendering and narrow widths. Full suite 632/632, typecheck, build and git diff --check clean.

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.

1 participant