Repository navigation
fix: prevent Branch column from being dropped on narrow terminals - #1626
Merged
Merged
Conversation
The column allocator used all-or-nothing allocation: if a column's ideal width (longest branch name) didn't fit, the column was dropped entirely. This caused Branch names to disappear on narrow terminals or in the picker's side-by-side layout. Add a `shrinkable` flag to ColumnSpec. Shrinkable columns gracefully degrade to whatever width is available (down to header width) instead of disappearing. Only Branch uses this flag — keeping the change minimal while the mechanism is general enough for future use. Closes #1563 (column allocation aspect) Co-Authored-By: Claude Opus 4.6 <[email protected]>
worktrunk-bot
commented
Mar 19, 2026
worktrunk-bot
left a comment
Collaborator
Author
There was a problem hiding this comment.
CI is failing due to clippy::collapsible_if — the nested if let + if should be collapsed. Pushing a fix.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
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.
Summary
shrinkableflag toColumnSpec— shrinkable columns degrade gracefully to whatever width fits (down to header width) instead of being dropped entirely when their ideal width doesn't fitBranchas the only shrinkable column, so branch names are always visible even on narrow terminals or in the picker's side-by-side layoutBefore: On a 60-column terminal with Right layout (30 cols for list), if the longest branch name exceeded ~26 chars, the Branch column was dropped entirely — showing Status/HEAD± columns instead, which is what @armstrjare's screenshot in #1564 showed.
After: Branch shrinks to fit the available space, truncated with
…by the existingtruncate_visible()renderer. Branch names are always visible.Test plan
test_try_allocate_with_min_width— verifies ideal→min fallback behaviortest_branch_column_never_dropped— verifies Branch is present at 30 cols with a long branch namemain(not introduced by this PR)Spun off from discussion in #1564 (comment by @max-sixty).
🤖 Generated with Claude Code