test(format): verify title column grows dynamically to fit wide titles#328
Merged
barrettruth merged 1 commit intomainfrom Apr 19, 2026
Merged
test(format): verify title column grows dynamically to fit wide titles#328barrettruth merged 1 commit intomainfrom
barrettruth merged 1 commit intomainfrom
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.