Repository navigation
fix(ui): one cyan highlight everywhere, with white text on it - #8
Merged
Merged
Conversation
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>
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 bug
A selected table row showed white text on a near-white background.
Selections were being painted three different ways:
#2323FF#EDEDFF#E5E5FFA cell's text is drawn by the item delegate using
selection-color, not by the::item:selectedrule, and the globalQWidgetrule had set that to white tosuit 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
QPalettedoes not work. A style sheet'sselection-coloralways winsover the palette, so an earlier attempt at this changed nothing measurable --
the table's palette still reported
HighlightedText #ffffffafterwards.The change
One highlight, taken from the lightest colour in the icon:
#24AEFFwithwhite 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
#24AEFFmeasures 2.45:1, below the WCAG AA threshold. This is adeliberate 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
#1978B3puts white text at about 4.7:1 while staying recognisably the samecyan; 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