Skip to content

fix(workflow): align condition/router handles with their rows#5831

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/condition-handle-row-drift
Jul 22, 2026
Merged

fix(workflow): align condition/router handles with their rows#5831
waleedlatif1 merged 1 commit into
stagingfrom
fix/condition-handle-row-drift

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Fix condition/router source handles drifting out of sync with their rows on blocks with many branches
  • Handles were positioned with a 29px per-row pitch while rows actually render at 28px (20px row + 8px gap), so every extra branch added ~1px of cumulative drift; first-handle offset was also 1px off (60 vs 59)
  • Corrected CONDITION_START_Y (60 → 59) and CONDITION_ROW_HEIGHT (29 → 28) in the shared dimensions source of truth, which fixes the editor renderer, the preview renderer, and autolayout's handle-Y estimate together
  • Pinned the summary row height to an explicit h-5 (same 20px the text-sm line box already produced) in both row renderers and documented it as part of the handle-position contract so CSS and constants can't silently drift apart again

Type of Change

  • Bug fix

Testing

Verified geometry against rendered CSS (header 40px + 1px divider + 8px padding + 20px rows with 8px gaps); drift math matches the reported screenshot (~12px at 12 branches)

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jul 22, 2026 12:56am

Request Review

@cursor

cursor Bot commented Jul 22, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Visual alignment and shared layout constants only; no auth, data, or execution behavior changes.

Overview
Fixes condition and router source handles drifting away from their branch rows when blocks have many branches, by syncing shared geometry with how rows actually render.

HANDLE_POSITIONS in dimensions.ts now uses CONDITION_START_Y 59 (was 60) and CONDITION_ROW_HEIGHT 28 (was 29), matching a 20px row (h-5) plus an 8px gap-2 pitch and the corrected first-handle offset. Editor, preview, and autolayout consumers of these constants pick up the fix together.

Preview SubBlockRow and SubBlockRowView now pin rows to h-5, with comments tying that height to the handle-position contract so CSS and constants stay aligned.

Reviewed by Cursor Bugbot for commit ef405af. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR aligns condition and router handles with their rendered rows. The main changes are:

  • Changes the first handle offset from 60px to 59px.
  • Changes the condition row pitch from 29px to 28px.
  • Fixes editor and preview summary rows at 20px high.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.
  • Editor and preview rows use the same 20px height, 8px gap, and shared handle offsets.

Important Files Changed

Filename Overview
packages/workflow-renderer/src/dimensions.ts Updates shared handle offsets to match the 20px row height and 8px row gap.
packages/workflow-renderer/src/workflow-block/sub-block-row-view.tsx Fixes collapsed editor summary rows at the height assumed by handle positioning.
apps/sim/app/workspace/[workspaceId]/w/components/preview/components/preview-workflow/components/block/block.tsx Applies the same fixed summary-row height in workflow previews.

Reviews (1): Last reviewed commit: "fix(workflow): align condition/router ha..." | Re-trigger Greptile

@waleedlatif1
waleedlatif1 merged commit a360cd4 into staging Jul 22, 2026
20 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/condition-handle-row-drift branch July 22, 2026 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant