feat(editor): edge hover + edge menu + pattern picker + zoom indicator
Closes four operator complaints from the 0.5.3 review. 1. Edges now react to hover. Added an interaction layer between the edge painter and the endpoint nodes. A MouseRegion tracks the cursor in canvas coords; every move runs a spatial hit-test against each edge's bezier sampled at 24 points. The closest edge within 8 px highlights in the primary accent so the operator sees what they're aiming at. Cursor leaves canvas → highlight clears. 2. Right-click / long-press on edges opens a Disconnect menu. Same interaction layer carries `onSecondaryTapDown` and `onLongPressStart` handlers. Both run the same hit-test and pop the menu at the cursor. Disconnect clears the target's expression (step.with[field] = '' or outputs[name] = ''), edge disappears, target port flips outlined. 3. Long-press is now available alongside right-click EVERYWHERE the context menu lives — step nodes, port dots, edges. Trackpad-only users whose "two-finger click" isn't bound to secondary get the same affordances as mouse users. 4. Background pattern is now operator-selectable: cycles through dots → grid → blank via a small icon button on the bottom-right canvas controls. The button's icon and tooltip reflect the next state. Picked dots as the default because they're least visually noisy at scale. 5. Zoom indicator: a mono "100%" readout next to Fit-to- screen shows the current InteractiveViewer scale, updating live as the operator pinches / scrolls. Tap to snap back to 100 % without losing pan position. The bottom-right control cluster is now: [pattern] [reset layout] [fit to screen] [zoom%] Version 0.5.3 -> 0.6.0 (minor bump — new interaction surfaces + visible toolbar additions). Signed-off-by: flemming-it <sf@flemming.it>
This commit is contained in:
parent
5c59f3a554
commit
5ff7a1c118
3 changed files with 347 additions and 15 deletions
|
|
@ -169,6 +169,12 @@ class FlowNode extends StatelessWidget {
|
|||
onSecondaryTapDown: onContextMenu == null
|
||||
? null
|
||||
: (details) => onContextMenu!(details.globalPosition),
|
||||
// Long-press is the trackpad fallback for the context
|
||||
// menu — macOS trackpad users whose "two-finger click"
|
||||
// isn't mapped to secondary still get the same menu.
|
||||
onLongPressStart: onContextMenu == null
|
||||
? null
|
||||
: (details) => onContextMenu!(details.globalPosition),
|
||||
child: Material(
|
||||
color: theme.colorScheme.surfaceContainerHigh,
|
||||
elevation: selected ? 6 : 2,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue