Skip to content

Commit 1d5cb40

Browse files
DrJKLampagent
andcommitted
docs: correct geometry migration notes
Amp-Thread-ID: https://ampcode.com/threads/T-019fce27-b501-70c8-a0a8-df3eb8751aa2 Co-authored-by: Amp <amp@ampcode.com>
1 parent bd73025 commit 1d5cb40

1 file changed

Lines changed: 20 additions & 16 deletions

File tree

docs/architecture/ecs-migration-plan.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,9 @@ entity now has exactly one write path, and the workarounds that existed because
434434
writes bypassed it are gone.
435435
436436
**One write path per entity.** Whole-value assignment through `pos` / `size` is
437-
the only way geometry is written; the setters commit. Element-wise writes reach
438-
the backing `Rectangle` and never the store, so all of them were converted —
439-
in three passes, as the forms became apparent:
437+
the normal path, and the setters commit to the store. `createGeometryView`
438+
commits indexed writes too. Most in-repo indexed writes now use whole-value
439+
assignments. The migration found three forms:
440440
441441
| Form | Example | Where it hid |
442442
| ------------------ | ------------------------------------ | -------------------- |
@@ -450,31 +450,35 @@ reached the store, and `LGraph.configure` carried a local workaround
450450
others had none.
451451
452452
**Groups and reroutes joined the store.** `GroupLayout` is id/position/size
453-
with no zIndex or spatial index — groups draw beneath nodes in insertion order
454-
and nothing queries them positionally — and geometry is a single
453+
with no zIndex or spatial index. Groups draw beneath nodes in insertion order,
454+
and nothing queries them positionally. Geometry is a single
455455
`setGroupBounds` operation, because `pos` and `size` are two views onto one
456456
`Rectangle` and must never be stored apart. Reroutes went further: `posInternal`
457457
is deleted, `pos` reads the stored point, and a reroute registers its own
458458
geometry in its constructor, which removed two seeding sites.
459459
460-
**The store -> legacy copy is gone.** `LGraphNode` refreshes `_posSize` from the
461-
layout store when its geometry version changes, so serialization and legacy
462-
rendering still read current geometry through `this.pos` / `this.size`.
463-
`notifyLayoutChanges` forwards store-originated resize callbacks and canvas
464-
invalidation without copying geometry back into the node.
460+
**`LGraphNode` no longer runs a continuous store-to-class sync.** When code
461+
reads geometry, the node checks the global geometry version and copies the
462+
stored rectangle into `_posSize` if its cache is stale. Serialization and legacy
463+
rendering read current values through `this.pos` and `this.size` without walking
464+
every node after each layout change.
465465
466-
**Not done, and each needs a decision rather than more inference:**
466+
While Vue-node rendering is active, `notifyLayoutChanges` dirties the canvas for
467+
node layout changes. It also calls `onResize` for `resizeNode` and
468+
`batchUpdateBounds` operations. It does not copy geometry into nodes.
469+
470+
**Open decisions:**
467471
468472
1. The geometry views. The hand-written `size` Proxy is gone, replaced by
469473
`createGeometryView` over `pos` and `size` on `LGraphNode` plus `pos`,
470-
`size` and `bounding` on `LGraphGroup`. Every in-repo element write is gone,
471-
so their only remaining job is third-party `node.size[1] = h`. Retiring them
472-
means accepting that ecosystem writes stop reflowing, or landing a stable
473-
resize API.
474+
`size` and `bounding` on `LGraphGroup`. The views still handle the indexed
475+
position write in `distributeNodes()` and extension writes such as
476+
`node.size[1] = h`. Retiring them requires whole-value assignment in
477+
`distributeNodes()` and a stable resize API for extensions.
474478
2. Subgraph IO nodes have conforming write paths but no store entry. A keyed
475479
entry needs subgraph scoping (`SUBGRAPH_INPUT_ID` is a constant shared by
476480
every subgraph) and `Subgraph.id` is reassigned by `clear()`, so the key can
477-
go stale — the pattern rejected for the link store. Nothing needs keyed
481+
go stale. The link store rejected the same pattern. Nothing needs keyed
478482
access, since callers reach them as `subgraph.inputNode`.
479483
3. Two hit-testing systems: litegraph against class geometry, `layoutStore`
480484
against a spatial index. Node bounds are duplicated between `_boundingRect`

0 commit comments

Comments
 (0)