|
| 1 | +# Vue Nodes & LiteGraph Interaction Initiatives |
| 2 | + |
| 3 | +## Initiative 1: CRDT Layout Sync Reliability |
| 4 | +- **Goal:** Ensure LiteGraph node geometry stays aligned with Vue-managed DOM so ghost hit targets never occur. |
| 5 | +- **Scope:** |
| 6 | + - Update `layoutStore.batchUpdateNodeBounds` to surface changes through the existing `applyOperation`/`notifyChange` pipeline (or emit an equivalent `LayoutChange`). |
| 7 | + - Verify downstream listeners (`useLayoutSync`, link/slot sync) respond when DOM-driven measurements land. |
| 8 | + - Add regression coverage: unit test or integration harness exercising ResizeObserver-driven updates, asserting LiteGraph node.pos keeps pace. |
| 9 | + - Document behavior in layout store comments to prevent future bypasses. |
| 10 | +- **Deliverables:** Code changes + tests + release notes entry summarizing the fix. |
| 11 | +- **Risks/Mitigations:** |
| 12 | + - _Risk:_ Double-applying operations if observers already react elsewhere. _Mitigation:_ Audit listeners to ensure they only consume change events once. |
| 13 | + - _Risk:_ Performance regressions from extra change objects. _Mitigation:_ Benchmark batch updates on large graphs before merge. |
| 14 | +- **Next Steps:** |
| 15 | + 1. Implement the change in a PR branch (e.g. `fix/layout-batch-change`). |
| 16 | + 2. Run `pnpm test:unit` and relevant integration checks. |
| 17 | + 3. Prepare PR with reproduction + resolution notes. |
| 18 | + |
| 19 | +## Initiative 2: LiteGraph Pointer Handling Trim in Vue Mode |
| 20 | +- **Goal:** Let Vue-driven nodes fully own node-level pointer interactions while LiteGraph keeps canvas-wide controls. |
| 21 | +- **Scope:** |
| 22 | + - Introduce guard(s) in `LGraphCanvas` so node-specific handlers (`processMouseDown`, `#processNodeClick`, link slot targeting) early-exit when `LiteGraph.vueNodesMode` is true unless explicitly forwarded from Vue. |
| 23 | + - Optionally validate node hits against `layoutStore` before acting, reducing reliance on LiteGraph’s stale geometry. |
| 24 | + - Ensure link creation, reroute edits, groups, background panning remain intact. |
| 25 | + - Add targeted tests (unit or e2e) covering Vue mode click/drag behavior on empty canvas, node body, slots. |
| 26 | + - Update developer docs describing the event division of responsibilities. |
| 27 | +- **Deliverables:** Code adjustments + automated tests + doc updates. |
| 28 | +- **Risks/Mitigations:** |
| 29 | + - _Risk:_ Breaking legacy fallback when Vue nodes are disabled. _Mitigation:_ Gate new logic strictly on `LiteGraph.vueNodesMode`. |
| 30 | + - _Risk:_ Missing a pathway (e.g., double-click, middle-click). _Mitigation:_ Audit event map and add assertions/logging for unexpected fall-through. |
| 31 | +- **Next Steps:** |
| 32 | + 1. After Initiative 1 merges, branch (e.g. `feature/vue-node-pointer-guard`). |
| 33 | + 2. Implement guards + tests. |
| 34 | + 3. Validate with manual smoke test in Vue mode and legacy mode. |
| 35 | + |
| 36 | +--- |
| 37 | +*Prepared October 6, 2025.* |
0 commit comments