From b2cdbdaed83dc6a69f40da65af4311bc137de96f Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Tue, 19 May 2026 10:26:13 +0700 Subject: [PATCH] Hide import pill once the draft is submitting --- .../workspace/workspace-draft-agent-tab.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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}