Skip to content

Commit 1d11b92

Browse files
committed
fix file upload subblock styling, tested all fireflies ops
1 parent 071eb47 commit 1d11b92

5 files changed

Lines changed: 97 additions & 80 deletions

File tree

apps/docs/content/docs/en/tools/fireflies.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ Upload an audio file URL to Fireflies.ai for transcription
117117
| Parameter | Type | Required | Description |
118118
| --------- | ---- | -------- | ----------- |
119119
| `apiKey` | string | Yes | Fireflies API key |
120-
| `audioUrl` | string | Yes | Public HTTPS URL of the audio/video file \(MP3, MP4, WAV, M4A, OGG\) |
120+
| `audioFile` | file | No | Audio/video file to upload for transcription |
121+
| `audioUrl` | string | No | Public HTTPS URL of the audio/video file \(MP3, MP4, WAV, M4A, OGG\) |
121122
| `title` | string | No | Title for the meeting/transcript |
122123
| `webhook` | string | No | Webhook URL to notify when transcription is complete |
123124
| `language` | string | No | Language code for transcription \(e.g., "es" for Spanish, "de" for German\) |

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/file-upload/file-upload.tsx

Lines changed: 62 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { X } from 'lucide-react'
66
import { useParams } from 'next/navigation'
77
import { Button, Combobox } from '@/components/emcn/components'
88
import { Progress } from '@/components/ui/progress'
9+
import { cn } from '@/lib/core/utils/cn'
910
import type { WorkspaceFileRecord } from '@/lib/uploads/contexts/workspace'
1011
import { useWorkflowRegistry } from '@/stores/workflows/registry/store'
1112
import { useWorkflowStore } from '@/stores/workflows/workflow/store'
@@ -429,14 +430,14 @@ export function FileUpload({
429430
<Button
430431
type='button'
431432
variant='ghost'
432-
className='h-6 w-6 shrink-0 p-0'
433+
className='h-5 w-5 shrink-0 p-0'
433434
onClick={(e) => handleRemoveFile(file, e)}
434435
disabled={isDeleting}
435436
>
436437
{isDeleting ? (
437-
<div className='h-4 w-4 animate-spin rounded-full border-[1.5px] border-current border-t-transparent' />
438+
<div className='h-3.5 w-3.5 animate-spin rounded-full border-[1.5px] border-current border-t-transparent' />
438439
) : (
439-
<X className='h-4 w-4' />
440+
<X className='h-3.5 w-3.5' />
440441
)}
441442
</Button>
442443
</div>
@@ -453,8 +454,8 @@ export function FileUpload({
453454
<span className='text-[var(--text-primary)]'>{file.name}</span>
454455
<span className='ml-2 text-[var(--text-muted)]'>({formatFileSize(file.size)})</span>
455456
</div>
456-
<div className='flex h-8 w-8 shrink-0 items-center justify-center'>
457-
<div className='h-4 w-4 animate-spin rounded-full border-[1.5px] border-current border-t-transparent' />
457+
<div className='flex h-5 w-5 shrink-0 items-center justify-center'>
458+
<div className='h-3.5 w-3.5 animate-spin rounded-full border-[1.5px] border-current border-t-transparent' />
458459
</div>
459460
</div>
460461
)
@@ -512,72 +513,66 @@ export function FileUpload({
512513
{/* Error message */}
513514
{uploadError && <div className='mb-2 text-red-600 text-sm'>{uploadError}</div>}
514515

515-
<div>
516-
{/* File list with consistent spacing */}
517-
{(hasFiles || isUploading) && (
518-
<div className='mb-2 space-y-2'>
519-
{/* Only show files that aren't currently uploading */}
520-
{filesArray.map((file) => {
521-
const isCurrentlyUploading = uploadingFiles.some(
522-
(uploadingFile) => uploadingFile.name === file.name
523-
)
524-
return !isCurrentlyUploading && renderFileItem(file)
525-
})}
526-
{isUploading && (
527-
<>
528-
{uploadingFiles.map(renderUploadingItem)}
529-
<div className='mt-1'>
530-
<Progress
531-
value={uploadProgress}
532-
className='h-2 w-full'
533-
indicatorClassName='bg-foreground'
534-
/>
535-
<div className='mt-1 text-center text-muted-foreground text-xs'>
536-
{uploadProgress < 100 ? 'Uploading...' : 'Upload complete!'}
537-
</div>
516+
{/* File list with consistent spacing */}
517+
{(hasFiles || isUploading) && (
518+
<div className={cn('space-y-2', multiple && 'mb-2')}>
519+
{/* Only show files that aren't currently uploading */}
520+
{filesArray.map((file) => {
521+
const isCurrentlyUploading = uploadingFiles.some(
522+
(uploadingFile) => uploadingFile.name === file.name
523+
)
524+
return !isCurrentlyUploading && renderFileItem(file)
525+
})}
526+
{isUploading && (
527+
<>
528+
{uploadingFiles.map(renderUploadingItem)}
529+
<div className='mt-1'>
530+
<Progress
531+
value={uploadProgress}
532+
className='h-2 w-full'
533+
indicatorClassName='bg-foreground'
534+
/>
535+
<div className='mt-1 text-center text-muted-foreground text-xs'>
536+
{uploadProgress < 100 ? 'Uploading...' : 'Upload complete!'}
538537
</div>
539-
</>
540-
)}
541-
</div>
542-
)}
543-
544-
{/* Add More dropdown for multiple files */}
545-
{hasFiles && multiple && !isUploading && (
546-
<div>
547-
<Combobox
548-
options={comboboxOptions}
549-
value={inputValue}
550-
onChange={handleComboboxChange}
551-
onOpenChange={(open) => {
552-
if (open) void loadWorkspaceFiles()
553-
}}
554-
placeholder={loadingWorkspaceFiles ? 'Loading files...' : '+ Add More'}
555-
disabled={disabled || loadingWorkspaceFiles}
556-
editable={true}
557-
filterOptions={true}
558-
isLoading={loadingWorkspaceFiles}
559-
/>
560-
</div>
561-
)}
562-
</div>
538+
</div>
539+
</>
540+
)}
541+
</div>
542+
)}
543+
544+
{/* Add More dropdown for multiple files */}
545+
{hasFiles && multiple && !isUploading && (
546+
<Combobox
547+
options={comboboxOptions}
548+
value={inputValue}
549+
onChange={handleComboboxChange}
550+
onOpenChange={(open) => {
551+
if (open) void loadWorkspaceFiles()
552+
}}
553+
placeholder={loadingWorkspaceFiles ? 'Loading files...' : '+ Add More'}
554+
disabled={disabled || loadingWorkspaceFiles}
555+
editable={true}
556+
filterOptions={true}
557+
isLoading={loadingWorkspaceFiles}
558+
/>
559+
)}
563560

564561
{/* Show dropdown selector if no files and not uploading */}
565562
{!hasFiles && !isUploading && (
566-
<div className='flex items-center'>
567-
<Combobox
568-
options={comboboxOptions}
569-
value={inputValue}
570-
onChange={handleComboboxChange}
571-
onOpenChange={(open) => {
572-
if (open) void loadWorkspaceFiles()
573-
}}
574-
placeholder={loadingWorkspaceFiles ? 'Loading files...' : 'Select or upload file'}
575-
disabled={disabled || loadingWorkspaceFiles}
576-
editable={true}
577-
filterOptions={true}
578-
isLoading={loadingWorkspaceFiles}
579-
/>
580-
</div>
563+
<Combobox
564+
options={comboboxOptions}
565+
value={inputValue}
566+
onChange={handleComboboxChange}
567+
onOpenChange={(open) => {
568+
if (open) void loadWorkspaceFiles()
569+
}}
570+
placeholder={loadingWorkspaceFiles ? 'Loading files...' : 'Select or upload file'}
571+
disabled={disabled || loadingWorkspaceFiles}
572+
editable={true}
573+
filterOptions={true}
574+
isLoading={loadingWorkspaceFiles}
575+
/>
581576
)}
582577
</div>
583578
)

apps/sim/tools/fireflies/create_bite.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const firefliesCreateBiteTool: ToolConfig<
102102
$summary: String
103103
) {
104104
createBite(
105-
transcript_id: $transcriptId
105+
transcript_Id: $transcriptId
106106
start_time: $startTime
107107
end_time: $endTime
108108
name: $name

apps/sim/tools/fireflies/types.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
import type { ToolResponse } from '@/tools/types'
2-
3-
// ===== Core Types =====
4-
52
export interface FirefliesTranscript {
63
id: string
74
title: string
@@ -115,8 +112,6 @@ export interface FirefliesUser {
115112
recent_meeting?: string
116113
}
117114

118-
// ===== Request Params =====
119-
120115
export interface FirefliesListTranscriptsParams {
121116
apiKey: string
122117
keyword?: string
@@ -140,7 +135,15 @@ export interface FirefliesGetUserParams {
140135

141136
export interface FirefliesUploadAudioParams {
142137
apiKey: string
143-
audioUrl: string
138+
audioUrl?: string
139+
audioFile?: {
140+
url?: string
141+
path?: string
142+
name?: string
143+
size?: number
144+
type?: string
145+
key?: string
146+
}
144147
title?: string
145148
webhook?: string
146149
language?: string
@@ -188,8 +191,6 @@ export interface FirefliesListContactsParams {
188191
apiKey: string
189192
}
190193

191-
// ===== Response Types =====
192-
193194
export interface FirefliesListTranscriptsResponse extends ToolResponse {
194195
output: {
195196
transcripts?: Array<{

apps/sim/tools/fireflies/upload_audio.ts

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,15 @@ export const firefliesUploadAudioTool: ToolConfig<
2020
visibility: 'user-only',
2121
description: 'Fireflies API key',
2222
},
23+
audioFile: {
24+
type: 'file',
25+
required: false,
26+
visibility: 'user-or-llm',
27+
description: 'Audio/video file to upload for transcription',
28+
},
2329
audioUrl: {
2430
type: 'string',
25-
required: true,
31+
required: false,
2632
visibility: 'user-or-llm',
2733
description: 'Public HTTPS URL of the audio/video file (MP3, MP4, WAV, M4A, OGG)',
2834
},
@@ -72,12 +78,26 @@ export const firefliesUploadAudioTool: ToolConfig<
7278
}
7379
},
7480
body: (params) => {
75-
if (!params.audioUrl || !params.audioUrl.startsWith('https://')) {
81+
let url: string | undefined
82+
83+
if (params.audioFile) {
84+
url = params.audioFile.url || params.audioFile.path
85+
}
86+
87+
if (!url && params.audioUrl) {
88+
url = params.audioUrl
89+
}
90+
91+
if (!url) {
92+
throw new Error('Either an audio file or audio URL is required')
93+
}
94+
95+
if (!url.startsWith('https://')) {
7696
throw new Error('Audio URL must be a valid HTTPS URL')
7797
}
7898

7999
const input: Record<string, unknown> = {
80-
url: params.audioUrl,
100+
url,
81101
}
82102

83103
if (params.title) input.title = params.title

0 commit comments

Comments
 (0)