Skip to content

Fix sidebar agent click zones mapping all lines to first agent#2402

Merged
trungutt merged 1 commit intodocker:mainfrom
dgageot:board/agent-sidebar-click-bug-report-39c63441
Apr 13, 2026
Merged

Fix sidebar agent click zones mapping all lines to first agent#2402
trungutt merged 1 commit intodocker:mainfrom
dgageot:board/agent-sidebar-click-bug-report-39c63441

Conversation

@dgageot
Copy link
Copy Markdown
Member

@dgageot dgageot commented Apr 13, 2026

Problem

Clicking on an agent in the sidebar always switched to the first agent, regardless of which agent was clicked.

Root Cause

buildAgentClickZones used lipgloss.Width(lines[i]) == 0 to detect blank separator lines between agent blocks. However, TabStyle.Width() pads all lines with whitespace, so separator lines had non-zero width. This caused every agent line to be mapped to the first agent.

Fix

Replace the width check with isVisuallyBlank(), which strips ANSI escape codes and checks for whitespace-only content. Added a regression test that verifies clicking on each agent in a multi-agent sidebar correctly identifies the right agent.

buildAgentClickZones used lipgloss.Width()==0 to detect blank separator
lines between agent blocks, but TabStyle.Width() pads all lines with
whitespace, so separator lines had non-zero width. This caused every
agent line to be mapped to the first agent, making clicking on any
agent other than the first one impossible.

Replace the check with isVisuallyBlank() which strips ANSI codes and
checks for whitespace-only content. Add regression test.

Assisted-By: docker-agent
@dgageot dgageot requested a review from a team as a code owner April 13, 2026 15:03
@trungutt trungutt merged commit ded8733 into docker:main Apr 13, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants