Skip to content

[graph/canvas] refactor: implemented theme-driven cursor system#660

Merged
Yonava merged 12 commits into
mainfrom
yva/graph-cursor
Jun 11, 2026
Merged

[graph/canvas] refactor: implemented theme-driven cursor system#660
Yonava merged 12 commits into
mainfrom
yva/graph-cursor

Conversation

@Yonava

@Yonava Yonava commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Replaces the imperative GraphCursor plugin (with disabled, graphToCursorMap, activateCursorSelectMode) with a theme-based cursor system. Cursor state is now derived from the theme stack on each draw rather than managed through ref mutations scattered across plugins.

canvas.cursor theme key controls the global cursor; CURSOR_FALLBACK defers to element-level keys (eg. node.default.cursor, marquee.encapsulatedNodeBox.cursor)
Each plugin/feature that needs cursor control owns a small useFooCursorTheme composable that sets/removes its theme entries on activate/deactivate
Renames GraphUnderCursor.items → .elements and moves drag state to shared/drag/

Comment thread packages/graph/src/plugins/canvas/index.ts Outdated
@Yonava Yonava merged commit 92cdecf into main Jun 11, 2026
1 check failed
@Yonava Yonava deleted the yva/graph-cursor branch June 11, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[graph/canvas] replace useGraphCursor with declarative cursor theme tokens

2 participants