Skip to content

fix(display): tighten commit-output file-stats footer - #142

Merged
CaicoLeung merged 3 commits into
mainfrom
feature/commit-ui-enhancement
Aug 15, 2026
Merged

fix(display): tighten commit-output file-stats footer#142
CaicoLeung merged 3 commits into
mainfrom
feature/commit-ui-enhancement

Conversation

@CaicoLeung

Copy link
Copy Markdown
Owner

What

Two footer fixes for the landed commit output (and its confirm-mode preview, which shares emit_file_stats):

  1. Suppress zero per-file counts (6c8b541) — a file with +0 or −0 rendered a noise +0/−0 column. Now the zero column renders blank, matching git diff --stat (which never shows zeros). The Σ total row keeps both totals even at zero, like git's own summary line. Column-width math is unchanged — the grid was already sized to the totals, so geometry is stable.
  2. Drop the duplicate file count in the elision line (079e216) — … N more (N files) said the same number twice; now just … N more.

Deliberately not included

The exploratory spacing work from this branch (blank row between batch blocks, blank line between subject and body) was dropped after review — the landed output stays compact with no blank separation between the [n/m] row and the commit contents:

  [1/1] ✓ f67146e feat: add tracked scratch line
    +1 −1  tracked.txt
    +3     other.txt   [new]
  Σ +4 −1  (2 files)

Verification

  • cargo test — 417 passed / 0 failed
  • cargo fmt --all -- --check — clean
  • cargo clippy --all-targets -- -D warnings — clean
  • Byte-level PTY capture of the real binary confirms the landed shape above

Per-file +0/−0 counts now render as an empty column, matching git diff --stat which never shows zeros; the Σ total row still keeps both totals. Styling empty strings is skipped to avoid stray ANSI escapes mid-line.
The Σ total row already shows the total file count, so the ellipsis line now only says how many rows were cut.
@CaicoLeung
CaicoLeung merged commit 800769e into main Aug 15, 2026
9 checks passed
@CaicoLeung
CaicoLeung deleted the feature/commit-ui-enhancement branch August 15, 2026 18:42
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