Repository navigation
Conversation
The light theme's field_bg token was pure white, so checkboxes, slider troughs and field backgrounds were invisible on the white dialog card. Give it the palette's card-border grey so the controls stand out.
FredApps
left a comment
There was a problem hiding this comment.
ReviewerA — source-read COMMENT (not an approval)
I read the head of the diff: light-mode controls stand out on dialogs (#826). field_bg changes from white to #E3E3E3 so checkboxes, slider troughs and fields are not white on the white card, and a test checks that field backgrounds stand out against the dialog background in both themes. A contrast test with a threshold is the right proof; the threshold should be a stated ratio (a 3:1 non-text contrast is the WCAG 2.1 figure for user interface components), and text drawn on the new field colour must still meet 4.5:1. I have not run it, and no exact-head CI result exists for this head. Nothing was run.
I ran nothing and have no exact-head CI result for this PR, so this is not an approval. Where a diff was long I read its code hunks rather than every generated or documentation line.
Status: waiting_author.
aiongg
left a comment
There was a problem hiding this comment.
AI-generated review (Opus). Not a maintainer decision.
Significant problems found:
This change makes light-mode checkboxes and slider rails visible by turning field_bg from white to #E3E3E3. The default branch already solves this with separate tokens, and this change conflicts with that approach.
- On the default branch,
widgets.inactive.bg_fillcomes from a dedicatedcontroltoken (#D6D6D6, with darker hover and pressed steps), and text edits use atext_fieldtoken. Light-mode checkbox and slider visibility is already covered bylight_checkboxes_and_slider_rails_stand_out_from_their_backgroundin crates/ui-egui/src/theme.rs. - With that split in place, changing the light
field_bgwould no longer affect checkboxes or sliders. It would only grey out the remainingfield_bgsurfaces: the print page combo boxes (crates/ui-egui/src/backstage.rs:387-390), crates/ui-egui/src/widgets.rs:340 and the effect preset tiles (crates/ui-egui/src/panels/effect_presets.rs:84,162). - The new test requires
extreme_bg_colorto differ from the dialog fill. On the default branch it equals the white card on purpose, so the test would fail there without changing behaviour that is now handled elsewhere. - Issue #826 describes dark-mode text, and its follow-up points to the print page's combo boxes under software rendering. This change does not touch that path, so it does not resolve that issue.
Claims checked:
- contradicted: Light-mode checkbox fills and slider troughs come from
field_bgand were white on a white dialog; makingfield_bg0xE3E3E3 makes them visible (At the PR head, crates/ui-egui/src/theme.rs:74 sets field_bg to 0xE3E3E3 and :136 uses it for inactive.bg_fill. On the default branch, crates/ui-egui/sr… - contradicted: Fixes #826 (#826 reports black text in dark mode, traced in its comments to the print page combo boxes (crates/ui-egui/src/backstage.rs:387-390). The PR changes only light-mode values at crates/ui-egui/src/theme.rs:74 and leaves dark mode unchanged (:102).)
- verified: The dark theme already uses a
field_bgoff its card colour (crates/ui-egui/src/theme.rs:102 sets dark field_bg to 0x2A2A2A, and :82 sets the dark card to 0x333333.)
Recommendation: wait for maintainer feedback.
Reviewed at 45801b3.
The Preferences checkbox and the Interface size slider were invisible in light mode (#826): their fills come from the
field_bgtoken, which was pure white, on a dialog that is also white and draws no border around its controls — white-on-white. The dark theme already used afield_bgslightly off its card colour, which is why only light mode looked broken. The reporter's suggested fix is exactly this: make the background colour of those controls darker.What changed:
crates/ui-egui/src/theme.rs— lightfield_bgis0xE3E3E3(the palette's card-border grey) instead of white, so checkbox fills, slider troughs and field backgrounds stand out on the white card and the chrome.crates/ui-egui/src/theme.rs— new regression testfield_backgrounds_stand_out_on_dialogschecks the effective egui visuals afterapply: control fills must differ from the dialog background by a visible margin in both themes.Note on the ticket title: the relay title says "text appears black in dark mode in some menus", which we could not reproduce — deterministic pixel sampling of the dark-mode Preferences dialog found no black text (175,000 samples, minimum luminance equal to the dialog background). The reporter's body describes the light-mode control backgrounds, and that is what this fixes.
Fixes #826
Validation:
cargo xtask cipasses (fmt, clippy-D warnings, tests, layering, assets, wasm). The regression testfield_backgrounds_stand_out_on_dialogsis proven red-green (it fails on white-on-white before this change). Verified in the running app: the light-mode Preferences dialog now shows the checkbox and slider clearly against the dialog.