Skip to content

fix(tui): use semantic form tokens - #42599

Merged
kitlangton merged 10 commits into
v2from
form-theme-tokens
Aug 14, 2026
Merged

fix(tui): use semantic form tokens#42599
kitlangton merged 10 commits into
v2from
form-theme-tokens

Conversation

@kitlangton

@kitlangton kitlangton commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

What

Restores semantic theme-token usage for question-form selection indicators and records the rule for future TUI work.

Before / After

Before

Checked multiselect markers and single-select checks borrowed text.feedback.success to get a green appearance. That token represents a successful outcome, not selected control state, so custom themes could not style form selection consistently.

After

Focused ordinals and markers use text.formfield.focused; checked markers use text.formfield.selected. The focused option receives one consistent highlighted treatment. Genuine success feedback, such as an acknowledged external action, remains on text.feedback.success.

How

  • packages/tui/src/routes/session/form.tsx maps configured and custom choice indicators to existing form-field states.
  • AGENTS.md tells contributors to choose tokens by semantic role, reserve feedback tokens for outcomes/status, and extend the theme surface rather than borrowing a visually convenient token when a semantic role is missing.

Scope

No new public theme token is needed because the existing form-field states represent these controls. Theme defaults and custom-theme compatibility remain unchanged.

Testing

  • bun typecheck from packages/theme and packages/tui
  • bun run test test/theme/v2/resolve.test.ts test/theme/v2/v1-migrate.test.ts test/cli/tui/form.test.tsx (50 passed, 282 expectations)
  • repository pre-push typecheck (35 packages)
  • generated documentation check
  • OpenCode Drive question-form state audit against the real TUI

Demo

The focused ordinal, checkbox, and label use the regular highlighted form-field treatment.

Focused form option using regular highlighted form-field states

Toggling the focused option preserves the highlight and fills the marker.

Focused and checked form option

@kitlangton
kitlangton enabled auto-merge (squash) August 14, 2026 16:08
@kitlangton
kitlangton merged commit 1d44d56 into v2 Aug 14, 2026
8 checks passed
@kitlangton
kitlangton deleted the form-theme-tokens branch August 14, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant