Skip to content

Commit dd63083

Browse files
committed
fix padding
1 parent b03a07d commit dd63083

2 files changed

Lines changed: 38 additions & 20 deletions

File tree

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ const FOLDER_OVERRIDES: SelectorOverrides = {
7272
},
7373
}
7474

75+
const WORKFLOW_SEARCH_CURRENT_MATCH_CLASS = 'rounded-md bg-orange-400 px-1 py-0.5'
76+
7577
/**
7678
* Interface for wand control handlers exposed by sub-block inputs
7779
*/
@@ -230,6 +232,7 @@ const renderLabel = (
230232
onCopy: () => void
231233
},
232234
labelSuffix?: React.ReactNode,
235+
isSearchHighlighted?: boolean,
233236
externalLink?: {
234237
show: boolean
235238
onClick: () => void
@@ -249,7 +252,11 @@ const renderLabel = (
249252
return (
250253
<div className='flex items-center justify-between gap-1.5 pl-0.5'>
251254
<Label className='flex items-baseline gap-1.5 whitespace-nowrap'>
252-
{config.title}
255+
{isSearchHighlighted ? (
256+
<mark className={WORKFLOW_SEARCH_CURRENT_MATCH_CLASS}>{config.title}</mark>
257+
) : (
258+
config.title
259+
)}
253260
{required && <span className='ml-0.5'>*</span>}
254261
{labelSuffix}
255262
{config.type === 'code' &&
@@ -1173,10 +1180,7 @@ function SubBlockComponent({
11731180
onMouseDown={handleMouseDown}
11741181
data-workflow-search-subblock-id={config.id}
11751182
data-workflow-search-canonical-id={config.canonicalParamId ?? config.id}
1176-
className={cn(
1177-
'subblock-content flex flex-col gap-2.5 rounded-md transition-colors',
1178-
isSearchHighlighted && 'bg-[var(--surface-3)] p-2 ring-1 ring-[var(--border-1)]'
1179-
)}
1183+
className='subblock-content flex flex-col gap-2.5'
11801184
>
11811185
{renderLabel(
11821186
config,
@@ -1204,6 +1208,7 @@ function SubBlockComponent({
12041208
onCopy: handleCopy,
12051209
},
12061210
labelSuffix,
1211+
isSearchHighlighted,
12071212
externalLink
12081213
)}
12091214
{renderInput()}

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/subflow-editor/subflow-editor.tsx

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import { ChevronUp } from 'lucide-react'
44
import SimpleCodeEditor from 'react-simple-code-editor'
55
import { Code as CodeEditor, Combobox, getCodeEditorProps, Input, Label } from '@/components/emcn'
6-
import { cn } from '@/lib/core/utils/cn'
76
import { WORKFLOW_SEARCH_SUBFLOW_FIELD_IDS } from '@/lib/workflows/search-replace/subflow-fields'
87
import { TagDropdown } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tag-dropdown/tag-dropdown'
98
import type { ActiveSearchTarget } from '@/stores/panel/editor/store'
@@ -12,6 +11,8 @@ import type { ConnectedBlock } from '../../hooks/use-block-connections'
1211
import { useSubflowEditor } from '../../hooks/use-subflow-editor'
1312
import { ConnectionBlocks } from '../connection-blocks'
1413

14+
const WORKFLOW_SEARCH_CURRENT_MATCH_CLASS = 'rounded-md bg-orange-400 px-1 py-0.5'
15+
1516
interface 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

Comments
 (0)