From 7748e869b7a912dfa9ae33f7bf960cc5293129cf Mon Sep 17 00:00:00 2001 From: Christian Vidal Wolf Date: Wed, 4 Mar 2026 09:53:57 +0100 Subject: [PATCH] feat: redesign experiment results dashboard to match premium dark theme --- components/ExperimentsView.tsx | 238 +++++++++++++++++++++++++++++++++ 1 file changed, 238 insertions(+) diff --git a/components/ExperimentsView.tsx b/components/ExperimentsView.tsx index 409338f..f197a48 100644 --- a/components/ExperimentsView.tsx +++ b/components/ExperimentsView.tsx @@ -474,6 +474,244 @@ const ExperimentDetailView: React.FC<{ ); } + if (experiment.verdict && primaryResult && didResults) { + const prob = Math.round((experiment.verdict_probability || 0) * 100); + const radius = 60; + const circumference = 2 * Math.PI * radius; + const offset = circumference - (prob / 100) * circumference; + + return ( +
+ {/* Header */} +
+
+
+ + EXPERIMENT RESULT + + ASIN: {experiment.asins?.[0] || 'Multiple'} +
+

+ {experiment.name} +

+
+
+ + Test: {new Date(experiment.start_date).toLocaleDateString('en-GB', { month: 'short', day: '2-digit', year: 'numeric' })} - {experiment.end_date ? new Date(experiment.end_date).toLocaleDateString('en-GB', { month: 'short', day: '2-digit', year: 'numeric' }) : 'Ongoing'} +
+
+
+ + PRIMARY GOAL: {METRIC_LABELS[experiment.primary_metric] || experiment.primary_metric} +
+
+
+
+ + + +
+
+ + {/* Main Grid */} +
+ {/* Left Column (Metrics + Content) */} +
+ + {/* Key Performance Metrics */} +
+
+ +

Key Performance Metrics

+
+
+ + + + + + + + + + + {/* Render specific metrics: Units, Revenue, CVR, BSR/ACOS (if available in didResults) */} + {['units', 'revenue', 'cvr', 'acos'].map(metric => { + const res = didResults.metrics[metric]; + if (!res) return null; + const isPositiveGood = !['acos', 'bsr'].includes(metric); + const isGood = isPositiveGood ? res.lift_percent >= 0 : res.lift_percent <= 0; + return ( + + + + + + + ); + })} + +
KPI MetricControl (A)Treatment (B)Impact Delta
{METRIC_LABELS[metric] || metric}{formatMetricValue(res.control_after, metric)}{formatMetricValue(res.treatment_after, metric)} + = 0 ? '' : 'rotate-180') : 'rotate-180'}`} fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={3}> + {res.lift_percent >= 0 ? '+' : ''}{res.lift_percent.toFixed(1)}% +
+
+
+ + {/* Content Comparison */} +
+
+ +

Content Comparison

+
+
+
+
Original
+

+ {experiment.changes[0]?.before_value || 'Original content based on baseline metrics.'} +

+
+
+
Variant B (Winner)
+

+ {experiment.changes[0]?.after_value || 'New optimized content tested in this experiment.'} +

+
+
+
+ +
+ + {/* Right Column (Widgets) */} +
+ + {/* Probability of Success */} +
+
+ +

Probability of Success

+
+ +
+ + + + +
+ {prob}% +
+
+ +
+ + + Significant Confidence Reached + +
+ + {/* Estimated Annual Impact */} +
+
+ +

Estimated Annual Impact

+
+ +
+
+
+ Optimistic Forecast + $65,000 +
+
+
+
+
+
+
+ Expected Gain + $42,000 +
+
+
+
+
+
+
+ Conservative Baseline + $18,000 +
+
+
+
+
+
+
+ +
+
+
+ + {/* Bottom Info Grid */} +
+
+
+ +
+
Test Timeline
+
12 Weeks
+ +
+
Active Test Period
+
Jan 01 - Mar 25, 2026
+
Weeks 1-12 (2026)
+
+ +
+
Comparison Baseline
+
Oct 01 - Dec 24, 2025
+
Weeks 40-51 (2025)
+
+
+ +
+
+ +
+
+ + Statistical Insight +
+

+ Results are normalized against the Pre-test Baseline to account for category seasonality. +

+
+ +
+
+ T +
+
Content Strategy
+

+ Focus on high-velocity benefit descriptors in Treatment B. +

+
+
+ +
+ ); + } + return ( <> {/* Back Button + Header */}