You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(cli): allocate table columns by water-fill, not proportionally (#54)
When a Markdown table had one very wide column (e.g. `Description`,
`Remediation`) next to several narrow ones (`CWE`, `Severity`), the
old allocator distributed the terminal budget proportionally to each
column's natural width. The narrow columns therefore received more
space than they could ever use, while the wide column had to wrap
across many rows. As the terminal was resized, columns alternated
between "just wide enough" and "wrapping heavily" in a pattern that
felt like the fix kept toggling on and off.
Replace that pass with classic water-filling: sort columns by natural
width ascending and, for each in turn, give it the smaller of its
natural width and a fair share of the remaining budget. Narrow columns
settle early with exactly what they need; all leftover budget rolls
over to the wide columns. Result: `CWE` gets 7 cols, `Severity` gets
8, and `Description` absorbs everything else, no matter how the
terminal is resized.
Added two tests:
- `water_fill_narrow_columns_do_not_hoard` — regression for the exact
SEC-doc table layout the user reported.
- `water_fill_tight_budget_does_not_overflow` — ensures the total
content width never exceeds the budget even when the sum of naturals
does, and no column is inflated past its natural.
Bump CLI to 3.2.5.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,13 @@ and this project uses [independent versioning](README.md#versioning) for Framewo
7
7
8
8
---
9
9
10
+
## CLI 3.2.5 — Smarter Table Column Allocation in `explore`
11
+
12
+
### Fixed (CLI)
13
+
- Table column widths in `devtrail explore` are now allocated with a water-fill strategy: narrow columns (e.g. `CWE`, `Severity`) receive exactly their natural width and the excess flows to the columns that need it (e.g. `Description`, `Remediation`). Previously, a proportional pass gave every column a slice of the terminal budget regardless of need, which caused the narrow columns to hoard space and the wide ones to wrap unnecessarily. This is what produced the "fixes itself, breaks, fixes itself again" behavior users saw while resizing the terminal.
14
+
15
+
---
16
+
10
17
## CLI 3.2.4 — Unicode-Safe Rendering Across TUI and Commands
0 commit comments