feat: show metadata tags as coloured chips in the agent picker#3394
feat: show metadata tags as coloured chips in the agent picker#3394dgageot wants to merge 3 commits into
Conversation
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
Assisted-By: Claude
docker-agent
left a comment
There was a problem hiding this comment.
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.
| break | ||
| } | ||
| used += sep + lipgloss.Width(label) | ||
| style := tagChipStyles[i%len(tagChipStyles)] |
There was a problem hiding this comment.
[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.
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
#tagchips 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 withgeneral/assistantandcoding/agenticrespectively. 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.