diff --git a/packages/app/src/screens/workspace/workspace-draft-agent-tab.tsx b/packages/app/src/screens/workspace/workspace-draft-agent-tab.tsx index 318ffefa2..20236d2c3 100644 --- a/packages/app/src/screens/workspace/workspace-draft-agent-tab.tsx +++ b/packages/app/src/screens/workspace/workspace-draft-agent-tab.tsx @@ -323,6 +323,16 @@ interface WorkspaceDraftAgentTabProps { onOpenImportSheet?: () => void; } +function resolveImportPillPress( + onOpenImportSheet: (() => void) | undefined, + isSubmitting: boolean, +): (() => void) | null { + if (isSubmitting) { + return null; + } + return onOpenImportSheet ?? null; +} + export function WorkspaceDraftAgentTab({ serverId, workspaceId, @@ -588,6 +598,7 @@ export function WorkspaceDraftAgentTab({ const handleDropdownCloseFocus = useCallback(() => { focusInputRef.current?.(); }, []); + const importPillPress = resolveImportPillPress(onOpenImportSheet, isSubmitting); const composerStatusControls = useMemo( () => ({ ...composerState.statusControls, @@ -645,10 +656,10 @@ export function WorkspaceDraftAgentTab({ - {onOpenImportSheet ? ( + {importPillPress ? ( - + ) : null}