Repository navigation
Commit fbbaf93
authored
Fixes #1575
Owner: Dev3
Reviewer: Reviewer
Written-by: Dev-3
Base: `9b866a5c797e8efe95e445885b69da4b8ca5c35b` (`main`, #1556)
Tip: `91c6dc037dd32a6fefff1e7a8f8bbde199e17517`
Tree: `4e7e7f74f2f1bcd308902b486cdc98b81b756f5b`
Dragging the leftmost, rightmost or topmost node in the drawer left it
pinned on screen while its stored coordinate moved. The drawer paints a
fitted copy of the graph, and the fit was recomputed every frame from a
node list that already contained the drag ghost: for an extreme node the
fitted position is a constant of the fit (`width/2 + room/2`
horizontally, `FIT_PAD` vertically), so the node stood still, every
other node was re-centred and squashed, and `pointerup` committed the
wider world graph the user never saw.
The fit is now computed from `workflow.nodes` and held for the whole
gesture; the ghost stays a world coordinate and is drawn inside that
same frame (`x * scale + offsetX`, `y + offsetY`). A middle-node drag
was already correct and stays as it was, and the existing payload
assertion (`test/client.test.js:234`) is untouched.
## What changed
- `plugins/workflow/client.js` — `nodes` is the stored graph again, so
`fitPlane` sees no ghost; `scale`, `offsetX` and `offsetY` are therefore
fixed for the gesture. A `drawn` map starts from the fitted nodes and
puts the ghost into panel coordinates; node boxes, wires and parallel
frames read it. `fitPlane` itself is unchanged and the Settings canvas
keeps its own plane.
- `plugins/workflow/test/client.test.js` — three tests. Rightmost: in a
span-344 graph (scale exactly 0.5) drag 40px right and assert the node's
`style.left` grows 40px while the other two nodes' `style.left` do not
move, then the commit is `344 + 80`. Topmost: drag 40px up and assert
`style.top` falls 40px, the others do not move, and the commit is `-40`.
Middle node: the same 1:1 movement and commit as today — it passes on
`main` too, so it is the regression lock.
- `changelog.d/1575-drawer-drag-extreme-node.fixed.md`.
Byte proof that `main`'s own work is untouched: the branch is based on
`9b866a5c` (the tip's parent), and `git diff 9b866a5 91c6dc0 --
plugins/workflow/client.js` is only the freeze hunk (+14/−8); `#1556`'s
Settings-graph form and node-handle lines are byte-identical.
## Red, then green
At live `main` `9b866a5c`, source untouched, with only the three new
tests (`plugins/workflow/test/client.test.js`):
- **46 tests / 44 pass / 2 fail.**
- `not ok 2 - dragging the rightmost node moves it on screen inside the
frame the drag started with (#1575)` — `expected: 224`, `actual: 184`,
at `client.test.js:301` (the rightmost node did not move at all).
- `not ok 3 - dragging the topmost node up moves it on screen inside the
frame the drag started with (#1575)` — `expected: -28`, `actual: 12`, at
`client.test.js:325` (the topmost node stayed on the `FIT_PAD` line).
- `ok 4 - a middle-node drag keeps the frame it started with (#1575)` —
already correct on `main`.
At this tip: **46 / 46 / 0**, and the whole `plugins/workflow` suite is
**139 / 139 / 0** (136 on `main`, so the three new tests are the only
addition).
## Verification at this tip
`TZ=UTC ARCH_DOCS_BASE=9b866a5c npm_config_cache=<writable> npm run
verify` — exit 0: core **1868**, social 527, tree 125, timeline 125,
workflow **139**, `.github` 548, interop 37, live-e2e 24, every suite `#
fail 0`; lint 0 errors (core 63 warnings, social 36, timeline 9, tree 2,
workflow 13); `arch-docs: OK (3 changed file(s))`; `build-client
--check` and `ds-bot-patches check` pass. `node
.github/scripts/changelog.mjs check` — 63 fragments well formed.
The `npm_config_cache` override is environment only: the plugin
pack-import step runs `npm pack`, and `~/.npm` is read-only in my
sandbox. The counts are from this tip (`91c6dc03`, tree `4e7e7f74`).
Not run: the smoke test and the test bench (no `index.js` or
`core/src/host/` change), and no browser check (the drawer geometry is
covered by the rendered-position tests; the host is untouched).
Docs-not-needed: `#1575` limits the change to
`plugins/workflow/client.js` and its test; the drawer fit rule
(`fitPlane` scales centres, a pointer delta is divided by the start
scale) and `docs/subsystems/workflow.md` are unchanged.
Risk: T2 — `plugins/**` sets the tier; `plugins/workflow/test/**` and
`changelog.d/**` are T1.
## Checkpoint
<!-- flybot:checkpoint -->
```json
{
"pr": 1576,
"claim": "Dev3",
"issue": 1575,
"summary": "Dragging an extreme node in the workflow drawer pinned it while the fit was recomputed from a node list that already held the drag ghost: the node sat still, the rest of the graph re-centred and shrank, and pointerup stored the wider graph. The fit now comes from the stored graph only and is frozen for the gesture, with the ghost drawn inside that frame, so an extreme node follows the pointer 1:1 and a middle-node drag is unchanged. Pointerup still commits the world coordinates from the start scale. The new tests assert rendered positions, not just the payload.",
"files": [
"plugins/workflow/client.js",
"plugins/workflow/test/client.test.js",
"changelog.d/1575-drawer-drag-extreme-node.fixed.md"
],
"checks": {
"ran": "TZ=UTC ARCH_DOCS_BASE=9b866a5c npm run verify; plugins/workflow npm test; base-plus-tests-only red run at 9b866a5",
"result": "green",
"at": "91c6dc037dd32a6fefff1e7a8f8bbde199e17517"
},
"next": "none — ready for review at this tip"
}
```
<!-- /flybot:checkpoint -->
1 parent 59fb637 commit fbbaf93
3 files changed
Lines changed: 107 additions & 8 deletions
File tree
- changelog.d
- plugins/workflow
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
617 | 617 | | |
618 | 618 | | |
619 | 619 | | |
620 | | - | |
| 620 | + | |
621 | 621 | | |
622 | | - | |
623 | | - | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
624 | 625 | | |
625 | | - | |
626 | 626 | | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
627 | 633 | | |
628 | 634 | | |
629 | 635 | | |
| |||
688 | 694 | | |
689 | 695 | | |
690 | 696 | | |
691 | | - | |
692 | | - | |
| 697 | + | |
| 698 | + | |
693 | 699 | | |
694 | 700 | | |
695 | 701 | | |
| |||
700 | 706 | | |
701 | 707 | | |
702 | 708 | | |
703 | | - | |
| 709 | + | |
704 | 710 | | |
705 | 711 | | |
706 | 712 | | |
707 | 713 | | |
708 | 714 | | |
709 | 715 | | |
710 | 716 | | |
711 | | - | |
| 717 | + | |
712 | 718 | | |
713 | 719 | | |
714 | 720 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
265 | 357 | | |
266 | 358 | | |
267 | 359 | | |
| |||
0 commit comments