Skip to content

Commit a0a6b00

Browse files
committed
improvement(ui): hide divider when following subblock value is null
1 parent 8651896 commit a0a6b00

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
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/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)