feat: per-section +/- totals and spacing on panel headers - #26
Conversation
Pin each section's aggregate additions/deletions on its header row (Staged/Unstaged/Untracked), in the same content column as the per-file counts and the --stat help-line total, so a section's weight reads at a glance. Totals are summed fold-independently, matching the existing global --stat sums. Separate consecutive sections with a blank line so headers don't butt up against the previous section's files; the first section is skipped since it already follows the top header's blank. The horizontal (top/bottom) panel width-fit now accounts for a header's aggregate width so a wide "+N -M" can't clip off the edge.
|
On the demo recording: CONTRIBUTING asks that visible/panel changes re-record |
…off by default) The per-section +/- header totals are now opt-in via panel.section_diffstat, defaulting off. The header block only carries its add/del totals when enabled; the width reserve and virt_text extmark already guard on the totals, so a nil suppresses the aggregate and the header renders plain.
|
can we split the settings up by panel.section_diffstat and panel.section_separator so they're settable independently? also would be nicer i think if separator was a union, so it could potentially expand in the future (other separator styles) rather than locking in now into a on/off |
Adds a per-section diffstat aggregate to the file panel's section headers and a blank-line separator between sections.
Section aggregate. Each section header (Staged/Unstaged/Untracked) now shows its total
+A -B, pinned to the same content column as the per-file counts and the--stathelp-line total, so a section's weight reads at a glance. Totals are summed fold-independently, matching the existing global--statsums. Empty/zero-count sections show nothing.Spacing. Consecutive sections are separated by a blank line so a header doesn't butt up against the previous section's files. The first section is skipped (it already follows the top header's blank), and the top/bottom panel width-fit accounts for a header's aggregate width so a wide
+N -Mcan't clip.Tests. Added unit coverage (
panel_render_spec) for the header aggregate and the section separator; updated the onepanel_specfold test that hard-coded the old layout.Ran
make lintandmake lua-typecheckclean locally.Open questions for the maintainer:
───rule — I went with the blank line (lighter in a narrow panel, no new highlight group). Happy to switch.panelconfig flag, or always on?