Right-click context menus on canvas nodes (0285 PR4) - #425
Merged
Conversation
PR4 of exploration 0285: add an opt-in `nodeContextActions` prop to the CanvasV3 renderer that wraps each node island in the shared @xnetjs/ui ContextMenu, opening on the contextmenu event. The web CanvasView builds the verb list from commandsForScopes(['surface:canvas']). Right-clicking a node outside the selection selects it first (else keeps the selection); the drawing controller still ignores right-click pointerdown. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: xNet Test <test@xnet.dev>
Contributor
🖼️ UI changes in this PRInteractionsAuto-captured by CI · run. Informational — not a blocking check. |
Contributor
|
Preview removed for PR #425. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Completes the last deferred item of exploration 0285 — PR4 Canvas.
What
Right-clicking a canvas node now opens a context menu with that node's actions, matching the right-click menus already shipped across the rest of the UI (Explorer, tables, comms, tabs, data cards).
How
packages/canvas/src/renderer/CanvasV3.tsx— new opt-in propnodeContextActions?: (nodeId: string) => Action[]. When present, each node island is wrapped in@xnetjs/ui'sContextMenu(adisplay:contentstrigger, so it adds no box around the absolutely-positioned island; the menu anchors at the pointer). The menu opens on thecontextmenuevent; actions build lazily on open. When the prop is absent the renderer is byte-for-byte unchanged.apps/web/src/components/CanvasView.tsx— builds the verb list fromgetCommandRegistry().commandsForScopes(['surface:canvas']), formatting shortcuts and dispatching viarunCommand.drawing-tools.test.ts); the menu rides thecontextmenuevent, so pan/marquee are untouched.Testing
@xnetjs/canvasandxnet-webtypecheck clean.canvas-v3.test.tsx(right-click opens the menu + selects-first + runs an item; opt-in test confirms no menu without the prop).@xnetjs/canvasis private andapps/webis an app. Changelog fragment added (apptag).🤖 Generated with Claude Code