fix(web): keep the contrast slider from flattening text hierarchy - #70
Merged
Conversation
The appearance contrast boost mixes every foreground role toward one shared target, so at a full 100% they all resolve to exactly that target. Measured in a browser against the real tokens: at the slider's own maximum of 200, `--contrast-foreground`, `--contrast-muted-foreground`, `--contrast-placeholder` and `--contrast-icon-muted` all come back `oklab(0 0 0)`. Body text, muted timestamps and placeholder text become the same colour, so an empty composer reads as a filled one. It degrades before the maximum too — lightness separation between normal and muted text runs 0.278 at the default, 0.111 at 160, 0.055 at 180, then 0. Scaling the foreground mix to 0.6 keeps the top of the range clearly darker than the default while holding the roles apart, and leaves the slider's range and direction untouched. Borders keep the full curve: they carry a single role, so converging costs no hierarchy, and their quarter-weight already bounds them. Arrived with #7906 (upstream) in #68; not a Pylon-authored defect.
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
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 last open finding from the #68 review, now measured in a browser rather than reasoned about.
The problem
#7906's contrast boost mixes every foreground role toward one shared target. Per CSS Color 5 an omittedcolor-mix()percentage is100% - other, so at a full 100% boost the inner mix gets 0% and each token resolves to the target itself.Measured against the real Pylon light-theme tokens, reading back
getComputedStyle().color:--contrast-foregroundL--contrast-muted-foregroundLAt 200,
--contrast-foreground,--contrast-muted-foreground,--contrast-placeholderand--contrast-icon-mutedall come backoklab(0 0 0). Body text, muted timestamps, icon labels and placeholder text render identically — so an empty composer is indistinguishable from a filled one, and the whole secondary hierarchy disappears at the setting's own maximum. It degrades well before the maximum, too.The fix
Scale the foreground mix by 0.6, so the maximum lands at a 60% boost instead of 100%:
The slider keeps its full 50–200 range and its direction; the top is still clearly darker than the default; the roles stay apart. The ratio between roles was already preserved at every level — it's the absolute separation that collapses — so capping the mix is enough.
Borders keep the full curve. They carry a single role, so converging on the target costs no hierarchy, and their existing quarter-weight already bounds them at 25%.
0.6is a judgment call. 0.5 gives separation 0.139 if you want more headroom; the constant is named and documented at the one place it's applied.Notes
#7906in chore(upstream): adopt the 2026-08-23 T3 Code batch #68. Not a Pylon-authored defect, and upstream has the same behavior.color-mix()— not app wiring.vp test run apps/web/src/appearanceContrast.test.ts— 4 passed; the max-boost test now also asserts the boost is not 100%.@t3tools/webtypecheck clean;vp checkclean on both files.Claude Opus 5 in Pylon.
Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.