From 3f436eb609c7cde75476576c85cacf815bffa109 Mon Sep 17 00:00:00 2001 From: Unsloth Date: Wed, 29 Jul 2026 01:45:08 -0700 Subject: [PATCH] Studio: rule the GPU figures apart and drop trailing zeros Used, free and total ran together with only a gap between them, so the three readings were easy to misread as one. Rule them apart, size the numbers down a step, and widen the block so it starts further left. Whole values now read as 64 GiB rather than 64.0 GiB. --- .../src/features/settings/tabs/resources-tab.tsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/studio/frontend/src/features/settings/tabs/resources-tab.tsx b/studio/frontend/src/features/settings/tabs/resources-tab.tsx index c1889a4168..27ae34d96a 100644 --- a/studio/frontend/src/features/settings/tabs/resources-tab.tsx +++ b/studio/frontend/src/features/settings/tabs/resources-tab.tsx @@ -72,7 +72,10 @@ function formatBytes(value: number | null): string | null { function formatGiB(value: number | null | undefined): string { const safe = isFiniteNumber(value) ? Math.max(0, value) : 0; const digits = safe >= 10 ? 1 : 2; - return `${safe.toFixed(digits)} GiB`; + // digits is never 0, so toFixed always leaves a decimal point and trimming + // trailing zeros cannot reach an integer digit. "64.0" reads as "64". + const text = safe.toFixed(digits).replace(/\.?0+$/, ""); + return `${text} GiB`; } function formatMb(value: number | null | undefined): string { @@ -515,15 +518,20 @@ export function ResourcesTab() { {/* Meter under the figures, so it spans their width instead of - being squeezed into the gap beside them. */} -
-
+ being squeezed into the gap beside them. The min width + starts the block further left than its text alone would. */} +
+ {/* Ruled between the three readings: run together they are + easy to misread as one number. */} +
{t("settings.resources.gpu.used", { value: usedText })} + {t("settings.resources.gpu.free", { value: freeText })} + {t("settings.resources.gpu.total", { value: totalText,