Skip to content

Commit ef405af

Browse files
committed
fix(workflow): align condition/router handles with their rows
1 parent e3f9deb commit ef405af

3 files changed

Lines changed: 16 additions & 7 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ const SubBlockRow = memo(function SubBlockRow({
146146
const displayValue = maskedValue || hydratedName || (isSelectorType && value ? '-' : value)
147147

148148
return (
149-
<div className='flex items-center gap-2'>
149+
<div className='flex h-5 items-center gap-2'>
150150
<span
151151
className='min-w-0 truncate text-[var(--text-tertiary)] text-sm capitalize'
152152
title={title}

packages/workflow-renderer/src/dimensions.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,21 @@ export const CONTAINER_DIMENSIONS = {
3131
} as const
3232

3333
/**
34-
* Handle position constants - must match CSS in workflow-block.tsx and subflow-node.tsx
34+
* Handle position constants - must match CSS in workflow-block-view.tsx,
35+
* sub-block-row-view.tsx, and subflow-node.tsx
3536
*/
3637
export const HANDLE_POSITIONS = {
3738
/** Default Y offset from block top for source/target handles */
3839
DEFAULT_Y_OFFSET: 20,
3940
/** Error handle offset from block bottom */
4041
ERROR_BOTTOM_OFFSET: 17,
41-
/** Condition handle starting Y offset */
42-
CONDITION_START_Y: 60,
43-
/** Height per condition row */
44-
CONDITION_ROW_HEIGHT: 29,
42+
/**
43+
* Y of the first condition-row handle: 40px header + 1px divider +
44+
* 8px content padding + half of the 20px row
45+
*/
46+
CONDITION_START_Y: 59,
47+
/** Row pitch: 20px row height (h-5) + 8px flex gap (gap-2) */
48+
CONDITION_ROW_HEIGHT: 28,
4549
/** Subflow start handle Y offset (header 50px + pill offset 16px + pill center 14px) */
4650
SUBFLOW_START_Y_OFFSET: 80,
4751
} as const

packages/workflow-renderer/src/workflow-block/sub-block-row-view.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,15 @@ export interface SubBlockRowViewProps {
1919
/**
2020
* Pure renderer for a collapsed block's subblock summary row: a capitalized
2121
* title and its resolved display value.
22+
*
23+
* The fixed `h-5` row height is part of the handle-position contract —
24+
* `HANDLE_POSITIONS.CONDITION_ROW_HEIGHT` in dimensions.ts assumes a 20px row
25+
* plus the container's 8px gap, so condition/router source handles align with
26+
* their rows.
2227
*/
2328
export function SubBlockRowView({ title, displayValue, isMonospace }: SubBlockRowViewProps) {
2429
return (
25-
<div className='flex items-center gap-2'>
30+
<div className='flex h-5 items-center gap-2'>
2631
<OverflowSpan
2732
value={title}
2833
className='min-w-0 truncate text-[var(--text-tertiary)] text-sm capitalize'

0 commit comments

Comments
 (0)