fix: show 1-decimal probability and conditional confidence badge

- Display probability with 1 decimal (89.8% instead of 90%) so users
  understand why it's below the 90% winner threshold
- Replace hardcoded "Significant Confidence Reached" badge with
  verdict-aware badge: winner=green, loser=red, inconclusive=amber

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Christian Vidal Wolf
2026-03-10 13:36:23 +01:00
co-authored by Claude Sonnet 4.6
parent e118d43b3d
commit 127fa9c279
+18 -3
View File
@@ -474,10 +474,13 @@ const ExperimentDetailView: React.FC<{
); );
} }
const prob = Math.round((experiment.verdict_probability || 0) * 100); const probRaw = (experiment.verdict_probability || 0) * 100;
const probDisplay = Number.isInteger(Math.round(probRaw * 10) / 10)
? probRaw.toFixed(0)
: probRaw.toFixed(1);
const radius = 60; const radius = 60;
const circumference = 2 * Math.PI * radius; const circumference = 2 * Math.PI * radius;
const offset = circumference - (prob / 100) * circumference; const offset = circumference - (probRaw / 100) * circumference;
return ( return (
<div className="bg-[#0b1120] text-slate-200 min-h-screen -mx-4 md:-mx-6 -mt-4 md:-mt-6 p-6 md:p-8 font-sans"> <div className="bg-[#0b1120] text-slate-200 min-h-screen -mx-4 md:-mx-6 -mt-4 md:-mt-6 p-6 md:p-8 font-sans">
@@ -657,15 +660,27 @@ const ExperimentDetailView: React.FC<{
/> />
</svg> </svg>
<div className="absolute inset-0 flex items-center justify-center flex-col"> <div className="absolute inset-0 flex items-center justify-center flex-col">
<span className="text-5xl font-black text-white">{prob}%</span> <span className="text-5xl font-black text-white">{probDisplay}%</span>
</div> </div>
</div> </div>
<div className="flex justify-center mb-10"> <div className="flex justify-center mb-10">
{experiment.verdict === 'winner' ? (
<span className="bg-emerald-500/10 text-[#10b981] border border-emerald-500/20 text-[10px] font-bold uppercase tracking-widest px-4 py-2 rounded-full inline-flex items-center gap-1.5 shadow-[0_0_15px_rgba(16,185,129,0.1)]"> <span className="bg-emerald-500/10 text-[#10b981] border border-emerald-500/20 text-[10px] font-bold uppercase tracking-widest px-4 py-2 rounded-full inline-flex items-center gap-1.5 shadow-[0_0_15px_rgba(16,185,129,0.1)]">
<svg className="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" /></svg> <svg className="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>
Significant Confidence Reached Significant Confidence Reached
</span> </span>
) : experiment.verdict === 'loser' ? (
<span className="bg-red-500/10 text-red-400 border border-red-500/20 text-[10px] font-bold uppercase tracking-widest px-4 py-2 rounded-full inline-flex items-center gap-1.5">
<svg className="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>
Negative Effect Confirmed
</span>
) : (
<span className="bg-amber-500/10 text-amber-400 border border-amber-500/20 text-[10px] font-bold uppercase tracking-widest px-4 py-2 rounded-full inline-flex items-center gap-1.5">
<svg className="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" /></svg>
Inconclusive More Data Needed
</span>
)}
</div> </div>
{/* Estimated Annual Impact */} {/* Estimated Annual Impact */}