Skip to content

Commit 4fc55a0

Browse files
committed
Enable images
1 parent e2a4808 commit 4fc55a0

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/user-input/hooks/use-file-attachments.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,12 @@ export function useFileAttachments(props: UseFileAttachmentsProps) {
178178

179179
/**
180180
* Opens file picker dialog
181+
* Note: We allow file selection even when isLoading (streaming) so users can prepare images for the next message
181182
*/
182183
const handleFileSelect = useCallback(() => {
183-
if (disabled || isLoading) return
184+
if (disabled) return
184185
fileInputRef.current?.click()
185-
}, [disabled, isLoading])
186+
}, [disabled])
186187

187188
/**
188189
* Handles file input change event

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/user-input/user-input.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ const UserInput = forwardRef<UserInputRef, UserInputProps>(
746746
title='Attach file'
747747
className={cn(
748748
'cursor-pointer rounded-[6px] border-0 bg-transparent p-[0px] dark:bg-transparent',
749-
(disabled || isLoading) && 'cursor-not-allowed opacity-50'
749+
disabled && 'cursor-not-allowed opacity-50'
750750
)}
751751
>
752752
<Image className='!h-3.5 !w-3.5 scale-x-110' />
@@ -802,15 +802,15 @@ const UserInput = forwardRef<UserInputRef, UserInputProps>(
802802
</div>
803803
</div>
804804

805-
{/* Hidden File Input */}
805+
{/* Hidden File Input - enabled during streaming so users can prepare images for the next message */}
806806
<input
807807
ref={fileAttachments.fileInputRef}
808808
type='file'
809809
onChange={fileAttachments.handleFileChange}
810810
className='hidden'
811811
accept='image/*'
812812
multiple
813-
disabled={disabled || isLoading}
813+
disabled={disabled}
814814
/>
815815
</div>
816816
</div>

0 commit comments

Comments
 (0)