Fix #211: ls-style file list #219

Merged
crueber merged 1 commit from fix/issue-211 into main 2026-09-08 22:24:29 +00:00
Owner

Implements #211: the Code tab file list becomes ls -la-style columns [mode] [size-num] [size-unit] [type] [name] -> [last modified, right-aligned].

Decisions (law 12, also documented in code comments):

  • Mode lead char: . file / d dir / l symlink / m submodule (issue examples .rw-rw-r-- / drwxrwxr-x, eza-style). The #29 m--------- glyph already reads as lead-m + nine no-bits dashes, so submodules are unchanged. Canonical modes decide alone; the ls-tree type only disambiguates non-canonical fallback strings.
  • Size units: uppercase B/KB/MB/GB/… over 1024-steps per the issue examples (414 B, 17 KB, 18 MB — NOT SI/decimal). fmtSize keeps its #27/#29 lowercase single-string form for inline call sites; both share one ladder (scaleSteps) so they cannot drift.
  • Type column is a text label (file/dir/symlink/submodule; mode decides symlink+submodule since ls-tree reports them as blob/commit); the existing file/folder icon cell is kept as a scan aid.
  • NO owner/group columns (screenshot shows them; issue text does not ask). NO font change. Name links, server sorting (dirs-first, byte order), dotfile display unchanged.
  • DATETIME (load-bearing): git trees carry no mtime and TreeResult.commit is never populated server-side, so per-file last-touch would cost one log -1 -- <path> per row (N+1, unbounded) — deliberately not done. Every row shares the containing commit's stamp via one extra commits?n=1 at the resolved sha (immutable, Infinity cache, shared across dir navigations); rows paint from the tree payload first and date cells fill in when it lands — first paint never blocked. Rendered with the #133 DateTime component (relative text + local wall-time title).
  • No backend change (the commits endpoint already exists); no new deps (law 1).

Verification:

  • node --test web/test/unit/*.test.js: 423/423 pass (format.test.js holds the new mode/size-split/kind contracts and pins fmtSize unchanged; date-source helper latestActivity covered by activity.test.js).
  • pnpm --dir web run build: clean (vite + esbuild SDK).
  • Real browser (hub CDP daemon, seeded repo with dir/exec/symlink/submodule/dotfile/KB+MB files): both themes render the new columns, zero console errors. Screenshots: light + dark verified.
  • Go gates N/A (no Go touched).
Implements #211: the Code tab file list becomes ls -la-style columns [mode] [size-num] [size-unit] [type] [name] -> [last modified, right-aligned]. Decisions (law 12, also documented in code comments): - Mode lead char: `. file / d dir / l symlink / m submodule` (issue examples `.rw-rw-r--` / `drwxrwxr-x`, eza-style). The #29 `m---------` glyph already reads as lead-`m` + nine no-bits dashes, so submodules are unchanged. Canonical modes decide alone; the ls-tree `type` only disambiguates non-canonical fallback strings. - Size units: uppercase `B/KB/MB/GB/…` over 1024-steps per the issue examples (`414 B`, `17 KB`, `18 MB` — NOT SI/decimal). `fmtSize` keeps its #27/#29 lowercase single-string form for inline call sites; both share one ladder (`scaleSteps`) so they cannot drift. - Type column is a text label (file/dir/symlink/submodule; mode decides symlink+submodule since ls-tree reports them as blob/commit); the existing file/folder icon cell is kept as a scan aid. - NO owner/group columns (screenshot shows them; issue text does not ask). NO font change. Name links, server sorting (dirs-first, byte order), dotfile display unchanged. - DATETIME (load-bearing): git trees carry no mtime and TreeResult.commit is never populated server-side, so per-file last-touch would cost one `log -1 -- <path>` per row (N+1, unbounded) — deliberately not done. Every row shares the containing commit's stamp via one extra `commits?n=1` at the resolved sha (immutable, Infinity cache, shared across dir navigations); rows paint from the tree payload first and date cells fill in when it lands — first paint never blocked. Rendered with the #133 DateTime component (relative text + local wall-time title). - No backend change (the commits endpoint already exists); no new deps (law 1). Verification: - `node --test web/test/unit/*.test.js`: 423/423 pass (format.test.js holds the new mode/size-split/kind contracts and pins fmtSize unchanged; date-source helper latestActivity covered by activity.test.js). - `pnpm --dir web run build`: clean (vite + esbuild SDK). - Real browser (hub CDP daemon, seeded repo with dir/exec/symlink/submodule/dotfile/KB+MB files): both themes render the new columns, zero console errors. Screenshots: light + dark verified. - Go gates N/A (no Go touched).
Tree table becomes [mode] [size-num] [size-unit] [type] [name] -> [last modified]:
- format.js: fmtMode gains the leading type char (. file / d dir / l symlink /
  m submodule; the #29 m--------- glyph already reads as lead-m + no-bits);
  new fmtSizeParts shares fmtSize's 1024 ladder (B/KB/MB per the issue
  examples; fmtSize output byte-identical); new entryKind labels the type
  column (mode decides symlink/submodule, ls-tree types lie).
- Tree.jsx: split size cells, type label (icons kept), datetime column via
  one extra commits?n=1 at the resolved sha (Infinity cache, never blocks
  first paint) rendered with the #133 DateTime component. No backend change:
  git trees carry no mtime; per-file last-touch would be N+1, so every row
  shares the containing commit's stamp (documented in code).
- format.test.js: new contract for the 10-char modes, size splits, kinds;
  fmtSize pinned unchanged. No owner/group columns, no font change.
Sign in to join this conversation.
No description provided.