Skip to content

Dedupe AgentTypeCombobox into AgentTypeSelect - #871

Merged
selfcontained merged 1 commit into
mainfrom
tech-debt/dedupe-agent-type-combobox
Aug 3, 2026
Merged

Dedupe AgentTypeCombobox into AgentTypeSelect#871
selfcontained merged 1 commit into
mainfrom
tech-debt/dedupe-agent-type-combobox

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

What

Deletes AgentTypeCombobox from automations-form-fields.tsx — it duplicated ~90 lines of AgentTypeSelect (agent-type-select.tsx): identical trigger button, ArrowDown/Enter/Space/Escape key handling, and Command dropdown with requestAnimationFrame focus restoration. AgentTypeSelect gains an optional label prop (default "Type", so the create-agent dialog is unchanged), and both automations call sites (template config fields, launch dialog) now use it with label="Agent type". Net -101 lines.

Why it's tech debt

Two byte-near-identical dropdown implementations that must be kept in sync by hand. Top item on the tech-debt backlog from the 2026-07-21 audit. AgentTypeSelect already had the onOpenChange hook point the combobox lacked, so the duplicate had no remaining reason to exist.

Behavior notes

  • Only visual delta: in the automations launch dialog the label-to-control gap goes from space-y-2 to the component's space-y-1, matching the other two forms.
  • AgentTypeSelect renders the label inside its own wrapper; both former external label wrappers were removed.

Validation

  • pnpm run check, pnpm run finalize:web green; E2E 175 passed.
  • Playwright live validation of all three consumers (create-agent dialog, template config form, launch dialog): label text, dropdown open/select, Escape close all verified; screenshots shared via dispatch_share.

Queued next

Top of backlog: extract shared useStartupAttachments() hook for the ~55-line duplicated startup-attachment callbacks in use-create-agent-form.ts vs automations-launch-dialog.tsx.

🤖 Generated with Claude Code

AgentTypeCombobox in automations-form-fields.tsx duplicated ~90 lines of
AgentTypeSelect (identical trigger, key handling, and Command dropdown).
AgentTypeSelect gains an optional label prop (default "Type") so both
automations call sites keep their "Agent type" label; the duplicate is
deleted.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@selfcontained
selfcontained merged commit 34efcca into main Aug 3, 2026
1 check passed
@selfcontained
selfcontained deleted the tech-debt/dedupe-agent-type-combobox branch August 3, 2026 09:13
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.

1 participant