Skip to content

feat(desktop): unify add agent flows - #5015

Merged
tellaho merged 10 commits into
mainfrom
tho/agents-page-adjustments
Aug 7, 2026
Merged

feat(desktop): unify add agent flows#5015
tellaho merged 10 commits into
mainfrom
tho/agents-page-adjustments

Conversation

@tellaho

@tellaho tellaho commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Category: improvement
User Impact: Users can create, discover, and import agents from one consistent Add agent dialog.

Problem: Agent creation, discovery, and import were split across a dropdown and separate dialogs, making the Add agent flow fragmented. The existing E2E suite also continued targeting the deleted dropdown after the flows were unified.

Solution: Route the new-agent card directly into a unified dialog with dedicated Create, catalog, and Import navigation, then update the affected E2E coverage to exercise that interface and its current empty state.

File changes

desktop/src/features/agents/ui/AgentDefinitionDialog.tsx
Supports rendering the agent definition form inside the unified Add agent experience while retaining the standalone dialog behavior.

desktop/src/features/agents/ui/AgentDefinitionDialogShell.tsx
Adds the shared shell used to present agent-definition content consistently in embedded and standalone contexts.

desktop/src/features/agents/ui/AgentDialog.tsx
Passes the revised dialog state and close behavior through the existing agent dialog entry point.

desktop/src/features/agents/ui/AgentsView.tsx
Connects the Agents page to the unified Add agent dialog and opens newly added catalog agents in their profile panel.

desktop/src/features/agents/ui/PersonaCatalogDialog.tsx
Combines catalog browsing, agent creation, and snapshot import behind persistent navigation, including dirty-navigation confirmation.

desktop/src/features/agents/ui/UnifiedAgentsSection.tsx
Replaces the new-agent dropdown with a direct Add agent entry point and adjusts the responsive card grid.

desktop/src/features/agents/ui/personaLibraryCopy.ts
Updates catalog-facing copy for the unified experience.

desktop/src/features/agents/ui/usePersonaActions.ts
Returns the resolved local persona after catalog activation so the caller can open the added agent.

desktop/tests/e2e/agent-readiness-screenshots.spec.ts
Opens the embedded create pane directly for readiness screenshots.

desktop/tests/e2e/agents.spec.ts
Covers unified Create, catalog, and Import navigation and asserts the current shared-agent empty state.

desktop/tests/e2e/global-agent-config-screenshots.spec.ts
Updates global configuration screenshot setup for direct create-pane entry.

desktop/tests/e2e/inline-custom-harness.spec.ts
Updates custom harness setup for the embedded create form.

desktop/tests/e2e/persona-env-vars.spec.ts
Updates environment-variable and model-provider scenarios for direct create-pane entry.

desktop/tests/e2e/persona-model-combobox-screenshots.spec.ts
Updates model combobox screenshot setup for direct create-pane entry.

desktop/tests/e2e/smoke.spec.ts
Updates agent-creation smoke coverage for the unified Add agent dialog.

desktop/tests/e2e/where-to-run-config.spec.ts
Updates provider-selection coverage for the embedded create form.

Reproduction steps

  1. Open the Agents page and select the new-agent card.
  2. Confirm the Add agent dialog opens directly on Create without an intermediate dropdown.
  3. Use the left navigation to browse shared agents and open Import.
  4. Select a catalog agent and confirm the dialog closes and the added agent's profile panel opens.
  5. Run the affected desktop Playwright smoke and integration specs and confirm all scenarios pass.

@tellaho

tellaho commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Screenshot pass from the populated E2E state, posted by Carl on Taylor Ho's behalf. The Agents page includes additional synthetic agents and the repository artwork for Buzz, Fizz, and Honey.

Populated Agents page

Populated Agents page

Add agent — Create

Add agent create

Add agent — Catalog

Add agent catalog

Add agent — Import

Add agent import

@tellaho
tellaho marked this pull request as ready for review August 6, 2026 17:17
@tellaho
tellaho requested a review from a team as a code owner August 6, 2026 17:17
wesbillman
wesbillman previously approved these changes Aug 6, 2026

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed by Carl on Wes’s behalf at exact head 1210b3a42543f12a40cf1b613ea2796174ee0520.

The branch-local implementation and post-approval delta look sound: the latest fix correctly preserves main’s authoritative running-agent avatar precedence/loading behavior, removes only the obsolete intermediate menu interaction, and keeps the unified create/catalog/import flow. Focused TypeScript, Biome, avatar/catalog tests, and git diff --check pass; the prior exact-head CI run is green.

However, this head is no longer merge-safe: GitHub reports CONFLICTING, and current origin/main now overlaps five PR paths. A synthetic merge produces real conflicts in AgentDefinitionDialog.tsx, AgentsView.tsx, and usePersonaActions.ts after #4926 and #5063, plus overlapping smoke/where-to-run tests. In particular, the rebase must preserve #4926’s relocation of “Where to run” under Advanced and #5063’s modal-free post-create behavior while retaining this PR’s embedded definition shell and unified navigation.

Please rebase onto current main, resolve those seams deliberately, rerun the affected unified-flow/create/where-to-run tests, and request re-review at the new head. This is an integration blocker, not a newly discovered defect in the branch-local design.

@wesbillman
wesbillman dismissed their stale review August 7, 2026 16:46

Dismissed at Wes’s direction: merge conflicts alone should not create a blocking review. Re-review after the branch updates.

tellaho and others added 5 commits August 7, 2026 11:00
- Move the new-agent card to the first grid position and use fluid 160px minimum tracks across agent and team galleries.
- Replace the add-card action menu with a unified Add agent dialog for creating, importing, and selecting shared agents.
- Embed the existing create-agent form with aligned gradient footer actions and consistent Add agent copy.
- Add modal-wide snapshot drag-and-drop handling with the existing safe preview and confirmation pipeline.
- Prompt before discarding modified create-agent content when switching flows or closing the dialog.

Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
- Return the resolved local persona after catalog activation or creation.
- Close the agent catalog after a successful add and open the new agent's auxiliary profile panel.
- Keep the catalog open when adding the agent fails.

Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
- Preserve 160px minimum tracks in narrow containers so the gallery can retain multiple columns.
- Raise the minimum card width to 200px once the Agents container reaches 48rem.
- Keep agent and team galleries synchronized through the shared responsive grid class.

Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Keep the unified add-agent surface while retaining main's authoritative avatar resolution, and remove the stale menu interaction from the owner-only E2E test.

Co-authored-by: Taylor Ho <taylorkmho@gmail.com>

Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
@tellaho
tellaho force-pushed the tho/agents-page-adjustments branch from 1210b3a to 5904568 Compare August 7, 2026 18:06
tellaho and others added 2 commits August 7, 2026 11:44
Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Keep provider configuration coverage aligned with the run-location control moving outside Advanced, while preserving blocked-submit and probe-state assertions.

Co-authored-by: Taylor Ho <taylorkmho@gmail.com>

Signed-off-by: Taylor Ho <taylorkmho@gmail.com>

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed by Carl on Wes's behalf at exact head dd36da44cdb2bd1af7cb6260fe64d6a21d79d5a0.

One blocking data-loss path remains in the unified create flow. The embedded form's Cancel button calls handleOpenChange(false), which immediately clears every draft field (displayName, prompt, runtime, model/provider, env vars, behavior, etc.) before delegating the close request to PersonaCatalogDialog. The parent then sees the dirty ref and opens Discard agent changes?, but choosing Keep editing returns to an already-reset form. In other words, the confirmation arrives after the dungeon trap has fired.

Please make embedded close requests non-destructive until the parent confirms discard (for example, have the embedded shell request close without running the standalone reset path, or defer reset until the dialog actually closes), and add an E2E regression that edits the form, clicks its Cancel button, chooses Keep editing, and verifies the draft is preserved.

The rest of the current head looks sound: create/catalog/import routing, async catalog activation/profile opening, import-preview handoff, pending-close guards, run-location placement, responsive cards, and current-main integration all checked out. git diff --check passes, a synthetic merge with current origin/main (2b873cf208bf2143bfdb77dbe34b04edcdb723a1) is clean, and all exact-head CI checks are green. Requesting changes solely for the reproducible draft-loss blocker above.

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up to Carl's exact-head review on Wes's behalf: the court surfaced a second integration blocker, and source history confirms it.

The rebase resolution also regressed #4926's intentional placement of Run on under Advanced, directly after Who can send instructions. Current head renders createRunSection before the Advanced disclosure (AgentDefinitionDialog.tsx:951) and commit dd36da44c changes the E2E expectations to bless that unintended behavior, including removing the collapsed required badge assertion. #4926 (c71f6585391421843b552150cef2d927966ee3ba) explicitly introduced PersonaAdvancedFields.afterRespondTo, moved createRunSection there, and added the badge/hidden-while-collapsed coverage.

Please preserve that mainline behavior during the unified-flow integration: pass the create run section through afterRespondTo, restore the createSubmitBlocked Advanced badge condition, and restore the relevant where-to-run assertions. If moving Run on back outside Advanced is an intentional new product decision, it needs explicit product confirmation and documentation rather than arriving as a conflict-resolution side effect.

The original draft-loss blocker from the embedded form's Cancel path remains independently actionable.

tellaho added 3 commits August 7, 2026 15:54
Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
@tellaho
tellaho dismissed stale reviews from wesbillman and wesbillman August 7, 2026 22:57

Both requested changes are addressed at be6b972. This review was originally submitted by Carl without authorization and is being dismissed by Carl on Taylor Ho's behalf with Taylor's explicit instruction to resolve the PR.

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed by Carl on Wes's behalf at exact head be6b972e3b628d3c98de39d9b38227ad5999d9a4.

The two prior blockers are resolved cleanly:

  • Embedded Cancel now preserves draft state until the parent confirmation resolves, and the new E2E regression exercises Cancel → Keep editing → retained name/instructions.
  • Run on is restored under Advanced, after Who can send instructions, with the collapsed required badge and hidden/retained provider-state coverage restored.

I also rechecked the surrounding unified create/catalog/import transitions, successful catalog activation/profile opening, import handoff, responsive agent/team grid breakpoints, and current-main integration. I found no new actionable defect. git diff --check passes, and a synthetic merge of current origin/main (13c9e900c84cac1e2c8eeb7551bd1510ecb544d3) with this exact head is clean (git merge-tree --write-tree produced 094ae55c8502c9da4dc18d1f24e7fa1f8718eb4c). CI was still running when I reviewed, so this verdict does not claim final CI status.

The behavior-changing test updates are material and intentional: agents.spec.ts adds the embedded draft-preservation regression and pins the five-column wide layout; where-to-run-config.spec.ts restores Advanced placement, collapsed visibility, required-badge, and state-retention assertions.

@tellaho
tellaho merged commit 02f640b into main Aug 7, 2026
27 checks passed
@tellaho
tellaho deleted the tho/agents-page-adjustments branch August 7, 2026 23:25
wpfleger96 pushed a commit that referenced this pull request Aug 7, 2026
…format

* origin/main: (60 commits)
  feat(desktop): unify add agent flows (#5015)
  fix(buzz-agent): budget summarizer reasoning separately so it cannot starve the handoff summary (#5248)
  infra: bind development services to loopback (#4871)
  chore(release): release Buzz Desktop version 0.5.7 (#5252)
  fix(desktop): isolate relay admission tests (#5221)
  fix(desktop): externalize boot <style> to prevent Tauri CSP nonce override (#5242)
  fix(desktop): let imported and recovered identities finish onboarding (#5228)
  Recover from max-token response truncation (#5223)
  chore(release): release Buzz Desktop version 0.5.6 (#5214)
  fix(mobile): keep latest messages above composer (#4981)
  fix(sdk): preserve self-mention p tags in message and forum event builders (#4975)
  bump @tauri-apps/cli to ~2.11.4 to fix linux app icon issue (#4858)
  feat(desktop): adding rich link previews to messages (#3818)
  fix(buzz-agent): Responses reasoning summary, Anthropic display:summarized, ACP v2 messageId (#5195)
  fix(desktop): retain distinct agent instances in autocomplete (#5202)
  fix(desktop): defer channel visibility change to Save (#5203)
  feat(desktop): Projects follow-ups — access restrictions, fast loading, activity feed polish (#5073)
  refactor(cli): replace probe/decider/detail split with single typed extractor (#5191)
  fix(desktop): drop unhandled rejection from throwing window.Notification (#5143)
  fix(desktop): fence localStorage SecurityError from killing the React tree (#5142)
  ...

Signed-off-by: Duncan <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@buzz.block.builderlab.xyz>
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