Fix web UI file-list truncation with no expand, and binary-prefix unit mislabeling - #93
Open
RedlineGT wants to merge 1 commit into
Open
Conversation
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).
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.
Fixes the two issues related to #92.
1. File list truncated at 20, no way to see the rest
renderAnalysisResult(),updateFileListFromSelections(), andshowCacheDetails()each rendered a static, non-interactive
... and N more filesdiv once a repopassed 20 files. There was no way to view the remaining files from the UI.
Added a shared expand/collapse toggle (
renderFileListRowsfor the two Analyzeviews,
renderCacheFileRowsfor the Local Cache detail modal) so thetruncation 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 toall 28, collapses back cleanly.
2.
formatBytes()mislabeled binary-prefix math as decimal unitsRelabeled to
['B', 'KiB', 'MiB', 'GiB', 'TiB']to match the math already inuse, and to match the server's own
size_humanfield, which was alreadycorrectly labeled. This matters most for live download speed/progress, which
has no
size_humanfallback and was always slightly overstating its ownnumeric precision under the old label (e.g. showing "MB/s" for a value that's
really MiB/s).
Testing
node --checkon the modified JS: cleango build ./...: cleanin 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.