Fix #29: tree size style, rwx modes, header meta #30
No reviewers
Labels
No labels
actions
bug
cli
duplicate
enhancement
fork
forum
git storage
help wanted
insights
invalid
issues
moderation
oidc
ownership transfer
packages
pr/merge protection rules
projects
pull requests
question
releases
sponsorships
tags
webhooks
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub!30
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/tree-polish"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up polish on the tree (code) page.
1. Size column.
fmtSize(web/src/lib/format.js) drops the space and lowercases the byte suffix so the last character is always a letter:0b,92b,1023b;k/MB/GBunchanged.format.test.jsexpectations updated (it was the only ♦web♦ test asserting the old spelling). Exact-bytestitletooltips (\“48372 bytes\”) untouched. Size column right-aligned (th + td,tabular-numskept). Blob size spots pick the new spelling up automatically (same helper).2. Modes as rwx triplets, incl. folders. New headless-testable
fmtModehelper in the same module + unit tests: 100644→rw-r--r--, 100755→rwxr-xr-x, 120000→rwxrwxrwx, 040000/40000→rwxr-xr-x, 160000 gitlink→m---------(decided:mmarks a submodule commit pointer, dashes mark “no permission bits”; documented in code +docs/go/12_web_ui.md). Unknown octal falls back to its low 9 permission bits; missing/blank stays blank. Tree mode cell rendersfmtMode(e.mode)with raw octal intitle; folders show their mode whenever the API provides one (verified: the API returns040000for trees), blank otherwise — nothing invented.3. Meta line moved to the header. Tree‘s
<p>{sha12} · {n} entries</p>removed; the repo-header{branch} @ {sha}pill is the single branch@sha source (Repo.jsx untouched). Subpath-sha decision: no crumb-adjacent suffix — the resolve sha is the commit sha (equals the head sha in the normal case) and the breadcrumb already carries ref+path, so a suffix would almost always duplicate the header.Verification.
node --test web/test/unit/*.test.jsgreen (181/181). Rebuilt the standalone stack from this branch and drove a real tree page (repo with subdir + regular + symlink + executable) in headless Chromium, dark + light: mode triplets + raw-octal titles,29b/9b/18bright-aligned with “N bytes” titles, header pillmain @ 0059cebdb3, no meta line, zero console errors. No new deps, no TS. Out of scope (noted):fmtBytesin Repo.jsx (Release/Settings/Wal pages) keeps itsKiBstyle.The Breadcrumb head link ("main" below the tabs) duplicated the header's `main @ sha` pill and the Code tab. At repo root no breadcrumb renders at all; on subpaths only the path segments render. Applied identically to Blob.jsx, which carried its own copy of the same pattern.The follow-up dropped the head link entirely, leaving no crumb line at repo root. Restore the first crumb as a link to /{full} labeled literally root (never the branch name, so no duplication with the header main @ sha pill). Root renders just root; subpaths render root / sub / dir with root+intermediates linked and the final segment strong. Blob keeps passing rev for subpath hrefs.Tree/Blob Breadcrumb wraps nav.crumbs in <Show when={parts().length > 0}>: repo root renders no breadcrumb nav; subpaths keep root-first crumbs.