Skip to content

feat: show metadata tags as coloured chips in the agent picker#3394

Open
dgageot wants to merge 3 commits into
docker:mainfrom
dgageot:worktree-board-18273bcf771f748f
Open

feat: show metadata tags as coloured chips in the agent picker#3394
dgageot wants to merge 3 commits into
docker:mainfrom
dgageot:worktree-board-18273bcf771f748f

Conversation

@dgageot

@dgageot dgageot commented Jul 1, 2026

Copy link
Copy Markdown
Member

The agent picker previously showed only the agent's name and description. Now that agents can carry metadata.tags, it makes sense to surface them visually so users can glance at an agent's purpose without reading the full description.

Tags are rendered as coloured #tag chips on each picker card using a rotating palette, width-clamped so they never overflow the card. The picker itself has been given more breathing room — cards are 70 columns wide, titles have a blank line before the subtitle, and panel padding is roomier. The YAML details dialog grows to 110×36 (still clamped to the terminal) and now truncates long lines instead of wrapping them, which keeps instruction-heavy configs from inflating the view height; horizontal scrolling remains available. The details panel's bottom status bar now matches the picker's muted style. The two built-in agents (default, coder) have been tagged with general/assistant and coding/agentic respectively. Mouse hit-testing math (cardAt, panelSize) has been kept in sync with the layout changes, and new unit tests cover tag rendering and the no-panic path with tagged agents.

No breaking changes; the tags field is optional and the picker degrades cleanly when no tags are present.

dgageot added 3 commits July 1, 2026 19:42
Adds a tags field to agentChoice, renders them as #tag chips with a
rotating colour palette, and widens the card layout to accommodate the
extra row. Includes tests and tags for the built-in agents.

Assisted-By: claude-sonnet-4-5
@dgageot dgageot requested a review from a team as a code owner July 1, 2026 17:51

@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 tag-chip rendering, layout math, mouse hit-testing, and test coverage all look correct. No bugs were found in the changed code. One minor cosmetic note is left as an inline comment.

Comment thread cmd/root/agent_picker.go
break
}
used += sep + lipgloss.Width(label)
style := tagChipStyles[i%len(tagChipStyles)]

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.

[LOW] Tag chip palette index counts skipped blank tags, causing minor colour inconsistency

renderTags uses the raw loop index i to choose a colour from tagChipStyles[i%len(tagChipStyles)], but blank/whitespace-only tags are continued before any chip is rendered. When a blank tag appears mid-slice the visible chips' colours skip a palette slot, so an agent whose tags include an empty string will show a different colour sequence than an identical agent whose tags list had no blanks. In practice the built-in agents have clean tags, so this is cosmetic only — but if tags come from user-supplied YAML it could produce subtly unexpected colouring. A trivial fix is to increment a separate chipCount variable only when a chip is actually rendered and use that for the modulo.

@aheritier aheritier added area/config For configuration parsing, YAML, environment variables 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config For configuration parsing, YAML, environment variables 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.

3 participants