Dedupe AgentTypeCombobox into AgentTypeSelect - #871
Merged
Conversation
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>
This was referenced Aug 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Deletes
AgentTypeComboboxfromautomations-form-fields.tsx— it duplicated ~90 lines ofAgentTypeSelect(agent-type-select.tsx): identical trigger button, ArrowDown/Enter/Space/Escape key handling, and Command dropdown with requestAnimationFrame focus restoration.AgentTypeSelectgains an optionallabelprop (default"Type", so the create-agent dialog is unchanged), and both automations call sites (template config fields, launch dialog) now use it withlabel="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.
AgentTypeSelectalready had theonOpenChangehook point the combobox lacked, so the duplicate had no remaining reason to exist.Behavior notes
space-y-2to the component'sspace-y-1, matching the other two forms.AgentTypeSelectrenders the label inside its own wrapper; both former external label wrappers were removed.Validation
pnpm run check,pnpm run finalize:webgreen; E2E 175 passed.Queued next
Top of backlog: extract shared
useStartupAttachments()hook for the ~55-line duplicated startup-attachment callbacks inuse-create-agent-form.tsvsautomations-launch-dialog.tsx.🤖 Generated with Claude Code