Repository navigation
feat(renderer): a right-click or Control-click on a node tells the host, for its menu (macOS) - #104
Merged
Merged
Conversation
…st, for its menu (macOS) onNodeContextMenu is the Mac's twin of onNodeLongPress: a right-click or Control-click on a node reports the node, where the click was, the card's frame on screen and what a preview of it draws. A click on empty canvas reports nothing. The click comes from the same source as the trackpad double-tap: a host's ScrollWheelBridge, as onContextClick in the canvas's own coordinates, when it has one; otherwise the library's bridge, which watches context clicks window-wide only while a canvas has a host listening, and never consumes them, so anything else in the window keeps its own menu. Refs: #74 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The macOS half of #74. iOS has
onNodeLongPress(#103); this adds its Mac twin.onNodeContextMenu(node, press): a right-click or Control-click on a node reports the node and aNodeLongPress(where the click was, the card's frame on screen, and what a preview of it draws). A click on empty canvas reports nothing. The library only reports; the host draws its own menu.ScrollWheelBridge, sendingonContextClickin the canvas's own coordinates, when the host has one;WorkspaceJsonCanvasGesture, which watches context clicks window-wide only while a canvas has a host listening (setContextClickTracking, counted per canvas). It never consumes them, so the rest of the window keeps its own menus.nodeAt, smallest area wins) and one way of describing the press (pressOn).Checked in Workspace's macOS app with
all-node-types.canvas: a right-click on the text, link and image cards reports each card; the group and empty canvas report nothing. Typecheck unchanged; 208 tests pass.🤖 Generated with Claude Code