Skip to content

[DS 2.0] Render the default canvas port at the designed 8px - #122

Draft
librowski wants to merge 2 commits into
ds2-canvas-edgesfrom
ds2-canvas-ports
Draft

[DS 2.0] Render the default canvas port at the designed 8px#122
librowski wants to merge 2 commits into
ds2-canvas-edgesfrom
ds2-canvas-ports

Conversation

@librowski

@librowski librowski commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Problem

The default port declares content 4px + border 2px per side with box-sizing: content-box, intending an 8px outer size. The base stylesheet of @xyflow/react 12.10.0 imposes min-width: 5px; min-height: 5px on handles; with content-box the minimum applies to the content, so the effective size was 9x9px. Hover (content 12px) was already correct at 16px.

Change

  • handle.module.css: min-width: 0; min-height: 0 on the base handle rule.
  • check-built-css.ts: the built base .react-flow__handle rule must carry the complete geometry (width/height, border, box-sizing, zero minimums), so a regression fails the build check; built-css-pitfalls.md documents the inherited-minimum trap.
  • Changeset: @workflowbuilder/ui patch.

Verification

Build, check:built-css, ui tests and stylelint pass. Manual browser pass in the demo (Simple Workflow, 30 handles, layout px via offsetWidth): default and connectionindicator 8x8, handle hover 16x16, node hover indicators 16x16, connectingfrom 8x8 with crosshair, top/bottom handle rules only reposition (size unchanged). jsdom cannot measure layout, so the automated part is the built-CSS contract.

Follow-up in this PR: target port while connecting

React Flow captures the pointer on the dragged handle, so the node under the cursor never gets :hover and its ports stayed at 8px during a connection while the source showed 16px. .connectingto now shares the .connectingfrom rule: the target grows to the 16px active port, other ports stay 8px, drop still creates the edge (verified in the demo with the built package). Design has Default and Hover port states only; design is asked to confirm that Hover is the intended look for the connecting target. Changeset: @workflowbuilder/ui patch.

xyflow's 5px minimum applies to the content box and expands the bordered port to 9px.
Reset both minimums so 4px content plus 2px borders remains 8px.
React Flow captures the pointer on the dragged handle, so the node under
the cursor never receives :hover and its ports stayed at the 8px default
during a connection. The connectingto state now shares the connectingfrom
rule, so the target shows the same 16px active port as the source.
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