Skip to content

test(format): verify title column grows dynamically to fit wide titles#328

Merged
barrettruth merged 1 commit intomainfrom
fix/verify-dynamic-widths
Apr 19, 2026
Merged

test(format): verify title column grows dynamically to fit wide titles#328
barrettruth merged 1 commit intomainfrom
fix/verify-dynamic-widths

Conversation

@barrettruth
Copy link
Copy Markdown
Owner

Problem

#325 asks to verify that dynamic title widths still work after `display.widths` was removed from config in #326. The change hardcoded the preferred values (45/15/35/25) at the `format.lua` call sites but did not touch the elastic-width layout logic, so growth-to-fit should still happen. Nothing in the existing spec suite proves that end of the range — `format_prs` only had a narrow-layout truncation test.

Solution

Add a regression test that hands `format_prs` a long-titled PR and a 200-column budget, and asserts the rendered title contains the full original text with no truncation marker. This demonstrates that `layout.plan`'s `grow_once` phase still expands the title column up to `column.max` (set from `layout.measure`'s observed max) when space allows. Pairs with the existing "drops secondary metadata before the primary title in narrow layouts" test so both elastic ends are covered.

Closes #325.

Removing display.widths from config in #326 did not change the
elastic-width layout logic: the 45 hardcoded at the format.lua call
sites is a soft cap on the column's INITIAL preferred width, and the
actual column.max is data-driven (stats.max from layout.measure).
layout.plan's grow_once phase then expands the column up to that
data-driven max when budget allows.

Add a regression test that hands format_prs a single pull request
with a title longer than 45 chars and a wide (200-column) budget,
asserts the rendered title is untruncated, and thus demonstrates
dynamic growth. Complements the existing narrow-layout truncation
test (format_prs 'drops secondary metadata before the primary title
in narrow layouts') so both ends of the elastic range are covered.

Closes #325
@barrettruth barrettruth merged commit 0226a0b into main Apr 19, 2026
1 check passed
@barrettruth barrettruth deleted the fix/verify-dynamic-widths branch April 19, 2026 04:50
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.

ensure dynamic title widths work (was removed from config)

1 participant