Skip to content

feat: collapse file picker shortcuts to one line on wide dialogs#3366

Merged
Sayt-0 merged 2 commits into
docker:mainfrom
dgageot:worktree-board-0cbb173faa0cd1aa
Jul 1, 2026
Merged

feat: collapse file picker shortcuts to one line on wide dialogs#3366
Sayt-0 merged 2 commits into
docker:mainfrom
dgageot:worktree-board-0cbb173faa0cd1aa

Conversation

@dgageot

@dgageot dgageot commented Jul 1, 2026

Copy link
Copy Markdown
Member

The /attach file 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 helpKeysLine helper was extracted in pkg/tui/dialog/base.go so that RenderHelpKeys and HelpKeysWidth share the same formatting logic instead of duplicating it.

@dgageot dgageot requested a review from a team as a code owner July 1, 2026 11:49

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@aheritier aheritier added area/tui For features/issues/fixes related to the TUI kind/feat PR adds a new feature (maps to feat:). Use on PRs only. labels Jul 1, 2026
@Sayt-0 Sayt-0 merged commit 6cbf6d3 into docker:main Jul 1, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tui For features/issues/fixes related to the TUI kind/feat PR adds a new feature (maps to feat:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants