Skip to content

fix(ui): one cyan highlight everywhere, with white text on it - #8

Merged
saudzahirr merged 1 commit into
masterfrom
fix/unified-cyan-highlight
Aug 19, 2026
Merged

saudzahirr merged 1 commit into
masterfrom
fix/unified-cyan-highlight

Conversation

@saudzahirr

Copy link
Copy Markdown
Contributor

The bug

A selected table row showed white text on a near-white background.

Selections were being painted three different ways:

Surface Background Text
Menus, lists solid brand blue #2323FF white
Menu bar pale wash #EDEDFF blue
Table rows pale wash #E5E5FF white ← 1.16:1

A cell's text is drawn by the item delegate using selection-color, not by the
::item:selected rule, and the global QWidget rule had set that to white to
suit the solid blue used elsewhere. Pairing it with the pale row background is
what produced white on near-white.

Worth recording for next time: setting the colours through the widget's
QPalette does not work. A style sheet's selection-color always wins
over the palette, so an earlier attempt at this changed nothing measurable --
the table's palette still reported HighlightedText #ffffff afterwards.

The change

One highlight, taken from the lightest colour in the icon: #24AEFF with
white text
, applied to the menu bar, menus, tables, lists, the combo box
popup and ordinary text selection. Every highlighted thing in the app now
looks the same.

On contrast

White on #24AEFF measures 2.45:1, below the WCAG AA threshold. This is a
deliberate product decision.

Rather than switch the contrast guards off, the pair is recorded as a single
named exception that the tests carry, plus a test asserting the exception still
describes the palette it excuses -- so if the highlight ever changes, that test
fails and forces the exception to be re-examined instead of silently covering a
different pair. Every other pairing is still held to the threshold.

If it should be readable as well as bright, deepening the highlight to
#1978B3 puts white text at about 4.7:1 while staying recognisably the same
cyan; that is a one-line change to selection.bg.

Tests

119 pass. Four are new: the highlight is the lightest logo hue, all three
item-view surfaces share it, white text never lands on a light fill, and the
recorded exception stays accurate.

🤖 Generated with Claude Code

Selections were painted three different ways: menus and lists used a solid
brand blue with white text, the menu bar used a pale wash with blue text, and
table rows used a pale blue wash. That last pair was the visible bug -- a cell's
text is drawn by the delegate using selection-color, which the global rule had
set to white for the solid blue, so a selected row showed white text on
#E5E5FF, a ratio of 1.16:1.

There is now a single highlight, taken from the lightest colour in the icon:
#24AEFF with white text. It applies to the menu bar, menus, tables, lists, the
combo box popup and ordinary text selection, so every highlighted thing in the
app looks the same.

White text on #24AEFF measures 2.45:1, which is below the WCAG AA threshold.
That is a deliberate choice, and rather than switch the contrast guards off the
pair is recorded as one named exception the tests carry, with a further test
asserting the exception still describes the palette it excuses. Every other
pairing is still held to the threshold.

Four tests cover the result: the highlight is the lightest logo hue, all three
item-view surfaces share it, white text never lands on a light fill, and the
recorded exception stays accurate.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@saudzahirr
saudzahirr merged commit c031851 into master Aug 19, 2026
7 checks passed
@saudzahirr
saudzahirr deleted the fix/unified-cyan-highlight branch August 19, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant