Skip to content

feat(tui): use spare width before packing columns; drop [*] marker (T18) - #92

Merged
TimelordUK merged 2 commits into
mainfrom
feat/t18-column-fit
Sep 19, 2026
Merged

TimelordUK merged 2 commits into
mainfrom
feat/t18-column-fit

Conversation

@TimelordUK

Copy link
Copy Markdown
Owner

Summary

  • Column widths now fill the screen before compacting. The width calculator never knew the table width, so on data/shapes.csv (long names over 1–4 character values) Balanced mode squeezed every header while more than 60% of the screen sat empty. update_terminal_size now gives the calculator a width budget. After mode-based packing, expand_into_spare_width gives leftover space to truncated columns, smallest shortfall first, which completes as many columns as possible. Tables that already overflow keep the packed layout. This replaces the old calculate_with_terminal_width code, which widened columns to at most 15.
  • The sorted column's header width now includes its ↑/ ↓ arrow (SORT_INDICATOR_WIDTH).
  • Removed the [*] selected-column marker. It was never budgeted for, so it usually showed as a stray [. The selected column is already yellow and underlined.
  • Logged as T18 in docs/TUI_FEATURES.md. The unbudgeted 📌 pin prefix is recorded there as a loose end.

Test plan

  • New unit tests: a wide budget shows full headers; a partial budget finishes the nearest columns first; an overflowing table stays packed; the sorted column makes room for its arrow
  • cargo test: 834 lib and 501 integration tests pass
  • Checked by hand on data/shapes.csv

🤖 Generated with Claude Code

TimelordUK and others added 2 commits September 19, 2026 15:07
The column width calculator never knew the table width, so Balanced
packing squeezed long headers (e.g. data/shapes.csv) to ~1.5x their
data width while most of the screen sat empty. The calculator now gets
a width budget from update_terminal_size; after mode-based packing,
leftover space goes to truncated columns, smallest shortfall first.
Tables that already overflow keep the packed layout.

The sorted column's header width now includes its arrow suffix.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The marker cost header width the calculator never budgeted for, so it
usually rendered as a stray '['. The selected column is already shown
by yellow underlined styling.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@TimelordUK
TimelordUK merged commit 9c24f73 into main Sep 19, 2026
8 checks passed
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