Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
f42a4dd
[feat] Add core Vue widget infrastructure
christian-byrne Jun 24, 2025
2dcfe84
[feat] Add Vue widget registry system
christian-byrne Jun 24, 2025
06d0a63
[feat] Add Vue input widgets
christian-byrne Jun 24, 2025
ac60d1c
[feat] Add Vue selection widgets
christian-byrne Jun 24, 2025
9c4d782
[feat] Add Vue visual widgets
christian-byrne Jun 24, 2025
6e04cb7
[feat] Add Vue action widgets
christian-byrne Jun 24, 2025
19084e2
[feat] TransformPane - Viewport synchronization layer for Vue nodes (…
christian-byrne Aug 6, 2025
9db96f2
Update locales [skip ci]
invalid-email-address Aug 7, 2025
fc6943c
Fix TransformPane pos/size (#4826)
christian-byrne Aug 8, 2025
ac17752
Update locales [skip ci]
invalid-email-address Aug 8, 2025
301355e
refactor(litegraph): decouple render-time state from models for rerou…
benceruleanlu Aug 8, 2025
4171219
Revert "refactor(litegraph): decouple render-time state from models f…
benceruleanlu Aug 8, 2025
2b9a9e2
test(ci): skip transformPerformance suite on CI (#4843)
benceruleanlu Aug 9, 2025
8df41ab
Add vue node feature flag (#4927)
benceruleanlu Aug 12, 2025
c773230
feat: Implement CRDT-based layout system for Vue nodes (#4959)
christian-byrne Aug 17, 2025
889d136
[chore] Extract link rendering out of LGraphCanvas (#4994)
benceruleanlu Aug 18, 2025
0dd4ff2
refactor: Reorganize layout system into new renderer architecture (#5…
christian-byrne Aug 18, 2025
bfcbcf4
[refactor] Reorganize Vue nodes to domain-driven design architecture …
christian-byrne Aug 18, 2025
d1ed5ec
fix: Initialize Vue node manager when first node is added to empty gr…
christian-byrne Aug 19, 2025
b2a828d
[bugfix] Fix Vue node import path after refactoring
christian-byrne Aug 19, 2025
934c650
Remove layout logging noise from console (#5101)
christian-byrne Aug 19, 2025
5a74c01
remove logging from vue node layouting modules (#5111)
christian-byrne Aug 19, 2025
5171dec
feat: Add slot registration and spatial indexing for hit detection
benceruleanlu Aug 20, 2025
ba1fa1b
Revert "feat: Add slot registration and spatial indexing for hit dete…
benceruleanlu Aug 20, 2025
4a7c955
[bugfix] Fix link center dot hit detection when marker is disabled (#…
benceruleanlu Aug 20, 2025
1447b15
[bugfix] Hide center dot when dragging links (#5133)
benceruleanlu Aug 21, 2025
57db10f
feat: v3 style of node body (#5169)
LittleSound Aug 23, 2025
3982f29
Update lockfile after rebase (#5254)
benceruleanlu Aug 30, 2025
0830959
Fix lodash import (#5269)
benceruleanlu Aug 30, 2025
2a5e0d2
Decouple link and slot hit-testing out of Litegraph (#5134)
benceruleanlu Sep 1, 2025
62096d4
chore: Empty commit to trigger CI checks
benceruleanlu Sep 1, 2025
da042ae
[refactor] Remove unused legacy mutation types from layout system (#5…
christian-byrne Sep 1, 2025
3ce3b67
feat: localization fields (#5318)
LittleSound Sep 3, 2025
c6fc8e6
fix: remove clipping by removing unnecessary css contain (#5327)
simula-r Sep 4, 2025
969c8e6
[bugfix] Remove placeholder IMAGE widget to restore previous function…
benceruleanlu Sep 4, 2025
f83801e
- Convert class-based LayoutMutations to useLayoutMutations() composa…
christian-byrne Sep 4, 2025
1dbbf20
feat: widget styles for V3 UI (#5320)
LittleSound Sep 4, 2025
32cffa6
refactor: v3 ui slots connection dots (#5316)
LittleSound Sep 4, 2025
8a10387
add explicit typing on component IDs (#5352)
christian-byrne Sep 4, 2025
c30f5a4
Remove IMAGE widget cont. (#5355)
benceruleanlu Sep 4, 2025
6a3c075
Removes node's dependency on LGraph for access to layout mutations co…
christian-byrne Sep 4, 2025
2a64f53
Merge remote-tracking branch 'origin/main' into vue-nodes-migration
benceruleanlu Sep 4, 2025
f99c9de
[fix] Disable link markers on dragged connections (#5358)
benceruleanlu Sep 4, 2025
1480dd7
[bugfix] Fix NodeHeader test workflow path (#5359)
benceruleanlu Sep 4, 2025
2425f65
[Vue Nodes] Fix Node Header Tests (#5360)
benceruleanlu Sep 4, 2025
0f5315f
Update test expectations [skip ci]
invalid-email-address Sep 4, 2025
7b7f9bb
remove crdt ADR (moved to separate PR)
christian-byrne Sep 5, 2025
7130794
update adr README
christian-byrne Sep 5, 2025
73a1fee
removed unused IMAGE widget enum value
christian-byrne Sep 5, 2025
b0f2a1d
remove all unused (knip pass)
christian-byrne Sep 5, 2025
2f512b8
remove debug overlay panel
christian-byrne Sep 5, 2025
4fc8984
simplify unit tests
christian-byrne Sep 5, 2025
7149af6
change name "transformPaneEnabled" => "isVueNodesEnabled"
christian-byrne Sep 5, 2025
0b94158
remove debug viewport visualizer
christian-byrne Sep 5, 2025
3e5effe
remove debug viewport visualizer prop
christian-byrne Sep 5, 2025
9ab075f
remove outdated README
christian-byrne Sep 5, 2025
1e30756
skip all vue node operations if feature is turned off
christian-byrne Sep 5, 2025
e8dae57
remove debug logging and setting
christian-byrne Sep 5, 2025
f6051f6
remove event forwarding hack. todo: add link moving in vue
christian-byrne Sep 5, 2025
df36693
cleanup comments
christian-byrne Sep 5, 2025
358d98e
cleanup comments
christian-byrne Sep 5, 2025
b7fd1f4
add missing translations
christian-byrne Sep 5, 2025
0aed837
use camelCase for all non-component files
christian-byrne Sep 5, 2025
7d8bdcb
remove debug viewport test
christian-byrne Sep 5, 2025
6eeba70
- Fix memory leaks in node deletion (#5345)
christian-byrne Sep 5, 2025
817f4d0
remove redundant comment
christian-byrne Sep 5, 2025
07b7ed9
use camelcase for layoutStore filename
christian-byrne Sep 5, 2025
85fa2f4
removed unused type guards
christian-byrne Sep 5, 2025
8e098fc
simplify widget registration
christian-byrne Sep 5, 2025
896e44f
move back test that was mistakenly moved
christian-byrne Sep 5, 2025
f6ae1b6
remove unused typeguards
christian-byrne Sep 5, 2025
c52c798
removed unused node def type guards
christian-byrne Sep 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Decouple link and slot hit-testing out of Litegraph (#5134)
* [feat] TransformPane - Viewport synchronization layer for Vue nodes (#4304)

Co-authored-by: Claude <[email protected]>
Co-authored-by: Benjamin Lu <[email protected]>
Co-authored-by: github-actions <[email protected]>

* Update locales [skip ci]

* Update locales [skip ci]

* Add vue node feature flag (#4927)

* feat: Implement CRDT-based layout system for Vue nodes (#4959)

* feat: Implement CRDT-based layout system for Vue nodes

Major refactor to solve snap-back issues and create single source of truth for node positions:

- Add Yjs-based CRDT layout store for conflict-free position management
- Implement layout mutations service with clean API
- Create Vue composables for layout access and node dragging
- Add one-way sync from layout store to LiteGraph
- Disable LiteGraph dragging when Vue nodes mode is enabled
- Add z-index management with bring-to-front on node interaction
- Add comprehensive TypeScript types for layout system
- Include unit tests for layout store operations
- Update documentation to reflect CRDT architecture

This provides a solid foundation for both single-user performance and future real-time collaboration features.

Co-Authored-By: Claude <[email protected]>

* style: Apply linter fixes to layout system

* fix: Remove unnecessary README files and revert services README

- Remove unnecessary types/README.md file
- Revert unrelated changes to services/README.md
- Keep only relevant documentation for the layout system implementation

These were issues identified during PR review that needed to be addressed.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* refactor: Clean up layout store and implement proper CRDT operations

- Created dedicated layoutOperations.ts with production-grade CRDT interfaces
- Integrated existing QuadTree spatial index instead of simple cache
- Split composables into separate files (useLayout, useNodeLayout, useLayoutSync)
- Cleaned up operation handlers using specific types instead of Extract
- Added proper operation interfaces with type guards and extensibility
- Updated all type references to use new operation structure

The layout store now properly uses the existing QuadTree infrastructure for
efficient spatial queries and follows CRDT best practices with well-defined
operation interfaces.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* refactor: Extract services and split composables for better organization

- Created SpatialIndexManager to handle QuadTree operations separately
- Added LayoutAdapter interface for CRDT abstraction (Yjs, mock implementations)
- Split GraphNodeManager into focused composables:
  - useNodeWidgets: Widget state and callback management
  - useNodeChangeDetection: RAF-based geometry change detection
  - useNodeState: Node visibility and reactive state management
- Extracted constants for magic numbers and configuration values
- Updated layout store to use SpatialIndexManager and constants

This improves code organization, testability, and makes it easier to swap
CRDT implementations or mock services for testing.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* Add node slots to layout tree

* Revert "Add node slots to layout tree"

This reverts commit 460493a.

* Remove slots from layoutTypes

* Totally not scuffed renderer and adapter

* Revert "Totally not scuffed renderer and adapter"

This reverts commit 2b9d83e.

* Revert "Remove slots from layoutTypes"

This reverts commit 18f78ff.

* Reapply "Add node slots to layout tree"

This reverts commit 236fecb.

* Revert "Add node slots to layout tree"

This reverts commit 460493a.

* docs: Replace architecture docs with comprehensive ADR

- Add ADR-0002 for CRDT-based layout system decision
- Follow established ADR template with persuasive reasoning
- Include performance benefits, collaboration readiness, and architectural advantages
- Update ADR index

---------

Co-authored-by: Claude <[email protected]>
Co-authored-by: Benjamin Lu <[email protected]>

* [chore] Extract link rendering out of LGraphCanvas (#4994)

* feat: Implement CRDT-based layout system for Vue nodes

Major refactor to solve snap-back issues and create single source of truth for node positions:

- Add Yjs-based CRDT layout store for conflict-free position management
- Implement layout mutations service with clean API
- Create Vue composables for layout access and node dragging
- Add one-way sync from layout store to LiteGraph
- Disable LiteGraph dragging when Vue nodes mode is enabled
- Add z-index management with bring-to-front on node interaction
- Add comprehensive TypeScript types for layout system
- Include unit tests for layout store operations
- Update documentation to reflect CRDT architecture

This provides a solid foundation for both single-user performance and future real-time collaboration features.

Co-Authored-By: Claude <[email protected]>

* style: Apply linter fixes to layout system

* fix: Remove unnecessary README files and revert services README

- Remove unnecessary types/README.md file
- Revert unrelated changes to services/README.md
- Keep only relevant documentation for the layout system implementation

These were issues identified during PR review that needed to be addressed.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* refactor: Clean up layout store and implement proper CRDT operations

- Created dedicated layoutOperations.ts with production-grade CRDT interfaces
- Integrated existing QuadTree spatial index instead of simple cache
- Split composables into separate files (useLayout, useNodeLayout, useLayoutSync)
- Cleaned up operation handlers using specific types instead of Extract
- Added proper operation interfaces with type guards and extensibility
- Updated all type references to use new operation structure

The layout store now properly uses the existing QuadTree infrastructure for
efficient spatial queries and follows CRDT best practices with well-defined
operation interfaces.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* refactor: Extract services and split composables for better organization

- Created SpatialIndexManager to handle QuadTree operations separately
- Added LayoutAdapter interface for CRDT abstraction (Yjs, mock implementations)
- Split GraphNodeManager into focused composables:
  - useNodeWidgets: Widget state and callback management
  - useNodeChangeDetection: RAF-based geometry change detection
  - useNodeState: Node visibility and reactive state management
- Extracted constants for magic numbers and configuration values
- Updated layout store to use SpatialIndexManager and constants

This improves code organization, testability, and makes it easier to swap
CRDT implementations or mock services for testing.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* Add node slots to layout tree

* Revert "Add node slots to layout tree"

This reverts commit 460493a.

* Remove slots from layoutTypes

* Totally not scuffed renderer and adapter

* Revert "Totally not scuffed renderer and adapter"

This reverts commit 2b9d83e.

* Revert "Remove slots from layoutTypes"

This reverts commit 18f78ff.

* Reapply "Add node slots to layout tree"

This reverts commit 236fecb.

* Revert "Add node slots to layout tree"

This reverts commit 460493a.

* docs: Replace architecture docs with comprehensive ADR

- Add ADR-0002 for CRDT-based layout system decision
- Follow established ADR template with persuasive reasoning
- Include performance benefits, collaboration readiness, and architectural advantages
- Update ADR index

* Add node slots to layout tree

* Revert "Add node slots to layout tree"

This reverts commit 460493a.

* Remove slots from layoutTypes

* Totally not scuffed renderer and adapter

* Remove unused methods in LGLA

* Extract slot position calculations to shared utility

- Create slotCalculations.ts utility for centralized slot position logic
- Update LGraphNode to delegate to helper while maintaining compatibility
- Modify LitegraphLinkAdapter to use layout tree positions when available
- Enable link rendering to use layout system coordinates instead of litegraph positions

This allows the layout tree to control link rendering positions, enabling proper
synchronization between Vue components and canvas rendering.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* [fix] Restore original link rendering behavior after refactor

This commit fixes several rendering discrepancies introduced during the link rendering refactor to ensure exact parity with the original litegraph implementation:

Path Shape Fixes:
- STRAIGHT_LINK: Now correctly applies l=10 offset to create innerA/innerB points and uses midX=(innerA.x+innerB.x)*0.5 for elbow placement, matching the original 6-segment path
- LINEAR_LINK: Restored 4-point path with l=15 directional offsets (start → innerA → innerB → end)

Arrow Rendering:
- computeConnectionPoint: Now always uses bezier math with 0.25 factor spline offsets regardless of render mode, ensuring arrow positions match original
- Arrow positions: Fixed to render at 0.25 and 0.75 positions along the path
- Arrow gating: Moved scale>=0.6 and highQuality checks to adapter layer to maintain PathRenderer purity
- Arrow shape: Restored original triangle dimensions (-5,-3) to (0,+7) to (+5,-3)

Center Marker:
- Fixed 'None' option: Center marker now correctly hidden when LinkMarkerShape.None is selected
- Center point calculation: Updated for all render modes to match original positions
- STRAIGHT_LINK center: Uses midX and average of innerA/innerB y-coordinates
- LINEAR_LINK center: Uses midpoint between innerA and innerB control points

These fixes ensure backward compatibility while maintaining the clean separation between the pure PathRenderer and litegraph-specific LitegraphLinkAdapter.

Fixes #Issue-Number

---------

Co-authored-by: bymyself <[email protected]>
Co-authored-by: Claude <[email protected]>

* feat: Add slot registration and spatial indexing for hit detection

- Implement slot registration for all nodes (Vue and LiteGraph)
- Add spatial indexes for slots and reroutes to improve hit detection performance
- Register slots when nodes are drawn via new registerSlots() method
- Update LayoutStore to use spatial indexing for O(log n) queries instead of O(n)

Resolves #5125

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* Revert "feat: Add slot registration and spatial indexing for hit detection"

This reverts commit 70fbfd0.

* feat: Add slot registration and spatial indexing for hit detection

- Implement slot registration for all nodes (Vue and LiteGraph)
- Add spatial indexes for slots and reroutes to improve hit detection performance
- Register slots when nodes are drawn via new registerSlots() method
- Update LayoutStore to use spatial indexing for O(log n) queries instead of O(n)

Resolves #5125

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* relocate slot update to layoutstore

* Revert "relocate slot update to layoutstore"

This reverts commit 0b17ef1.

* add useSlotLayoutSync

* feat: Extend Layout Store with CRDT support for links and reroutes

Move links and reroutes to be first-class CRDT entities in the Layout Store,
eliminating per-frame registration during rendering. This provides a ~100x
reduction in spatial index operations by using event-driven updates instead
of polling.

Key changes:
- Add CRDT maps for links and reroutes with automatic observers
- Add mutation operations for link/reroute lifecycle management
- Update LiteGraph to use mutations instead of direct store calls
- Remove per-frame updateLinkLayout and updateRerouteLayout calls

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* Scuffed diff, change to dirty later

* Fix reroute move desync

* Terrible reroute fixes

* Use LinkId for LinkLayout

* refactor: Remove unused duplicate layout type files

Deleted src/types/layoutTypes.ts and src/types/layoutOperations.ts
which were duplicates of src/renderer/core/layout/types.ts. These
files had zero imports and were creating confusion in the codebase.

The active types are in src/renderer/core/layout/types.ts which
is properly integrated with the current architecture.

🤖 Generated with Claude Code

Co-Authored-By: Claude <[email protected]>

* refactor: Extract layout source strings into LayoutSource enum

Replace hardcoded 'canvas' | 'vue' | 'external' string literals with a proper TypeScript enum for better type safety and maintainability. This change provides a single source of truth for layout source types and makes future modifications easier.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* refactor: Unify CRDT layout operations under type-safe entity bases

Replace node-centric BaseOperation with a clean hierarchy:
- Add OperationMeta base containing common fields (timestamp, actor, source, type)
- Introduce entity-specific bases (NodeOpBase, LinkOpBase, RerouteOpBase)
- Each operation now extends its appropriate entity base with proper typing
- Add entity discriminator field for runtime type narrowing

Benefits:
- Eliminates duplicate meta fields across link/reroute operations
- Provides type-safe discriminated unions for each entity type
- Enables clean extension path for future operation types
- Zero breaking changes - type-only refactor with no runtime impact

Also adds helper functions:
- getAffectedNodeIds() to extract node IDs affected by any operation
- Entity-specific helper checks for operation classification

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* Fix initial link seeding

* fix: Fix reroute hit detection and type consistency issues

- Use instanceof Reroute type guard instead of structural 'linkIds' check
- Remove unnecessary Number() conversions for reroute IDs (already numeric)
- Fix parentId truthiness bug (0 is valid parent ID)
- Pass numeric IDs directly in GraphCanvas seeding
- Add missing link/reroute methods to LayoutMutations interface
- Make hit test tolerance scale-aware using ctx.lineWidth and DPI

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* Add debug logs

* Add missing reroute path

* cleanup

* feat: Implement event-driven link layout sync

Remove layout store writes from render loop and update link geometry only on
actual changes (node move/resize, link/reroute operations, collapse toggles).

Key improvements:
- No layout writes during canvas render (decoupled from draw cycle)
- Link layouts update only on causal events via useLinkLayoutSync
- Hit testing remains precise using stored Path2D objects
- Optimized adapter: calculations only when enableLayoutStoreWrites=true
- Store-level deduplication prevents spatial index churn

Performance impact:
- Render path: Zero layout work, no equality checks, no store writes
- Event path: Direct writes with cheap store-level dedup
- Significant CPU savings per frame on complex graphs

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* feat: Implement DOM-based slot registration with unified position system

- Add centralized getSlotPosition() function in SlotCalculations
- Create SlotIdentifier utilities for consistent slot key generation
- Implement DOM-based slot registration composable with performance optimizations:
  - Cache slot offsets to avoid DOM reads during drag operations
  - Batch measurements via requestAnimationFrame
  - Skip redundant updates when bounds unchanged
- Update Vue slot components to register DOM positions
- Fix widget-to-input index mapping in NodeWidgets
- Prevent double registration when Vue nodes enabled

This improves slot hit-detection accuracy by using actual DOM positions
while maintaining performance through intelligent caching and batching.

🤖 Generated with Claude Code

Co-Authored-By: Claude <[email protected]>

* Remove unused files

* Remove duplicated markdown file

* Remove duplicated files and address knip concerns

* Remove outdated test

* warning comment

* Update test snapshots

---------

Co-authored-by: Christian Byrne <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: github-actions <[email protected]>
  • Loading branch information
4 people authored Sep 1, 2025
commit 2a5e0d231edca54d2078fdefc7165af056f398cc
69 changes: 66 additions & 3 deletions src/components/graph/GraphCanvas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ import type { LGraphCanvas, LGraphNode } from '@/lib/litegraph/src/litegraph'
import { layoutStore } from '@/renderer/core/layout/store/LayoutStore'
import { useLayout } from '@/renderer/core/layout/sync/useLayout'
import { useLayoutSync } from '@/renderer/core/layout/sync/useLayoutSync'
import { useLinkLayoutSync } from '@/renderer/core/layout/sync/useLinkLayoutSync'
import { useSlotLayoutSync } from '@/renderer/core/layout/sync/useSlotLayoutSync'
import { LayoutSource } from '@/renderer/core/layout/types'
import VueGraphNode from '@/renderer/extensions/vueNodes/components/LGraphNode.vue'
import { UnauthorizedError, api } from '@/scripts/api'
import { app as comfyApp } from '@/scripts/app'
Expand Down Expand Up @@ -283,6 +286,10 @@ watch(canvasRef, () => {
// Vue node lifecycle management - initialize after graph is ready
let nodeManager: ReturnType<typeof useGraphNodeManager> | null = null
let cleanupNodeManager: (() => void) | null = null

// Slot layout sync management
let slotSync: ReturnType<typeof useSlotLayoutSync> | null = null
let linkSync: ReturnType<typeof useLinkLayoutSync> | null = null
const vueNodeData = ref<ReadonlyMap<string, VueNodeData>>(new Map())
const nodeState = ref<ReadonlyMap<string, NodeState>>(new Map())
const nodePositions = ref<ReadonlyMap<string, { x: number; y: number }>>(
Expand Down Expand Up @@ -324,15 +331,46 @@ const initializeNodeManager = () => {
}))
layoutStore.initializeFromLiteGraph(nodes)

// Seed reroutes into the Layout Store so hit-testing uses the new path
for (const reroute of comfyApp.graph.reroutes.values()) {
const [x, y] = reroute.pos
const parent = reroute.parentId ?? undefined
const linkIds = Array.from(reroute.linkIds)
layoutMutations.createReroute(reroute.id, { x, y }, parent, linkIds)
}

// Seed existing links into the Layout Store (topology only)
for (const link of comfyApp.graph._links.values()) {
layoutMutations.createLink(
link.id,
link.origin_id,
link.origin_slot,
link.target_id,
link.target_slot
)
}

// Initialize layout sync (one-way: Layout Store → LiteGraph)
const { startSync } = useLayoutSync()
startSync(canvasStore.canvas)

// Initialize slot layout sync for hit detection
slotSync = useSlotLayoutSync()
if (canvasStore.canvas) {
slotSync.start(canvasStore.canvas as LGraphCanvas)
}

// Initialize link layout sync for event-driven updates
linkSync = useLinkLayoutSync()
if (canvasStore.canvas) {
linkSync.start(canvasStore.canvas as LGraphCanvas)
}

// Force computed properties to re-evaluate
nodeDataTrigger.value++
}

const disposeNodeManager = () => {
const disposeNodeManagerAndSyncs = () => {
if (!nodeManager) return
try {
cleanupNodeManager?.()
Expand All @@ -341,6 +379,19 @@ const disposeNodeManager = () => {
}
nodeManager = null
cleanupNodeManager = null

// Clean up slot layout sync
if (slotSync) {
slotSync.stop()
slotSync = null
}

// Clean up link layout sync
if (linkSync) {
linkSync.stop()
linkSync = null
}

// Reset reactive maps to inert defaults
vueNodeData.value = new Map()
nodeState.value = new Map()
Expand All @@ -360,7 +411,7 @@ watch(
if (enabled) {
initializeNodeManager()
} else {
disposeNodeManager()
disposeNodeManagerAndSyncs()
}
},
{ immediate: true }
Expand Down Expand Up @@ -509,7 +560,7 @@ const handleNodeSelect = (event: PointerEvent, nodeData: VueNodeData) => {
// Bring node to front when clicked (similar to LiteGraph behavior)
// Skip if node is pinned
if (!node.flags?.pinned) {
layoutMutations.setSource('vue')
layoutMutations.setSource(LayoutSource.Vue)
layoutMutations.bringNodeToFront(nodeData.id)
}
node.selected = true
Expand Down Expand Up @@ -827,5 +878,17 @@ onUnmounted(() => {
nodeManager.cleanup()
nodeManager = null
}

// Clean up slot layout sync
if (slotSync) {
slotSync.stop()
slotSync = null
}

// Clean up link layout sync
if (linkSync) {
linkSync.stop()
linkSync = null
}
})
</script>
112 changes: 0 additions & 112 deletions src/components/graph/debug/QuadTreeDebugSection.vue

This file was deleted.

112 changes: 0 additions & 112 deletions src/components/graph/debug/QuadTreeVisualization.vue

This file was deleted.

43 changes: 0 additions & 43 deletions src/components/graph/vueWidgets/WidgetButton.vue

This file was deleted.

Loading