@@ -59,6 +59,27 @@ export function WorkflowView({ workflow, onBack }: WorkflowViewProps) {
59
59
const [ modelLoadProgress , setModelLoadProgress ] = useState < number | null > ( null ) ;
60
60
const [ modelLoadEta , setModelLoadEta ] = useState < number | null > ( null ) ;
61
61
62
+ // Add this function to check for unsupported nodes
63
+ const hasUnsupportedNodes = ( ) => {
64
+ return nodes . some ( node =>
65
+ node . nodeType ?. toLowerCase ( ) === 'ttsagent' ||
66
+ node . nodeType ?. toLowerCase ( ) === 'transcriptionagent'
67
+ ) ;
68
+ } ;
69
+
70
+ // Get the unsupported node warning message
71
+ const getUnsupportedWarningMessage = ( ) => {
72
+ const unsupportedTypes = nodes
73
+ . filter ( node =>
74
+ node . nodeType ?. toLowerCase ( ) === 'ttsagent' ||
75
+ node . nodeType ?. toLowerCase ( ) === 'transcriptionagent'
76
+ )
77
+ . map ( node => node . nodeType ?. toLowerCase ( ) === 'ttsagent' ? 'Text-to-Speech' : 'Speech Transcription' ) ;
78
+
79
+ const uniqueTypes = [ ...new Set ( unsupportedTypes ) ] ;
80
+ return `${ uniqueTypes . join ( ' and ' ) } ${ uniqueTypes . length > 1 ? 'are' : 'is' } not supported in the Chrome extension. Please use the web app version instead.` ;
81
+ } ;
82
+
62
83
useEffect ( ( ) => {
63
84
console . log ( 'Workflow data received:' , workflow ) ;
64
85
console . log ( 'Initial nodes:' , nodes ) ;
@@ -71,6 +92,15 @@ export function WorkflowView({ workflow, onBack }: WorkflowViewProps) {
71
92
fullNodeData : JSON . stringify ( node . nodeData , null , 2 )
72
93
} ) ;
73
94
} ) ;
95
+
96
+ // Show toast warning if workflow contains unsupported nodes
97
+ if ( hasUnsupportedNodes ( ) ) {
98
+ toast ( {
99
+ variant : "destructive" ,
100
+ title : "Unsupported workflow" ,
101
+ description : getUnsupportedWarningMessage ( )
102
+ } ) ;
103
+ }
74
104
} , [ ] ) ;
75
105
76
106
// Update areAllInputsFilled function
@@ -273,7 +303,7 @@ export function WorkflowView({ workflow, onBack }: WorkflowViewProps) {
273
303
< div className = "flex items-center gap-8" >
274
304
< Button
275
305
onClick = { handleExecute }
276
- disabled = { isExecuting || ! areAllInputsFilled ( ) }
306
+ disabled = { isExecuting || ! areAllInputsFilled ( ) || hasUnsupportedNodes ( ) }
277
307
className = "flex items-center gap-2"
278
308
>
279
309
< Play className = "h-4 w-4" />
@@ -283,6 +313,12 @@ export function WorkflowView({ workflow, onBack }: WorkflowViewProps) {
283
313
</ div >
284
314
285
315
< div className = "flex-1 overflow-y-auto" >
316
+ { hasUnsupportedNodes ( ) && (
317
+ < div className = "p-3 bg-destructive/10 text-destructive text-sm mb-2 mx-4 mt-4 rounded-md" >
318
+ < strong > Warning:</ strong > { getUnsupportedWarningMessage ( ) }
319
+ </ div >
320
+ ) }
321
+
286
322
{ modelLoadProgress !== null && (
287
323
< div className = "p-2 bg-primary/10 text-primary text-sm sticky top-0 z-10" >
288
324
< div className = "flex items-center gap-2" >
0 commit comments