Draw the settings sliders instead of shipping the browser's - #120
Merged
Conversation
The generation controls were `input[type="range"]` with nothing but `accent-color` on them, so Settings rendered whatever rail the host browser draws by default -- which in WebView2, the thing Cortex actually ships in, is the stock grey Chromium control. Each one also spanned the full pane, giving a 0-2 range about a thousand pixels of travel, and the current value floated above the track via `float: right`. Adds a RangeField control with a real track and thumb. The filled portion comes from a `--range-fill` percentage published by the component, because only Firefox paints that natively (`::-moz-range-progress`) and WebKit has no equivalent -- doing it in CSS alone would have looked right in one engine and wrong in the one we ship. The four sampling controls now sit in two columns rather than one long stack, the value reads as a chip on the label's baseline instead of a floated span, and the section is grouped into Sampling / Context / System prompt with a line and a sentence of explanation each. The whole panel now fits one screen where it previously needed scrolling. The toggles were `<input type="checkbox">` at 42x23, which renders as a stretched checkbox, not a switch. They are painted as switches now and stay checkboxes underneath, so role, keyboard behaviour, and label association are unchanged -- the existing tests query them by role and still pass untouched. Verified in both themes: the light palette was checked separately, since the track and thumb are drawn from --line-strong and --surface rather than from a fixed colour. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
The problem
The generation controls were
input[type="range"]with a single line of CSS:So Settings rendered whatever rail the host browser draws by default — in WebView2, which is what Cortex actually ships in, the stock grey Chromium control. On top of that:
float: right<input type="checkbox">sized to42x23, which renders as a stretched checkbox, not a switchThe fix
A
RangeFieldcontrol with a real track and thumb. The filled portion comes from a--range-fillpercentage published by the component, because only Firefox paints that natively (::-moz-range-progress) and WebKit has no equivalent — doing it in pure CSS would have looked right in one engine and wrong in the one we ship.Verification
./scripts/check.ps1— 6/6 green (506 backend, 163 frontend, types, lint, contracts)--line-strongand--surfacerather than fixed colours, so light mode was verified separately rather than assumed.🤖 Generated with Claude Code