fix: simplify green/red logic for inverted metrics in experiments

This commit is contained in:
Christian Vidal Wolf
2026-03-10 14:07:43 +01:00
parent 74d92b83b5
commit cefbc18433
2 changed files with 2 additions and 10 deletions
+1 -9
View File
@@ -50,7 +50,7 @@ const App: React.FC = () => {
const [trafficData, setTrafficData] = useState<TrafficRecord[]>([]);
const [loading, setLoading] = useState(true);
const [syncing, setSyncing] = useState(false);
const [view, setView] = useState<'dashboard' | 'table' | 'weekly' | 'movers' | 'ads' | 'forecast' | 'vendor' | 'experiments'>('dashboard');
const [view, setView] = useState<'dashboard' | 'table' | 'weekly' | 'ads' | 'forecast' | 'vendor' | 'experiments'>('dashboard');
const [forecastData, setForecastData] = useState<ProductForecastData[]>([]);
const [isChatOpen, setIsChatOpen] = useState(false);
const [activeUrl, setActiveUrl] = useState<string | null>(() => localStorage.getItem('craze_csv_url') || PERMANENT_DROPBOX_URL);
@@ -768,13 +768,6 @@ const App: React.FC = () => {
>
<TrendingIcon /> <span className="hidden lg:inline">Weekly Sales</span>
</button>
<button
onClick={() => setView('movers')}
className={`flex items-center gap-2 px-3 py-2 rounded-md text-sm font-medium transition-all
${view === 'movers' ? 'bg-slate-800 text-white shadow-sm ring-1 ring-white/10' : 'text-slate-400 hover:text-white hover:bg-slate-800/50'}`}
>
<TrendingIcon /> <span className="hidden lg:inline">Movers</span>
</button>
<button
onClick={() => setView('ads')}
className={`flex items-center gap-2 px-3 py-2 rounded-md text-sm font-medium transition-all
@@ -943,7 +936,6 @@ const App: React.FC = () => {
{ key: 'dashboard' as const, icon: <ChartIcon />, label: 'Home' },
{ key: 'table' as const, icon: <TableIcon />, label: 'Grid' },
{ key: 'weekly' as const, icon: <TrendingIcon />, label: 'Weekly' },
{ key: 'movers' as const, icon: <TrendingIcon />, label: 'Movers' },
{ key: 'ads' as const, icon: <MegaphoneIcon />, label: 'Ads' },
{ key: 'forecast' as const, icon: <ChartIcon />, label: 'Fc 26' },
{ key: 'vendor' as const, icon: <ChartIcon />, label: 'BSR' },
+1 -1
View File
@@ -586,7 +586,7 @@ const ExperimentDetailView: React.FC<{
);
}
const isPositiveGood = !['acos', 'detail_bsr'].includes(metric);
const isGood = isPositiveGood ? res.lift_percent >= 0 : res.lift_percent <= 0;
const isGood = res.lift_percent >= 0;
return (
<tr key={metric} className="hover:bg-white/[0.02] transition-colors">
<td className="py-4 text-[13px] font-bold text-slate-200">