Update modal

This commit is contained in:
MacRimi
2026-02-14 17:28:35 +01:00
parent bafaaf9c47
commit 9f8c27ddc1
2 changed files with 27 additions and 15 deletions

View File

@@ -2433,6 +2433,7 @@ ${(report.sections && report.sections.length > 0) ? `
</div> </div>
</div> </div>
{/* Visual bar */} {/* Visual bar */}
<div className="space-y-1.5 sm:space-y-0">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<div className="flex-1 h-2 rounded-full bg-muted overflow-hidden flex"> <div className="flex-1 h-2 rounded-full bg-muted overflow-hidden flex">
{acceptCount > 0 && ( {acceptCount > 0 && (
@@ -2445,7 +2446,13 @@ ${(report.sections && report.sections.length > 0) ? `
<div className="h-full bg-orange-500 transition-all" style={{ width: `${(rejectCount / total) * 100}%` }} /> <div className="h-full bg-orange-500 transition-all" style={{ width: `${(rejectCount / total) * 100}%` }} />
)} )}
</div> </div>
<div className="flex items-center gap-3 text-[10px] text-muted-foreground flex-shrink-0"> <div className="hidden sm:flex items-center gap-3 text-[10px] text-muted-foreground flex-shrink-0">
<span className="flex items-center gap-1"><span className="w-2 h-2 rounded-full bg-green-500" />Accept</span>
<span className="flex items-center gap-1"><span className="w-2 h-2 rounded-full bg-red-500" />Drop</span>
<span className="flex items-center gap-1"><span className="w-2 h-2 rounded-full bg-orange-500" />Reject</span>
</div>
</div>
<div className="flex sm:hidden items-center gap-3 text-[10px] text-muted-foreground">
<span className="flex items-center gap-1"><span className="w-2 h-2 rounded-full bg-green-500" />Accept</span> <span className="flex items-center gap-1"><span className="w-2 h-2 rounded-full bg-green-500" />Accept</span>
<span className="flex items-center gap-1"><span className="w-2 h-2 rounded-full bg-red-500" />Drop</span> <span className="flex items-center gap-1"><span className="w-2 h-2 rounded-full bg-red-500" />Drop</span>
<span className="flex items-center gap-1"><span className="w-2 h-2 rounded-full bg-orange-500" />Reject</span> <span className="flex items-center gap-1"><span className="w-2 h-2 rounded-full bg-orange-500" />Reject</span>

View File

@@ -120,10 +120,15 @@ export function TemperatureDetailModal({ open, onOpenChange, liveTemperature }:
const currentStatus = getStatusInfo(currentTemp) const currentStatus = getStatusInfo(currentTemp)
const chartColor = getStatusColor(currentTemp) const chartColor = getStatusColor(currentTemp)
// Calculate Y axis domain with some padding // Calculate Y axis domain including the real min/max stats (not just plotted averages)
// This ensures the axis always covers the actual recorded extremes
const values = data.map((d) => d.value) const values = data.map((d) => d.value)
const yMin = values.length > 0 ? Math.max(0, Math.floor(Math.min(...values) - 5)) : 0 const dataMin = values.length > 0 ? Math.min(...values) : 0
const yMax = values.length > 0 ? Math.ceil(Math.max(...values) + 5) : 100 const dataMax = values.length > 0 ? Math.max(...values) : 100
const realMin = stats.min > 0 ? Math.min(dataMin, stats.min) : dataMin
const realMax = stats.max > 0 ? Math.max(dataMax, stats.max) : dataMax
const yMin = Math.max(0, Math.floor(realMin - 3))
const yMax = Math.ceil(realMax + 3)
return ( return (
<Dialog open={open} onOpenChange={onOpenChange}> <Dialog open={open} onOpenChange={onOpenChange}>