Skip to content

feat(ui): distinct color tones for Session Musician confidence bands - #27

Merged
slittycode merged 1 commit into
mainfrom
claude/confidence-band-tones
May 13, 2026
Merged

feat(ui): distinct color tones for Session Musician confidence bands#27
slittycode merged 1 commit into
mainfrom
claude/confidence-band-tones

Conversation

@slittycode

Copy link
Copy Markdown
Owner

Successor to #26 (auto-closed when its base branch claude/thirsty-easley-faeaea was deleted after PR #22 merged). Branch rebased onto main; content identical.

Why

PR #22 shipped a four-band confidence ladder (Solid scaffold / Workable draft / Rough sketch / Unreliable), but the PILL_CLASSES map in ConfidenceBandBadge.tsx 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.

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):

Band Range Tone CSS variable
Solid scaffold ≥80% green --color-success: #00ff9d
Workable draft 50–79% orange --color-accent: #ff8800
Rough sketch 25–49% amber --color-warning: #ffb800
Unreliable <25% red --color-error: #ff3333

All four CSS variables already exist in apps/ui/src/index.css. They're 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 the established BADGE_TONE_CLASSES convention.

Override path (full-mix-fallback and legacy)

NoteDraftBlock.tsx passes overrideTone="rough" to <ConfidenceBandBadge> in both the full-mix-fallback and legacy render 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

  • New tests/services/confidenceBandBadge.test.ts — 10 tests:
    • Four per-band tests assert each emits the expected color tokens.
    • A pairwise-distinct assertion (unique.size === 4) survives future opacity tweaks.
    • Two overrideTone="rough" tests lock in the fallback/legacy visual.
  • No existing tests touched. npm run verify is green.

🤖 Generated with Claude Code

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
slittycode merged commit e86f937 into main May 13, 2026
1 of 2 checks passed
@slittycode
slittycode deleted the claude/confidence-band-tones branch May 13, 2026 00:41

@slittycode slittycode left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant