Skip to content

Fix web UI file-list truncation with no expand, and binary-prefix unit mislabeling - #93

Open
RedlineGT wants to merge 1 commit into
bodaay:masterfrom
RedlineGT:fix/webui-file-list-and-unit-labels
Open

Fix web UI file-list truncation with no expand, and binary-prefix unit mislabeling#93
RedlineGT wants to merge 1 commit into
bodaay:masterfrom
RedlineGT:fix/webui-file-list-and-unit-labels

Conversation

@RedlineGT

@RedlineGT RedlineGT commented Aug 27, 2026

Copy link
Copy Markdown

Fixes the two issues related to #92.

1. File list truncated at 20, no way to see the rest

renderAnalysisResult(), updateFileListFromSelections(), and showCacheDetails()
each rendered a static, non-interactive ... and N more files div once a repo
passed 20 files. There was no way to view the remaining files from the UI.

Added a shared expand/collapse toggle (renderFileListRows for the two Analyze
views, renderCacheFileRows for the Local Cache detail modal) so the
truncation is now a real button instead of a dead end. Verified live against
black-forest-labs/FLUX.1-schnell (28 files): shows 20 + toggle, expands to
all 28, collapses back cleanly.

2. formatBytes() mislabeled binary-prefix math as decimal units

const sizes = ['B', 'KB', 'MB', 'GB', 'TB'];  // decimal labels
const i = Math.floor(Math.log(bytes) / Math.log(1024));  // but base-1024 math

Relabeled to ['B', 'KiB', 'MiB', 'GiB', 'TiB'] to match the math already in
use, and to match the server's own size_human field, which was already
correctly labeled. This matters most for live download speed/progress, which
has no size_human fallback and was always slightly overstating its own
numeric precision under the old label (e.g. showing "MB/s" for a value that's
really MiB/s).

Testing

  • node --check on the modified JS: clean
  • go build ./...: clean
  • Ran the built binary locally, exercised both fixes against a live analysis
    in a real browser (toggle expand/collapse cycle, confirmed row counts at
    each step; confirmed no stale decimal-prefix labels rendered anywhere on
    the page after the fix)

No behavior changes beyond the two fixes above - didn't touch anything else
in this pass to keep the diff reviewable.

formatBytes() computed size with base-1024 math (k=1024, Math.pow(1024,i))
but labeled results with decimal-prefix units (KB/MB/GB/TB). Server-supplied
size_human strings were already correct (KiB/MiB/GiB), but every client-side
fallback - critically, live download speed and progress, which never has a
server string to fall back to - understated its own precision, e.g. showing
"45.2 MB/s" for a value that is really MiB/s. Relabeled to KiB/MiB/GiB/TiB to
match the math already in use.

The three file-list render sites (Analyze card, selection-filtered Analyze
view, Local Cache detail modal) truncated at 20 files with a static, non-
interactive "... and N more files" div - no way to see the rest of a repo's
file list from the UI at all. Added a shared expand/collapse toggle
(renderFileListRows / renderCacheFileRows) so the truncation becomes a real
button instead of a dead end, verified live: FLUX.1-schnell (28 files)
correctly shows 20 + toggle, expands to all 28, collapses back cleanly.

Verified: node --check clean, full go build clean, both fixes exercised
against a live local instance in a real browser (not just source review).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant