Commit Graph

7 Commits

Author SHA1 Message Date
Benjamin Lu
9c771889ec Revert "Add node slots to layout tree"
This reverts commit 460493a620.
2025-08-14 21:39:27 -04:00
Benjamin Lu
646818ca12 Reapply "Add node slots to layout tree"
This reverts commit 236fecb549.
2025-08-14 21:39:27 -04:00
Benjamin Lu
236fecb549 Revert "Add node slots to layout tree"
This reverts commit 460493a620.
2025-08-14 13:14:50 -04:00
Benjamin Lu
460493a620 Add node slots to layout tree 2025-08-14 12:22:10 -04:00
bymyself
b09419c4d5 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 <noreply@anthropic.com>
2025-08-13 01:59:18 -07:00
bymyself
4ea9ec9e4b 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 <noreply@anthropic.com>
2025-08-13 01:38:09 -07:00
bymyself
43d9678e68 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 <noreply@anthropic.com>
2025-08-13 00:26:00 -07:00