Skip to content

Commit 5d48c27

Browse files
authored
improvement(ui): enhance ring outline for code subblock and mcp tool subblocks in agent (#1741)
1 parent 38614fa commit 5d48c27

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,8 @@ IMPORTANT FORMATTING RULES:
432432

433433
<div
434434
className={cn(
435-
'group relative min-h-[100px] rounded-md border border-input bg-background font-mono text-sm transition-colors',
436-
isConnecting && 'ring-2 ring-blue-500 ring-offset-2'
435+
'group relative min-h-[100px] rounded-md bg-background font-mono text-sm transition-colors',
436+
isConnecting ? 'ring-2 ring-blue-500' : 'border border-input'
437437
)}
438438
onDragOver={(e) => e.preventDefault()}
439439
onDrop={handleDrop}

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/components/tool-input/tool-input.tsx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ const logger = createLogger('ToolInput')
5858
interface ToolInputProps {
5959
blockId: string
6060
subBlockId: string
61+
isConnecting: boolean
6162
isPreview?: boolean
6263
previewValue?: any
6364
disabled?: boolean
@@ -280,20 +281,22 @@ function CodeSyncWrapper({
280281
onChange,
281282
uiComponent,
282283
disabled,
284+
isConnecting,
283285
}: {
284286
blockId: string
285287
paramId: string
286288
value: string
287289
onChange: (value: string) => void
288290
uiComponent: any
289291
disabled: boolean
292+
isConnecting: boolean
290293
}) {
291294
return (
292295
<GenericSyncWrapper blockId={blockId} paramId={paramId} value={value} onChange={onChange}>
293296
<Code
294297
blockId={blockId}
295298
subBlockId={paramId}
296-
isConnecting={false}
299+
isConnecting={isConnecting}
297300
language={uiComponent.language}
298301
generationType={uiComponent.generationType}
299302
disabled={disabled}
@@ -313,13 +316,15 @@ function ComboboxSyncWrapper({
313316
onChange,
314317
uiComponent,
315318
disabled,
319+
isConnecting,
316320
}: {
317321
blockId: string
318322
paramId: string
319323
value: string
320324
onChange: (value: string) => void
321325
uiComponent: any
322326
disabled: boolean
327+
isConnecting: boolean
323328
}) {
324329
return (
325330
<GenericSyncWrapper blockId={blockId} paramId={paramId} value={value} onChange={onChange}>
@@ -328,7 +333,7 @@ function ComboboxSyncWrapper({
328333
subBlockId={paramId}
329334
options={uiComponent.options || []}
330335
placeholder={uiComponent.placeholder}
331-
isConnecting={false}
336+
isConnecting={isConnecting}
332337
config={{
333338
id: paramId,
334339
type: 'combobox' as const,
@@ -414,6 +419,7 @@ function ChannelSelectorSyncWrapper({
414419
export function ToolInput({
415420
blockId,
416421
subBlockId,
422+
isConnecting,
417423
isPreview = false,
418424
previewValue,
419425
disabled = false,
@@ -984,7 +990,7 @@ export function ToolInput({
984990
subBlockId={uniqueSubBlockId}
985991
placeholder={param.description}
986992
password={isPasswordParameter(param.id)}
987-
isConnecting={false}
993+
isConnecting={isConnecting}
988994
config={{
989995
id: uniqueSubBlockId,
990996
type: 'short-input',
@@ -1031,7 +1037,7 @@ export function ToolInput({
10311037
blockId={blockId}
10321038
subBlockId={uniqueSubBlockId}
10331039
placeholder={uiComponent.placeholder || param.description}
1034-
isConnecting={false}
1040+
isConnecting={isConnecting}
10351041
config={{
10361042
id: uniqueSubBlockId,
10371043
type: 'long-input',
@@ -1049,7 +1055,7 @@ export function ToolInput({
10491055
subBlockId={uniqueSubBlockId}
10501056
placeholder={uiComponent.placeholder || param.description}
10511057
password={uiComponent.password || isPasswordParameter(param.id)}
1052-
isConnecting={false}
1058+
isConnecting={isConnecting}
10531059
config={{
10541060
id: uniqueSubBlockId,
10551061
type: 'short-input',
@@ -1138,6 +1144,7 @@ export function ToolInput({
11381144
onChange={onChange}
11391145
uiComponent={uiComponent}
11401146
disabled={disabled}
1147+
isConnecting={isConnecting}
11411148
/>
11421149
)
11431150

@@ -1162,6 +1169,7 @@ export function ToolInput({
11621169
onChange={onChange}
11631170
uiComponent={uiComponent}
11641171
disabled={disabled}
1172+
isConnecting={isConnecting}
11651173
/>
11661174
)
11671175

@@ -1208,7 +1216,7 @@ export function ToolInput({
12081216
subBlockId={uniqueSubBlockId}
12091217
placeholder={uiComponent.placeholder || param.description}
12101218
password={uiComponent.password || isPasswordParameter(param.id)}
1211-
isConnecting={false}
1219+
isConnecting={isConnecting}
12121220
config={{
12131221
id: uniqueSubBlockId,
12141222
type: 'short-input',
@@ -1750,7 +1758,7 @@ export function ToolInput({
17501758
subBlockId={`${subBlockId}-tool-${toolIndex}-${param.id}`}
17511759
placeholder={param.description}
17521760
password={isPasswordParameter(param.id)}
1753-
isConnecting={false}
1761+
isConnecting={isConnecting}
17541762
config={{
17551763
id: `${subBlockId}-tool-${toolIndex}-${param.id}`,
17561764
type: 'short-input',

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ export const SubBlock = memo(
230230
<ToolInput
231231
blockId={blockId}
232232
subBlockId={config.id}
233+
isConnecting={isConnecting}
233234
isPreview={isPreview}
234235
previewValue={previewValue}
235236
disabled={allowExpandInPreview ? false : isDisabled}

0 commit comments

Comments
 (0)