Skip to content

feat(desktop): add search to the channel Add agents dialog - #8026

Draft
tomdmeredith wants to merge 1 commit into
block:mainfrom
tomdmeredith:feat/add-agents-dialog-search
Draft

tomdmeredith wants to merge 1 commit into
block:mainfrom
tomdmeredith:feat/add-agents-dialog-search

Conversation

@tomdmeredith

Copy link
Copy Markdown

Summary

Adds a search box to the channel "Add agents" dialog (AddChannelBotDialog), pinned under the title so it stays put while the list scrolls. It uses the same modal search shell as the members sidebar and channel browser.

  • Agent rows narrow by name, description and system prompt; team chips narrow by team name/description or when any member persona matches, so searching for one agent still surfaces the team that would add it.
  • Selection is keyed on the full list, so agents ticked before a search stay selected while hidden and the Add button reflects them.
  • Escape clears an active search before the next Escape closes the dialog. This is handled on the dialog's onEscapeKeyDown because Radix's dismiss listener runs on the document in the capture phase, ahead of any input handler.
  • "No agents match your search." appears only when neither an agent nor a team matches, so it never contradicts a visible team chip. The "Create a new agent" row stays at the bottom while searching instead of jumping. The box resets on close.
  • ChooserDialogContent gains an optional headerAccessory slot rendered full-width under the header; existing callers are unchanged.
  • Deliberate choices, open to discussion: system prompts are searched with a plain substring match (same corpus as feat(desktop): add search and status filter to the Agents page #8001, and the reason the feature was asked for), so very short queries narrow slowly; a ticked agent hidden by the search is still added, which the footer count reflects.
  • The ~15-line term matcher mirrors one on feat(desktop): add search and status filter to the Agents page #8001. The two PRs are independent so they can land in either order; whichever lands second will fold the matcher into a shared helper.

Independent of #8001 (Agents page search), so the two can land in either order. Closes #8003. Duplicates: none found in open issues or PRs.

Test plan

Automated (run locally):

  • desktop/src/features/agents/lib/personaChooserSearch.test.mjs: query tokenization and AND matching, persona fields, team matching via own text and via members, and orphaned member ids.
  • desktop/tests/e2e/channels.spec.ts "add agents dialog search narrows agents and teams": binds the box by its accessible name and checks autofocus, searches by system-prompt text, checks a prior selection survives narrowing, a team-only hit is not an empty state, the empty state, Escape-to-clear then Escape-to-close, and that cancelling with a query still typed reopens with an empty box.
  • Existing channels intro-action and tooltip specs pass; pnpm typecheck, pnpm check, pnpm test green.

Manual steps for the human check:

  1. Open a channel and click "Add agent" (intro action or members bar).
  2. Type part of an agent's name; confirm only matching agents and their teams remain.
  3. Type a phrase that appears only in one agent's instructions; confirm that agent is found.
  4. Tick an agent, then search for something else; confirm the Add button still counts it.
  5. Press Escape once with text in the box (box clears, dialog stays), then again (dialog closes). Reopen and confirm the box is empty.

🤖 Generated with Claude Code

Pin a search box under the dialog title using the same modal search shell
as the members sidebar and channel browser. It narrows the agent rows by
name, description and system prompt, and the team chips by team text or
any matching member, so searching for one agent still surfaces the team
that would add it. Selections survive narrowing, Escape clears an active
search before the next one closes the dialog, and the box resets when the
dialog closes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Tom Meredith <tom.d.meredith@gmail.com>
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is d56ed75424d803cf29b2f1f4f430ee81dc145f92...4f579d79e54d60be6fc0ad47c2b920f3f3ea8b59.
A new review must complete for this exact range. When manual authorization
is required, a user with write access must comment exactly
@buzz-security-review 4f579d79e54d60be6fc0ad47c2b920f3f3ea8b59 to authorize a new review.
Any previous review applies only to its recorded range.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant