Skip to content

Theme: light-mode controls stand out on dialogs (#826) - #930

Open
Luufen wants to merge 1 commit into
storytold:mainfrom
Luufen:agent/issue-826
Open

Luufen wants to merge 1 commit into
storytold:mainfrom
Luufen:agent/issue-826

Conversation

@Luufen

@Luufen Luufen commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

The Preferences checkbox and the Interface size slider were invisible in light mode (#826): their fills come from the field_bg token, 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 a field_bg slightly 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 — light field_bg is 0xE3E3E3 (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 test field_backgrounds_stand_out_on_dialogs checks the effective egui visuals after apply: 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 ci passes (fmt, clippy -D warnings, tests, layering, assets, wasm). The regression test field_backgrounds_stand_out_on_dialogs is 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.

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 FredApps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 aiongg added the bugfix Fixes something that is broken: wrong result, crash, data loss label Nov 4, 2026

@aiongg aiongg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_fill comes from a dedicated control token (#D6D6D6, with darker hover and pressed steps), and text edits use a text_field token. Light-mode checkbox and slider visibility is already covered by light_checkboxes_and_slider_rails_stand_out_from_their_background in crates/ui-egui/src/theme.rs.
  • With that split in place, changing the light field_bg would no longer affect checkboxes or sliders. It would only grey out the remaining field_bg surfaces: 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_color to 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_bg and were white on a white dialog; making field_bg 0xE3E3E3 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_bg off 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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixes something that is broken: wrong result, crash, data loss

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Report] [DeckCraft] text appears black in dark mode in some menus

3 participants