fix(tui): use semantic form tokens - #42599
Merged
Merged
Conversation
kitlangton
enabled auto-merge (squash)
August 14, 2026 16:08
# ------------------------ >8 ------------------------ # Do not modify or remove the line above. # Everything below it will be ignored. # # Conflicts: # packages/workerd-spike/vitest.config.ts
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.
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.successto 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 usetext.formfield.selected. The focused option receives one consistent highlighted treatment. Genuine success feedback, such as an acknowledged external action, remains ontext.feedback.success.How
packages/tui/src/routes/session/form.tsxmaps configured and custom choice indicators to existing form-field states.AGENTS.mdtells 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 typecheckfrompackages/themeandpackages/tuibun 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)Demo
The focused ordinal, checkbox, and label use the regular highlighted form-field treatment.
Toggling the focused option preserves the highlight and fills the marker.