@@ -27,6 +27,7 @@ import { ParallelTool } from '@/app/workspace/[workspaceId]/w/[workflowId]/compo
2727import { getSubBlockStableKey } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/utils'
2828import { useCurrentWorkflow } from '@/app/workspace/[workspaceId]/w/[workflowId]/hooks'
2929import { getBlock } from '@/blocks/registry'
30+ import type { SubBlockType } from '@/blocks/types'
3031import { useCollaborativeWorkflow } from '@/hooks/use-collaborative-workflow'
3132import { usePanelEditorStore } from '@/stores/panel'
3233import { useWorkflowRegistry } from '@/stores/workflows/registry/store'
@@ -101,16 +102,25 @@ export function Editor() {
101102 [ blockConfig ?. subBlocks ]
102103 )
103104 const canonicalModeOverrides = currentBlock ?. data ?. canonicalModes
105+ const subBlocksForAdvancedCheck = useMemo ( ( ) => {
106+ const subBlocks = blockConfig ?. subBlocks || [ ]
107+ if ( ! triggerMode ) return subBlocks
108+ return subBlocks . filter (
109+ ( subBlock ) =>
110+ subBlock . mode === 'trigger' || subBlock . type === ( 'trigger-config' as SubBlockType )
111+ )
112+ } , [ blockConfig ?. subBlocks , triggerMode ] )
113+
104114 const advancedValuesPresent = hasAdvancedValues (
105- blockConfig ?. subBlocks || [ ] ,
115+ subBlocksForAdvancedCheck ,
106116 blockSubBlockValues ,
107117 canonicalIndex
108118 )
109119 const displayAdvancedOptions = advancedMode || advancedValuesPresent
110120
111121 const hasAdvancedOnlyFields = useMemo (
112- ( ) => hasStandaloneAdvancedFields ( blockConfig ?. subBlocks || [ ] , canonicalIndex ) ,
113- [ blockConfig ?. subBlocks , canonicalIndex ]
122+ ( ) => hasStandaloneAdvancedFields ( subBlocksForAdvancedCheck , canonicalIndex ) ,
123+ [ subBlocksForAdvancedCheck , canonicalIndex ]
114124 )
115125
116126 // Get subblock layout using custom hook
0 commit comments