Fix dashed wire anchors at any zoom and let endpoints be dragged to reorder #38

Merged
rob merged 3 commits from endpoint-reorder into main 2026-10-20 14:40:28 +00:00
Collaborator

Two node builder changes.

The dashed "uses" wires between an endpoint and its setting or heater drifted below their rows at any zoom other than 100%. The row anchor added its 26px title-line offset in screen pixels rather than world units, so the error grew as you zoomed out. Measured in the browser at 60% zoom the wire ends now sit within half a pixel of the row's title line.

Endpoint rows can be dragged up and down within their node. The drag starts after 8px of vertical movement so a plain click still selects, the row lifts while dragging, and rows swap once the pointer passes their midpoint so they don't flip back and forth. The new order feeds the YAML and the automatic indices. Moving an endpoint between nodes is not included.

Tested with node --test (20 passing, 1 skipped), html-validate, and a Chromium run that reorders a row, checks the YAML order and confirms a click still selects without moving anything.

Two node builder changes. The dashed "uses" wires between an endpoint and its setting or heater drifted below their rows at any zoom other than 100%. The row anchor added its 26px title-line offset in screen pixels rather than world units, so the error grew as you zoomed out. Measured in the browser at 60% zoom the wire ends now sit within half a pixel of the row's title line. Endpoint rows can be dragged up and down within their node. The drag starts after 8px of vertical movement so a plain click still selects, the row lifts while dragging, and rows swap once the pointer passes their midpoint so they don't flip back and forth. The new order feeds the YAML and the automatic indices. Moving an endpoint between nodes is not included. Tested with `node --test` (20 passing, 1 skipped), html-validate, and a Chromium run that reorders a row, checks the YAML order and confirms a click still selects without moving anything.
Fix dashed wire anchors at any zoom and let endpoints be dragged to reorder
All checks were successful
CI / check (pull_request) Successful in 10s
CI / deploy (pull_request) Has been skipped
0e11353bec
The row anchor added its 26px title offset in screen pixels, so the
setting and heater wires sat below their rows at anything but 100%.

Dragging an endpoint row up or down moves it within its node once the
pointer has travelled 8px; rows swap when the pointer passes their
midpoint. The order feeds the YAML and the automatic indices.
Slide endpoint rows into place when reordering
All checks were successful
CI / check (pull_request) Successful in 11s
CI / deploy (pull_request) Has been skipped
4610699940
Rows are in normal flow, so a swap jumped. Before each update during a
row drag the old offsets are snapshotted and any row that moved is
animated from there with the Web Animations API. A fresh slide starts
from wherever the row is on screen, so passing several rows quickly
doesn't snap.
Keep wires attached to rows while they slide
All checks were successful
CI / check (pull_request) Successful in 10s
CI / deploy (pull_request) Has been skipped
500ba95236
Ports are re-measured on every animation frame while rows are sliding,
rendered synchronously so the wires paint in the same frame as the row.
rob merged commit e26c824ffb into main 2026-10-20 14:40:28 +00:00
rob deleted branch endpoint-reorder 2026-10-20 14:40:28 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rob/CamperCan!38
No description provided.