Code page polish: size style, rwx modes, header meta line #29

Closed
opened 2026-09-04 16:00:27 +00:00 by crueber · 7 comments
Owner

Code page polish: size style, rwx modes, header meta line

Follow-up polish on the tree (code) page.

1. Size column: right-aligned, 92b style (no space, lowercase b)

  • Right-align the size column (th + td text-right; keep tabular-nums).
  • Change fmtSize (web/src/lib/format.js): drop the space and lowercase the bytes suffix so the last character is always a letter — 0b, 92b, 1023b, 1k/47.2k, 1MB, 1GB. Update format.test.js expectations and every snapshot/text that asserts the old " B" spelling (grep 1023 B / B" across web tests). Exact-bytes title tooltips stay ("48372 bytes").

2. Modes as rwx triplets, incl. folders

Tree.jsx renders raw e.mode (100644). Add a headless-testable fmtMode helper (same lib module): 100644→rw-r--r--, 100755→rwxr-xr-x, 120000→rwxrwxrwx, 160000→m---------? (decide + document: gitlink — pick something sane, tested), 40000/040000→rwxr-xr-x. Tree entries of type tree (folders) MUST show their mode too whenever the API provides one (today the mode cell renders whatever e.mode holds — keep that, just formatted; if the API omits folder modes, leave blank, don't invent). Unit-test the mapping. Raw octal in title tooltip.

3. Move the tree meta line into the header

Tree.jsx renders <p class="muted …">{sha12} · {n} entries</p> below the tabs and above the file list. Remove that line; the repo header (Repo.jsx repo-header, below owner/repo) already carries the {branch} @ {sha} pill — that stays the single place for it. Per the request: drop the entry count and don't re-state the branch name (the breadcrumb already shows the ref). If t().sha on a subpath differs meaningfully from the header's head sha, keep it as a subtle crumb-adjacent suffix rather than a full line — decide in the change and note it in the PR.

Acceptance criteria

  • Sizes right-aligned, 92b style everywhere fmtSize is used; tests updated, green.
  • Modes render as rwx triplets incl. folders (unit-tested); raw mode in tooltip.
  • No more meta line above the file list; header pill remains the single branch@sha source.
  • node --test green; real-browser dark+light check of a tree page with mixed modes (incl. an executable + a subdir); zero console errors; no new deps.
# Code page polish: size style, rwx modes, header meta line Follow-up polish on the tree (code) page. ## 1. Size column: right-aligned, `92b` style (no space, lowercase b) - Right-align the size column (th + td `text-right`; keep `tabular-nums`). - Change `fmtSize` (`web/src/lib/format.js`): drop the space and lowercase the bytes suffix so the last character is always a letter — `0b`, `92b`, `1023b`, `1k`/`47.2k`, `1MB`, `1GB`. Update `format.test.js` expectations and every snapshot/text that asserts the old `" B"` spelling (grep `1023 B` / ` B"` across web tests). Exact-bytes `title` tooltips stay (`"48372 bytes"`). ## 2. Modes as rwx triplets, incl. folders `Tree.jsx` renders raw `e.mode` (`100644`). Add a headless-testable `fmtMode` helper (same lib module): `100644`→`rw-r--r--`, `100755`→`rwxr-xr-x`, `120000`→`rwxrwxrwx`, `160000`→`m---------`? (decide + document: gitlink — pick something sane, tested), `40000`/`040000`→`rwxr-xr-x`. Tree entries of type `tree` (folders) MUST show their mode too whenever the API provides one (today the mode cell renders whatever `e.mode` holds — keep that, just formatted; if the API omits folder modes, leave blank, don't invent). Unit-test the mapping. Raw octal in `title` tooltip. ## 3. Move the tree meta line into the header `Tree.jsx` renders `<p class="muted …">{sha12} · {n} entries</p>` below the tabs and above the file list. Remove that line; the repo header (`Repo.jsx` `repo-header`, below owner/repo) already carries the `{branch} @ {sha}` pill — that stays the single place for it. Per the request: drop the entry count and don't re-state the branch name (the breadcrumb already shows the ref). If `t().sha` on a subpath differs meaningfully from the header's head sha, keep it as a subtle crumb-adjacent suffix rather than a full line — decide in the change and note it in the PR. ## Acceptance criteria - [ ] Sizes right-aligned, `92b` style everywhere `fmtSize` is used; tests updated, green. - [ ] Modes render as rwx triplets incl. folders (unit-tested); raw mode in tooltip. - [ ] No more meta line above the file list; header pill remains the single branch@sha source. - [ ] `node --test` green; real-browser dark+light check of a tree page with mixed modes (incl. an executable + a subdir); zero console errors; no new deps.
Author
Owner

Starting work: branch fix/tree-polish from origin/main (clean worktree; user worktree left untouched). Plan: fmtSize 92b style, fmtMode helper + tests, Tree meta-line removal, right-aligned size column.

Starting work: branch fix/tree-polish from origin/main (clean worktree; user worktree left untouched). Plan: fmtSize 92b style, fmtMode helper + tests, Tree meta-line removal, right-aligned size column.
Author
Owner

PR #30 opened: #30 (branch fix/tree-polish, from origin/main). All acceptance criteria verified — see PR description for test evidence. Not merging per instructions.

PR #30 opened: https://git.packden.us/crueber/walhub/pulls/30 (branch fix/tree-polish, from origin/main). All acceptance criteria verified — see PR description for test evidence. Not merging per instructions.
Author
Owner

Follow-up on top of fix/tree-polish (ccf88d4): dropped the Breadcrumb head link in Tree.jsx — at repo root no breadcrumb renders at all, on subpaths only the path segments render (e.g. sub / dir). Blob.jsx carried its own copy of the same pattern and got the identical removal for consistency. Verified: node --test web/test/unit/*.test.js green (184 pass, incl. new breadcrumb-head regression test), plus a headless-Chromium drive (dark + light) confirming root shows no crumb line, subpath tree shows sub / dir, blob shows sub / dir / file.txt, zero console errors.

Follow-up on top of fix/tree-polish (ccf88d4): dropped the Breadcrumb head link in Tree.jsx — at repo root no breadcrumb renders at all, on subpaths only the path segments render (e.g. `sub / dir`). Blob.jsx carried its own copy of the same pattern and got the identical removal for consistency. Verified: `node --test web/test/unit/*.test.js` green (184 pass, incl. new breadcrumb-head regression test), plus a headless-Chromium drive (dark + light) confirming root shows no crumb line, subpath tree shows `sub / dir`, blob shows `sub / dir / file.txt`, zero console errors.
Author
Owner

Breadcrumb corrected on fix/tree-polish (8dd0eff): first crumb is now a link to /{owner}/{repo} labeled literally root — never the branch name, so no duplication with the header branch@sha pill. Root shows just root; subpaths show root / sub / dir (root+intermediates linked, final strong). Blob keeps rev for subpath hrefs. Verified: node --test 184/184 green; headless-Chrome CDP drive of root tree, subpath tree, and blob on the rebuilt compose stack with zero console/page errors.

Breadcrumb corrected on fix/tree-polish (8dd0eff): first crumb is now a link to /{owner}/{repo} labeled literally root — never the branch name, so no duplication with the header branch@sha pill. Root shows just root; subpaths show root / sub / dir (root+intermediates linked, final strong). Blob keeps rev for subpath hrefs. Verified: node --test 184/184 green; headless-Chrome CDP drive of root tree, subpath tree, and blob on the rebuilt compose stack with zero console/page errors.
Author
Owner

Breadcrumb refinement landed on fix/tree-polish (689a52a): Tree/Blob nav.crumbs now wrapped in 0}> — repo root renders no breadcrumb nav, subpaths keep root / sub / dir. node --test web/test/unit/*.test.js: 184 pass. Verified against rebuilt standalone stack: root resolve path="" (guard false), subpath path="sub" (guard true), deployed bundle contains the guard in both Breadcrumb fns. No headed-browser run in this env (no chrome system libs, no sudo); headed check still open if you want it.

Breadcrumb refinement landed on fix/tree-polish (689a52a): Tree/Blob nav.crumbs now wrapped in <Show when={parts().length > 0}> — repo root renders no breadcrumb nav, subpaths keep root / sub / dir. node --test web/test/unit/*.test.js: 184 pass. Verified against rebuilt standalone stack: root resolve path="" (guard false), subpath path="sub" (guard true), deployed bundle contains the guard in both Breadcrumb fns. No headed-browser run in this env (no chrome system libs, no sudo); headed check still open if you want it.
Author
Owner

Review of PR #30 (fix/tree-polish, 4 commits aec3780..689a52a) — CLEAN, no fixes pushed.

Checked against the final contract (no breadcrumb at repo root; below root 'root / sub / dir', root first, never the branch name, Tree+Blob):

  • fmtSize: 'b' suffix, no space (0b/92b/1023b; k/MB/GB unchanged) in web/src/lib/format.js:9-21; only fmtSize call sites are Tree entry sizes + Blob header/too-large/binary — all pick it up. No stale ' B' spellings in web/test (grep clean). fmtBytes in Repo.jsx keeps its own KiB style — separate helper for Release/Settings/Wal pages, explicitly out of scope per PR desc. OK.
  • fmtMode: table + low-9-bits fallback + blank-on-missing in format.js:27-57; gitlink 160000->m--------- decided and documented in code comment + docs/go/12_web_ui.md:405 (law 12 satisfied). Raw octal in title (Tree.jsx:67 title={e.mode ?? undefined}); folders use the same cell, blank when omitted. OK.
  • Right-align: text-right on th + td (Tree.jsx:52,68); 'tabular' class is the project's tabular-nums alias (web/src/ui.css:76 .tabular { @apply tabular-nums }) so 'tabular-nums kept' in the doc is accurate. OK.
  • Meta line gone, no sha suffix anywhere; Repo.jsx header pill untouched (not in diff) — single source. The doc records the no-suffix rationale. OK.
  • Breadcrumb final contract: Tree.jsx:13-36 + Blob.jsx:18-41 both guard with 0}> (root renders no nav), first crumb is literal 'root' linked to /{full}, no props.head references and no head= at call sites (grep clean), separators ' / ', final segment . Blob keeps rev (shortRef(props.rev) for subpath hrefs, rev={} passed at Blob.jsx:68). shortRef imports still used (treeRest/rawHref) — no dead code. OK.
  • Tests pin final behavior: format.test.js (b-style + all six mode mappings + fallback/blank) and breadcrumb-head.test.js (root-first, no head, empty-path guard, Blob rev). No intermediate-iteration artifacts. No new deps (package.json/pnpm-lock untouched), no TS, touched markup keeps dark: variants.
  • Verified in scratch worktree /tmp/pr30 (detached 689a52a, since removed; main worktree untouched): node --test web/test/unit/*.test.js -> 184 pass / 0 fail; pnpm run build (vite + esbuild) clean.

MERGE RECOMMENDATION: ready to merge (not merging per instructions). Browser dark+light evidence is the author's claimed headless-Chromium drives in issues #29 comments 392/395/398; I did not re-drive a browser in this pass.

Review of PR #30 (fix/tree-polish, 4 commits aec3780..689a52a) — CLEAN, no fixes pushed. Checked against the final contract (no breadcrumb at repo root; below root 'root / sub / dir', root first, never the branch name, Tree+Blob): - fmtSize: 'b' suffix, no space (0b/92b/1023b; k/MB/GB unchanged) in web/src/lib/format.js:9-21; only fmtSize call sites are Tree entry sizes + Blob header/too-large/binary — all pick it up. No stale ' B' spellings in web/test (grep clean). fmtBytes in Repo.jsx keeps its own KiB style — separate helper for Release/Settings/Wal pages, explicitly out of scope per PR desc. OK. - fmtMode: table + low-9-bits fallback + blank-on-missing in format.js:27-57; gitlink 160000->m--------- decided and documented in code comment + docs/go/12_web_ui.md:405 (law 12 satisfied). Raw octal in title (Tree.jsx:67 title={e.mode ?? undefined}); folders use the same cell, blank when omitted. OK. - Right-align: text-right on th + td (Tree.jsx:52,68); 'tabular' class is the project's tabular-nums alias (web/src/ui.css:76 .tabular { @apply tabular-nums }) so 'tabular-nums kept' in the doc is accurate. OK. - Meta line gone, no sha suffix anywhere; Repo.jsx header pill untouched (not in diff) — single source. The doc records the no-suffix rationale. OK. - Breadcrumb final contract: Tree.jsx:13-36 + Blob.jsx:18-41 both guard with <Show when={parts().length > 0}> (root renders no nav), first crumb is literal 'root' linked to /{full}, no props.head references and no head= at call sites (grep clean), separators ' / ', final segment <strong>. Blob keeps rev (shortRef(props.rev) for subpath hrefs, rev={} passed at Blob.jsx:68). shortRef imports still used (treeRest/rawHref) — no dead code. OK. - Tests pin final behavior: format.test.js (b-style + all six mode mappings + fallback/blank) and breadcrumb-head.test.js (root-first, no head, empty-path guard, Blob rev). No intermediate-iteration artifacts. No new deps (package.json/pnpm-lock untouched), no TS, touched markup keeps dark: variants. - Verified in scratch worktree /tmp/pr30 (detached 689a52a, since removed; main worktree untouched): node --test web/test/unit/*.test.js -> 184 pass / 0 fail; pnpm run build (vite + esbuild) clean. MERGE RECOMMENDATION: ready to merge (not merging per instructions). Browser dark+light evidence is the author's claimed headless-Chromium drives in issues #29 comments 392/395/398; I did not re-drive a browser in this pass.
Author
Owner

Fixed by PR #30 (review clean, no findings; 184/184 node tests), merged. Closing.

Fixed by PR #30 (review clean, no findings; 184/184 node tests), merged. Closing.
crueber added this to the v1 milestone 2026-09-10 22:27:23 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
crueber/walhub#29
No description provided.