33import { ChevronUp } from 'lucide-react'
44import SimpleCodeEditor from 'react-simple-code-editor'
55import { Code as CodeEditor , Combobox , getCodeEditorProps , Input , Label } from '@/components/emcn'
6- import { cn } from '@/lib/core/utils/cn'
76import { WORKFLOW_SEARCH_SUBFLOW_FIELD_IDS } from '@/lib/workflows/search-replace/subflow-fields'
87import { TagDropdown } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tag-dropdown/tag-dropdown'
98import type { ActiveSearchTarget } from '@/stores/panel/editor/store'
@@ -12,6 +11,8 @@ import type { ConnectedBlock } from '../../hooks/use-block-connections'
1211import { useSubflowEditor } from '../../hooks/use-subflow-editor'
1312import { ConnectionBlocks } from '../connection-blocks'
1413
14+ const WORKFLOW_SEARCH_CURRENT_MATCH_CLASS = 'rounded-md bg-orange-400 px-1 py-0.5'
15+
1516interface SubflowEditorProps {
1617 currentBlock : BlockState
1718 currentBlockId : string
@@ -88,13 +89,18 @@ export function SubflowEditor({
8889 < div
8990 data-workflow-search-subblock-id = { WORKFLOW_SEARCH_SUBFLOW_FIELD_IDS . type }
9091 data-workflow-search-canonical-id = { WORKFLOW_SEARCH_SUBFLOW_FIELD_IDS . type }
91- className = { cn (
92- 'rounded-md transition-colors' ,
93- isTypeHighlighted && 'bg-[var(--surface-3)] p-2 ring-1 ring-[var(--border-1)]'
94- ) }
92+ className = 'rounded-md'
9593 >
9694 < Label className = 'mb-[6.5px] block pl-0.5 font-medium text-[var(--text-primary)] text-small' >
97- { currentBlock . type === 'loop' ? 'Loop Type' : 'Parallel Type' }
95+ { isTypeHighlighted ? (
96+ < mark className = { WORKFLOW_SEARCH_CURRENT_MATCH_CLASS } >
97+ { currentBlock . type === 'loop' ? 'Loop Type' : 'Parallel Type' }
98+ </ mark >
99+ ) : currentBlock . type === 'loop' ? (
100+ 'Loop Type'
101+ ) : (
102+ 'Parallel Type'
103+ ) }
98104 </ Label >
99105 < Combobox
100106 options = { typeOptions }
@@ -118,17 +124,24 @@ export function SubflowEditor({
118124 < div
119125 data-workflow-search-subblock-id = { configSearchFieldId }
120126 data-workflow-search-canonical-id = { configSearchFieldId }
121- className = { cn (
122- 'rounded-md transition-colors' ,
123- isConfigHighlighted && 'bg-[var(--surface-3)] p-2 ring-1 ring-[var(--border-1)]'
124- ) }
127+ className = 'rounded-md'
125128 >
126129 < Label className = 'mb-[6.5px] block pl-0.5 font-medium text-[var(--text-primary)] text-small' >
127- { isCountMode
128- ? `${ currentBlock . type === 'loop' ? 'Loop' : 'Parallel' } Iterations`
129- : isConditionMode
130- ? 'While Condition'
131- : `${ currentBlock . type === 'loop' ? 'Collection' : 'Parallel' } Items` }
130+ { isConfigHighlighted ? (
131+ < mark className = { WORKFLOW_SEARCH_CURRENT_MATCH_CLASS } >
132+ { isCountMode
133+ ? `${ currentBlock . type === 'loop' ? 'Loop' : 'Parallel' } Iterations`
134+ : isConditionMode
135+ ? 'While Condition'
136+ : `${ currentBlock . type === 'loop' ? 'Collection' : 'Parallel' } Items` }
137+ </ mark >
138+ ) : isCountMode ? (
139+ `${ currentBlock . type === 'loop' ? 'Loop' : 'Parallel' } Iterations`
140+ ) : isConditionMode ? (
141+ 'While Condition'
142+ ) : (
143+ `${ currentBlock . type === 'loop' ? 'Collection' : 'Parallel' } Items`
144+ ) }
132145 </ Label >
133146
134147 { isCountMode ? (
0 commit comments