Repository navigation
Conversation
The eight segmented option fieldsets in SettingsView were hand-rolled
copies of the same fieldset > legend > div.segmented > button[aria-pressed]
structure. Replace them with a single OptionGroup component.
Adds to controls.tsx:
- OptionGroup, generic over string | number option values, with an optional
columns modifier and a children slot for the trailing note that the
overlay-visibility fieldset renders inside its fieldset
- secondsOptions, which builds the {value / 1000}s labels shared by the
movement, scroll, key and dwell interval groups
- overlayVisibilityOptions and overlaySizeOptions
The DOM is byte-identical. Verified empirically by dumping the rendered
Settings view innerHTML on the parent commit and on this one and diffing:
identical at default settings, and identical again with every feature
toggle enabled and non-default selections across all eight groups.
The pointer-speed fieldset is left alone; its buttons carry per-option
aria-labels and it renders extra content, so it is not the same structure.
SettingsView.tsx: 82 -> 70 lines. Tests unchanged, 75 passing.
Refs #684
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Superseded by the reopened PR against |
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 #684.
Stacked on #691 — base is
refactor/settings-module-683, so review this after that merges (or review just the two-file diff here).The eight segmented option fieldsets in
SettingsViewwere hand-rolled copies of the samefieldset > legend > div.segmented > button[aria-pressed]structure. This replaces them with oneOptionGroup.Added to
controls.tsxOptionGroup— generic overstring | numberoption values, with an optionalcolumnsmodifier (three/four/five, omitted entirely for the one group that has no column class) and achildrenslot for the trailing note that the overlay-visibility fieldset renders inside itsfieldset.secondsOptions— builds the{value / 1000}slabels shared by the movement, scroll, key and dwell interval groups. Returns the label as a fragment so the button keeps its two text nodes rather than collapsing to one.overlayVisibilityOptions,overlaySizeOptions.SettingsView.tsx: 82 → 70 lines.The pointer-speed fieldset is deliberately untouched
Its buttons carry per-option
aria-labels and it renders an exact-speed select plus a movement-values readout, so it is not the same structure. Folding it in would have meant changing DOM.Byte-identical DOM — verified, not assumed
Rather than relying on the tests passing, I dumped the rendered Settings view
innerHTMLon the parent commit and on this one and diffed them:The second case matters because it exercises the
aria-pressedanddisabledstates that the default dump leaves uniform. The dump harness was temporary and is not committed.Validation
npm run lintnpm testnpm run buildcargo fmt --checkcargo clippy --all-targets -- -D warningscargo testNo Rust files are touched; the Rust gates are run per
AGENTS.md.🤖 Generated with Claude Code