feat(ui): distinct color tones for Session Musician confidence bands - #27
Conversation
PR #22 shipped a four-band confidence ladder (Solid scaffold / Workable draft / Rough sketch / Unreliable) but the PILL_CLASSES map collapsed them into only two tones — accent for solid + workable, warning for rough + unreliable. A producer couldn't visually distinguish Solid from Workable, or Rough from Unreliable, at a glance. Map the four bands to a green → orange → amber → red traffic-light ladder so the visual hierarchy matches the producer's mental model ("best to worst at a glance"): Solid scaffold (≥80%) → success (#00ff9d green) Workable draft (50-79%) → accent (#ff8800 orange) Rough sketch (25-49%) → warning (#ffb800 amber) Unreliable (<25%) → error (#ff3333 red) All four CSS variables already exist in apps/ui/src/index.css and are the canonical severity vocabulary across MeasurementPrimitives, DiagnosticLog, and FileUpload (success = ready, accent = active, warning = caution, error = critical). No theme additions; no new shades. Opacity tuning unified at /30 border, /10 bg, text-{color} to match MeasurementPrimitives.BADGE_TONE_CLASSES. Color carries the differentiation now — the previous per-band opacity wobble didn't communicate anything. NoteDraftBlock's overrideTone="rough" path (used for full-mix-fallback and legacy render states) now renders amber, which is the right tone for "treat with caution, not unreliable junk." No wiring change needed. Tests: new tests/services/confidenceBandBadge.test.ts renders all four confidence values and asserts each emits the expected color tokens. A pairwise-distinct assertion survives future opacity tweaks. Two override-path tests lock in the full-mix-fallback / legacy visual (high-confidence input with overrideTone="rough" produces warning tokens, not green; low-confidence input stays warning, not red). No existing tests touched — confidenceBand asserts id/label/percent (not classes); panel + smoke tests assert on text. Targets PR #22 (claude/thirsty-easley-faeaea) as the base. Plan in ~/.claude/plans/re-evaluate-asa-s-session-musician-sharded-balloon.md ("Follow-up plan #1" section). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
slittycode
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
Pure visualisation change: maps the four confidence bands to four visually distinct CSS color tokens (success/accent/warning/error) instead of collapsing them into two. New test file adds 10 meaningful tests that pin the tone mapping and override path. All 341 unit tests pass.
Findings
Worth considering:
ConfidenceBandBadge.tsx — The PR description says opacity is "unified at /30 border", but workable uses border-accent/40 while the other three use /30. It's a four-point opacity difference and probably intentional sub-distinction, but the description is wrong and the tests don't pin opacity (they match border-accent/ without a suffix check). If it's intentional, the description should say so; if it's a typo in the mapping, the fix is trivial. Not blocking.
Test results
341 passed / 0 failed across 36 files. The new confidenceBandBadge.test.ts contributes the 10 advertised tests; the pairwise-distinct check (unique.size === 4) is the right high-value assertion for this kind of visual mapping.
Phase boundary check
Clean. ConfidenceBandBadge reads confidence as a prop and maps it to a CSS class. No Phase 1 values are mutated, re-derived, or bypassed.
Generated by Claude Code
Why
PR #22 shipped a four-band confidence ladder (Solid scaffold / Workable draft / Rough sketch / Unreliable), but the
PILL_CLASSESmap inConfidenceBandBadge.tsxcollapsed them into only two tones —accentfor solid + workable,warningfor rough + unreliable. A producer couldn't visually distinguish Solid from Workable, or Rough from Unreliable, at a glance.What changed
Map the four bands to a green → orange → amber → red traffic-light ladder so the visual hierarchy matches the producer's mental model (best to worst at a glance):
--color-success: #00ff9d--color-accent: #ff8800--color-warning: #ffb800--color-error: #ff3333All four CSS variables already exist in
apps/ui/src/index.css. They're the canonical severity vocabulary acrossMeasurementPrimitives,DiagnosticLog, andFileUpload: success = ready, accent = active, warning = caution, error = critical. No theme additions; no new shades.Opacity tuning unified at
/30 border,/10 bg,text-{color}to match the establishedBADGE_TONE_CLASSESconvention.Override path (full-mix-fallback and legacy)
NoteDraftBlock.tsxpassesoverrideTone="rough"to<ConfidenceBandBadge>in both thefull-mix-fallbackandlegacyrender states. With the new mapping, both override states render as amber — the right tone for "treat with caution, not unreliable junk." No wiring change needed.Tests
tests/services/confidenceBandBadge.test.ts— 10 tests:unique.size === 4) survives future opacity tweaks.overrideTone="rough"tests lock in the fallback/legacy visual.npm run verifyis green.🤖 Generated with Claude Code