feat: collapse file picker shortcuts to one line on wide dialogs#3366
Merged
Conversation
…nd HelpKeysWidth Assisted-By: Claude
docker-agent
reviewed
Jul 1, 2026
docker-agent
left a comment
Contributor
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
The PR cleanly extracts a helpKeysLine helper and uses it to collapse the file picker shortcuts to a single row on wide dialogs. The width threshold logic, split indices (all[:8]/all[8:] correctly splitting 5 key-description pairs as 4+1), and height-stability mechanism (the nil row2 still producing a blank line via a mandatory second AddHelpKeys call) are all correct. No high- or medium-severity bugs were found.
melmennaoui
approved these changes
Jul 1, 2026
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.
The
/attachfile picker dialog always rendered its keyboard shortcuts across two rows at the bottom, regardless of how wide the dialog was. On wider terminals this wasted vertical space and made the dialog taller than necessary.When the dialog is wide enough to fit all shortcuts on a single line, they now render on one row; on narrower dialogs the two-row layout is preserved as a fallback. The dialog height stays stable in both cases, so there is no layout jump when the window is resized across the threshold.
As part of this work, a
helpKeysLinehelper was extracted inpkg/tui/dialog/base.goso thatRenderHelpKeysandHelpKeysWidthshare the same formatting logic instead of duplicating it.