diff --git a/src/components/baseball/staff-decision-room/StaffDecisionRoomClient.tsx b/src/components/baseball/staff-decision-room/StaffDecisionRoomClient.tsx index 465e79482..5ab9c184b 100644 --- a/src/components/baseball/staff-decision-room/StaffDecisionRoomClient.tsx +++ b/src/components/baseball/staff-decision-room/StaffDecisionRoomClient.tsx @@ -53,6 +53,8 @@ import { IconGauge, IconTrendingUp, IconTrendingDown, + IconMinus, + IconHelp, IconTrophy, IconShieldAlert, IconCalendar, @@ -154,6 +156,31 @@ function verdictPresentation( } } +// --- Practice Effectiveness direction presentation -------------------------- +// Honest by construction: only 'regressed' earns danger styling. 'no_change' +// (metric held steady) and null (insufficient sample) read neutral — they were +// previously mislabeled as "Moved the wrong way" in red. (Issue #498) +interface EffectivenessPresentation { + label: string; + tone: 'success' | 'danger' | 'secondary'; + /** Direction glyph for the badge. */ + glyph: 'up' | 'down' | 'flat' | 'unknown'; +} +function effectivenessPresentation( + direction: DecisionRoomEffectivenessReview['direction'], +): EffectivenessPresentation { + switch (direction) { + case 'improved': + return { label: 'Associated improvement', tone: 'success', glyph: 'up' }; + case 'regressed': + return { label: 'Moved the wrong way', tone: 'danger', glyph: 'down' }; + case 'no_change': + return { label: 'Held steady', tone: 'secondary', glyph: 'flat' }; + default: + return { label: 'Not enough data', tone: 'secondary', glyph: 'unknown' }; + } +} + /** Format a metric value honoring its unit (pct → %, else 1-dp number). */ function formatMetricValue(value: number | null, unit: string | null): string { if (value == null) return '—'; @@ -1263,16 +1290,24 @@ function EffectivenessReviewRow({ }: { review: DecisionRoomEffectivenessReview; }) { - const improved = review.direction === 'improved'; + const pres = effectivenessPresentation(review.direction); return (
- + - {improved ? : } + {pres.glyph === 'up' ? ( + + ) : pres.glyph === 'down' ? ( + + ) : pres.glyph === 'flat' ? ( + + ) : ( + + )} - {improved ? 'Associated improvement' : 'Moved the wrong way'} + {pres.label}