fix(ui-tui): session-panel fade anchors on muted, not the surface — readable on every pole

mix(text, surface) was invisible whenever text was already pale (the
light-rendered default: cream blended toward white = nothing) and inherited
wrong-polarity detection through the surface. mix(muted, text, .5) is
pole-proof: muted is mid-luminance by construction, so the midpoint stays
readable everywhere. Audited 9 skins x both poles: 2.0-2.9:1 on white,
5.6-9.3:1 on dark (worst case 1.92 for a light-authored skin on dark).
This commit is contained in:
Brooklyn Nicholson 2026-07-20 17:47:16 -05:00
parent 4426d57a84
commit e594e11baa

View file

@ -233,10 +233,12 @@ export function SessionPanel({ info, maxWidth, sid, t }: SessionPanelProps) {
const strip = (s: string) => (s.endsWith('_tools') ? s.slice(0, -6) : s)
// Hierarchy: category labels lead in the theme's label tone; member lists
// recede in body-text faded toward the surface. Skin-relative on purpose —
// `muted` is the STRONG family tone on gold skins but the weak one on blue
// skins, so hardcoding it flips the hierarchy per skin (slate/poseidon bug).
const listFade = mix(t.color.text, t.color.completionBg, 0.5)
// recede in the midpoint of muted and text. Anchoring on MUTED (a
// mid-luminance family tone) keeps the fade readable on both poles even
// when polarity detection is wrong — blending toward the SURFACE instead
// made the fade invisible whenever text was already pale (light-rendered
// default: cream toward white = nothing).
const listFade = mix(t.color.muted, t.color.text, 0.5)
// ── Local collapse state for each section ──
const [toolsOpen, setToolsOpen] = useState(true)