perf: reset automation branch picker by repo key (#4073)

This commit is contained in:
Neil
2026-05-31 03:20:26 -07:00
committed by GitHub
parent 661d39e12b
commit ced2ae858c
2 changed files with 3 additions and 6 deletions
@@ -318,6 +318,9 @@ export function AutomationEditorDialog({
/>
) : (
<CreateFromPicker
// Why: branch search state belongs to the selected project,
// so repo switches should reset it before the next paint.
key={draft.projectId}
repoId={draft.projectId}
repoMap={repoMap}
worktrees={worktrees}
@@ -127,12 +127,6 @@ export function CreateFromPicker({
}
}, [activeRuntimeEnvironmentId, repoId])
React.useEffect(() => {
setQuery('')
setSearchResults([])
setIsSearching(false)
}, [repoId])
React.useEffect(() => {
const trimmedQuery = query.trim()
if (!open || !repoId || trimmedQuery.length < 2) {