Skip to content

feat(picker): add Open Board button to the agent picker#3498

Merged
Sayt-0 merged 2 commits into
docker:mainfrom
dgageot:agent-picker-open-board
Jul 7, 2026
Merged

feat(picker): add Open Board button to the agent picker#3498
Sayt-0 merged 2 commits into
docker:mainfrom
dgageot:agent-picker-open-board

Conversation

@dgageot

@dgageot dgageot commented Jul 7, 2026

Copy link
Copy Markdown
Member

The agent picker (--agent-picker) had no way to reach the Kanban board without first running an agent. Users who want to review the board before selecting an agent had to exit and run a separate command.

Pressing b or clicking the new [ Open Board ] button in the picker now launches docker agent board directly. A errAgentPickerStartBoard sentinel is returned from the picker, and run.go handles it by calling boardtui.Run with the appropriate board telemetry — keeping all board-start logic in one place. Hit-zone math is factored into a shared bottomRowY() helper alongside the existing lean checkbox, panelSize() accounts for the extra width of the bottom row, and header lines are truncated on narrow terminals so mouse hit-testing stays correct regardless of terminal width. Tests cover the key press, click hit-zone boundaries, windowed list scrolling, narrow widths, and the details dialog intercepting b.

@dgageot dgageot requested a review from a team as a code owner July 7, 2026 09:21

@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: 🟡 NEEDS ATTENTION

One medium-severity finding: the new narrow-terminal truncation guard protects subtitle and help but leaves the title untruncated.

Comment thread cmd/root/agent_picker.go
// below it and break the row-based mouse hit-testing.
if m.width > 0 {
maxWidth := max(m.width-2*(1+4), agentPickerMinCardWidth)
subtitleText = toolcommon.TruncateText(subtitleText, maxWidth)

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.

[MEDIUM] Title line not truncated on narrow terminals, potentially breaking hit-zone math

The headerText() function truncates subtitleText and helpText to maxWidth = max(m.width-2*(1+4), agentPickerMinCardWidth) on narrow terminals — but the title ("Choose an agent to run", 22 visible chars) is rendered without truncation. The comment right above the truncation block explicitly states the reason: "a wrapped line would shift every row below it and break the row-based mouse hit-testing." The title is subject to the same risk.

panelSize() does include lipgloss.Width(title) as a candidate for contentWidth, so the panel is computed wide enough to hold the title. However, if the terminal is narrower than the computed panel width (i.e. < 32 columns), lipgloss renders the panel at its full computed width, which may exceed the terminal width. Whether the title wraps or clips depends on the renderer, but the omission is inconsistent with the intent of the new truncation block — subtitle and help are explicitly protected while title is not.

Suggested fix — apply the same guard inside the if m.width > 0 block:

title = toolcommon.TruncateText(
    styles.HighlightWhiteStyle.Render("Choose an agent to run"),
    maxWidth,
)

Or truncate the raw string before rendering, matching the subtitle/help pattern.

@aheritier aheritier added area/cli CLI commands, flags, output formatting area/docs Documentation changes 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 7, 2026
@Sayt-0 Sayt-0 merged commit 226956d into docker:main Jul 7, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cli CLI commands, flags, output formatting area/docs Documentation changes 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.

4 participants