Merge pull request #3896 from bluewave-labs/fix/gauge-arc-clamp-and-key

fix(infrastructure): clamp gauge arc and fix disk key fallback
This commit is contained in:
Alexander Holliday authored and GitHub committed 2026-08-31 09:30:45 -07:00
commit c45a21b4c8
2 files changed
+4 -4

No files matched your search

@@ -39,9 +39,9 @@ export const Gauge = forwardRef<HTMLDivElement, GaugeProps>(function Gauge(
() => ({
circumference: 2 * Math.PI * radius,
totalSize: radius * 2 + strokeWidth * 2,
strokeLength: (progress / 100) * (2 * Math.PI * radius),
strokeLength: (progressWithinRange / 100) * (2 * Math.PI * radius),
}),
[radius, strokeWidth, progress]
[radius, strokeWidth, progressWithinRange]
);
const [offset, setOffset] = useState(circumference);
@@ -52,7 +52,7 @@ export const Gauge = forwardRef<HTMLDivElement, GaugeProps>(function Gauge(
}, 100);
return () => clearTimeout(timer);
}, [progress, circumference, strokeLength]);
}, [circumference, strokeLength]);
const fillColor = getInfraGaugeColor(progressWithinRange, theme);
@@ -54,7 +54,7 @@ export const InfraDetailsGauges = ({
{snapshot?.disk?.map((disk, idx) => {
return (
<DetailGauge
key={disk?.device || 0 + idx}
key={disk?.device || `disk-${idx}`}
// title={`Disk ${idx} usage`}
title={t("pages.infrastructure.gauges.disk.title", { idx })}
maxWidth={GAUGE_MAX_WIDTH}