Themes: Fix washed-out diff accents and invisible word highlighting - #825
Themes: Fix washed-out diff accents and invisible word highlighting#825masonmcelvain wants to merge 3 commits into
Conversation
Low-contrast diff accents were rescued with a fixed 45% black/white blend, washing genuine palette colors into pastel or mud — e.g. catppuccin-latte's green (contrast 2.96, missing the floor by 0.04) was crushed from #40a02b to #235818 even though a 2% nudge suffices. Since sign colors seed the derived row tints and badges, the wash propagated through the whole theme. Step the blend up from 2% until the contrast floor passes instead, which preserves hue by construction and keeps saturation loss proportional to how far out of range the accent is. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contrast stepping in readableTintedBackground could converge a theme's row tint (0.12/0.2) and word-emphasis tint (0.18/0.28) onto the same color, making word-level diff highlighting invisible — everforest-light, one-dark-pro, and material-theme-palenight all collapsed to identical pairs, and plastic sat 6 channel units apart. Derive the emphasis tints first at full readable strength, then step the row tint further down until the pair clears a minimum channel-distance floor. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
@masonmcelvain is attempting to deploy a commit to the Modem Team on Vercel. A member of the Team first needs to authorize it. |
|
PR author is not in the allowed authors list. |
|
Pulled this onto fresh main and dug through it. The incremental sign-color rescue looks right, but I don’t think the PR is ready yet (feel free to push back on any of this). The word-emphasis part seems to solve the same problem twice. The new sign-color tests also don’t catch the old washout behavior. I replayed the old 45% blend against all 36 rescued catalog accents, and every one still passes the new contrast and hue assertions—blending toward black or white mostly preserves hue. A test for the first passing step, or at least a bound on how far the result can move from the source, would cover the regression better. One smaller edge case: the rescue chooses white whenever background luminance is at most 0.45, but white can’t reach 3:1 once the background is above 0.30. For example, I’d keep the incremental sign rescue, tighten its tests, and fold the emphasis fix into the existing renderer guard. This comment was generated by Pi using GPT-5.6 Sol |
The two contrast guards in
src/ui/themes.tsprotected readability but destroyed theme identity in the process. This fixes both while keeping every existing contrast invariant.Changes
readableDiffSignnow rescues low-contrast accents with the smallest black/white blend that clears the 3:1 floor, stepping up from 2%, instead of a fixed 45% wash.#40a02b→#3f9d2a) instead of being crushed to#235818.addedContentBg/removedContentBg) now derive first at full readable strength, and the row tints step further down until the pair clears a 12 channel-distance separation floor (readableSeparatedRowBackground).Tests
QA
--theme catppuccin-latte(sign colors),--theme one-dark-proor--theme everforest-light(word-level highlighting on changed rows).catpuccin-latteone-dark-proeverforest-light