Repository navigation
Use one size formatter for gauges and Unraid. - #1273
Merged
calledtoconstruct merged 1 commit intoDec 5, 2026
Merged
calledtoconstruct merged 1 commit into
calledtoconstruct merged 1 commit into
Conversation
Machine gauges and the Unraid import list kept their own copies, so a size just under a unit still read 1024 KB or 1000 KB. They now use the shared helper, which steps up after rounding. Fixes MyOwnDataCenter#141 Co-Authored-By: Grok 4.7
Collaborator
Author
|
Thank you @nixfred. Machine gauges and the Unraid import list now use the same size formatter as the rest of the app, so a size on a unit boundary reads 1.0 MB. Merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Machine gauges and the Unraid import list use the same size formatter as the rest of the app. A size that rounds onto the next unit now reads 1.0 MB instead of 1024 KB or 1000 KB.
Fixes #141.
How you tested it
npm run typecheck,npm run buildandnpm testpassTypecheck (
tsc --noEmit -p web) passed. Targeted tests passed:test/swarm-gauges.test.mjs,test/unraid-ui.test.mjs,test/desktop-controls.test.mjs(27 tests). Fullnpm testandnpm run buildwere not run.Anything to know
Unraid sizes between 10 and 99 of a unit now show one decimal (10.0 KB), matching the shared helper. Null and non-numeric sizes still say "size unknown". Version and What's New are unchanged.
Note
Low Risk
Display-only formatting consolidation with targeted tests; no changes to data handling or security paths.
Overview
Swarm machine gauge subtitles and Unraid import size labels now call the shared
byteshelper fromformatBytes.tsinstead of local duplicates inswarm/gauges.tsandunraidView.ts.Behavior change: values that round up to the next unit display as 1.0 MB (and similar) rather than awkward strings like 1024 KB or 1000 KB. Unraid
formatBytesalso treats non-finite numbers as "size unknown", consistent with null.New tests lock in boundary rounding for swarm memory/storage subtitles and for
formatBytes(1048575).Reviewed by Cursor Bugbot for commit 7a72c8a. Bugbot is set up for automated code reviews on this repo. Configure here.