Skip to content

Commit 2e1ccb1

Browse files
authored
improvement(ui): hide divider when following subblock value is null (#2608)
* improvement(ui): hide divider when following subblock value is null * closed gap in mcp dynamic args subblock
1 parent 8651896 commit 2e1ccb1

File tree

4 files changed

+39
-26
lines changed

4 files changed

+39
-26
lines changed

apps/sim/app/_styles/globals.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,17 @@
391391
color: var(--text-primary);
392392
}
393393

394+
/**
395+
* Subblock divider visibility
396+
* Hides dividers when adjacent subblocks render empty content (e.g., schedule-info without data).
397+
* Uses CSS :has() to detect empty .subblock-content elements and hide associated dividers.
398+
* Selectors ordered by ascending specificity: (0,4,0) then (0,5,0)
399+
*/
400+
.subblock-row:has(> .subblock-content:empty) > .subblock-divider,
401+
.subblock-row:has(+ .subblock-row > .subblock-content:empty) > .subblock-divider {
402+
display: none;
403+
}
404+
394405
/**
395406
* Dark mode specific overrides
396407
*/

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

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ export function McpDynamicArgs({
537537
}
538538

539539
return (
540-
<div className='relative space-y-4'>
540+
<div className='relative'>
541541
{/* Hidden dummy inputs to prevent browser password manager autofill */}
542542
<input
543543
type='text'
@@ -563,28 +563,30 @@ export function McpDynamicArgs({
563563
tabIndex={-1}
564564
readOnly
565565
/>
566-
{toolSchema.properties &&
567-
Object.entries(toolSchema.properties).map(([paramName, paramSchema]) => {
568-
const inputType = getInputType(paramSchema as any)
569-
const showLabel = inputType !== 'switch'
570-
571-
return (
572-
<div key={paramName} className='space-y-2'>
573-
{showLabel && (
574-
<Label
575-
className={cn(
576-
'font-medium text-sm',
577-
toolSchema.required?.includes(paramName) &&
578-
'after:ml-1 after:text-red-500 after:content-["*"]'
579-
)}
580-
>
581-
{formatParameterLabel(paramName)}
582-
</Label>
583-
)}
584-
{renderParameterInput(paramName, paramSchema as any)}
585-
</div>
586-
)
587-
})}
566+
<div className='space-y-4'>
567+
{toolSchema.properties &&
568+
Object.entries(toolSchema.properties).map(([paramName, paramSchema]) => {
569+
const inputType = getInputType(paramSchema as any)
570+
const showLabel = inputType !== 'switch'
571+
572+
return (
573+
<div key={paramName} className='space-y-2'>
574+
{showLabel && (
575+
<Label
576+
className={cn(
577+
'font-medium text-sm',
578+
toolSchema.required?.includes(paramName) &&
579+
'after:ml-1 after:text-red-500 after:content-["*"]'
580+
)}
581+
>
582+
{formatParameterLabel(paramName)}
583+
</Label>
584+
)}
585+
{renderParameterInput(paramName, paramSchema as any)}
586+
</div>
587+
)
588+
})}
589+
</div>
588590
</div>
589591
)
590592
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ function SubBlockComponent({
866866
}
867867

868868
return (
869-
<div onMouseDown={handleMouseDown} className='flex flex-col gap-[10px]'>
869+
<div onMouseDown={handleMouseDown} className='subblock-content flex flex-col gap-[10px]'>
870870
{renderLabel(
871871
config,
872872
isValidJson,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ export function Editor() {
341341
)
342342

343343
return (
344-
<div key={stableKey}>
344+
<div key={stableKey} className='subblock-row'>
345345
<SubBlock
346346
blockId={currentBlockId}
347347
config={subBlock}
@@ -352,7 +352,7 @@ export function Editor() {
352352
allowExpandInPreview={false}
353353
/>
354354
{index < subBlocks.length - 1 && (
355-
<div className='px-[2px] pt-[16px] pb-[13px]'>
355+
<div className='subblock-divider px-[2px] pt-[16px] pb-[13px]'>
356356
<div
357357
className='h-[1.25px]'
358358
style={{

0 commit comments

Comments
 (0)