refactor(format): one byte formatter for every surface

The document vault and the admin area each carried a formatBytes; the
same backup read 1.25 MB in one and 1.2 MB in the other, and only the
vault knew gigabytes. The vault rule (one decimal below 100, up to GB,
digits in the reader's locale) now lives in src/lib/format/bytes.ts and
takes the locale, so the server-rendered share page uses it too. A test
holds the definition to that one module.
This commit is contained in:
Marc-André Bombeck committed 2026-10-20 12:55:06 +02:00
1 parent 67cc56f707
commit 56daa57350
12 files changed
+84 -70

No files matched your search

@@ -75,7 +75,7 @@ import type { InboundDocumentKindValue } from "@/lib/validations/inbound-documen
import { WrittenOutcomeLine } from "@/components/outcome/written-outcome-line";
import type { WrittenOutcome } from "@/lib/outcome/written-outcome";
import { formatBytes } from "../vault-utils";
import { formatBytes } from "@/lib/format/bytes";
import {
errorCodeOf,
isStoppingError,