Repository navigation
fix(sensors): keep text contrast against the real background - #5
Merged
mirkobrombin merged 2 commits intoOct 14, 2026
Merged
Conversation
The chip colored its markup from theme severity tokens regardless of what it rendered on, and the popover dimmed values with opacity, so text became unreadable on light, translucent or mismatched panels. Sample the pixels around the chip and the popover content, then derive neutral, muted and severity colors that reach WCAG 7:1 (4.5:1 minimum) by shifting lightness only. A translucent surface gets its own backing. Warning and critical also differ by glyph and weight. Re-evaluated on theme, dark-preference and panel redraw signals. The contrast math is in contrast.vala with a meson test. Assisted-by: Claude Code:claude-sonnet-5-5 AI-Scope: Drafted the contrast math, sampling and CSS wiring from a description of the bug.
mirkobrombin
force-pushed
the
fix/sensors-text-contrast
branch
from
October 14, 2026 10:59
8a495f6 to
7b8484a
Compare
Member
|
The problem is real and the contrast math and the glyphs for warning and critical are good, I kept them. What I changed: the panel already knows whether the wallpaper under it is light (light-bg on the panel window), so the plugin now follows that instead of re-rendering the whole panel into a texture on every redraw, and the scrim backing is gone. The popover uses the theme background. Rebased and merging. |
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 sensors chip colors each metric from theme tokens without looking at what is behind it, and the popover dims values with
dim-labelopacity. On a translucent panel over a bright wallpaper, or a light theme over a dark surface, the text is close to invisible. Measured with the WCAG formula: red on sky blue 1.7:1, green on sky blue 1.4:1, green on a light panel 1.8:1, dim value on a light popover 3.8:1.Change
sensors/contrast.vala: WCAG luminance and contrast math, lightness shifting that keeps the theme hue, a muted tone, a median helper.Before / after (dark, light):
Verification
meson setup && ninja784/784 targets,meson test25/25 pass, includingsensors-contrast(7 cases over 10 backgrounds; neutral, muted and semantic colors asserted at 4.5:1 or better, white and black at 7:1).Not verified
AI assistance: disclosed