Keep the dragged edge on screen while the palette picks its node
Releasing an edge over empty space opened the node palette but dropped the edge
drawing, so the connection being made was invisible exactly while its target was
being chosen. The finished drag is now held in `pendingDrop` and drawn like a
running one until the palette closes, by pick or by Escape.
The e2e check for the Escape path exposed a real defect underneath: `Popup.open()`
blurs the focused widget, `close()` did not. A field inside the popup therefore kept
the keyboard bridge's DOM focus after the popup was gone, and every later Delete or
Ctrl+Z went into that invisible input. The suite caught it one check later ("Delete
removes the node and its edge" found the node still there). `close()` now blurs,
mirroring `open()`.
Verified remotely on the Windows host: 287 editor checks and 24 jump-and-run smoke
checks, no failures.
This commit is contained in:
1 parent
ebad3fd530
commit
14562cf157
5 files changed
+65
-11
No files matched your search
@@ -179,6 +179,10 @@ export async function graph(t) {
|
||||
'it lists a node that takes a number, not one that cannot',
|
||||
Boolean(await evaluate(`__gm.locate('Clamp')`)) && !(await evaluate(`__gm.locate('Restart game')`)),
|
||||
);
|
||||
check(
|
||||
'the dragged edge stays on screen while the palette decides',
|
||||
(await json(`__gm.graph.danglingEdge()`)) === true,
|
||||
);
|
||||
await shot('18c-drop-into-empty');
|
||||
const clampRow = await locate('Clamp');
|
||||
await click(clampRow.x, clampRow.y);
|
||||
@@ -195,6 +199,10 @@ export async function graph(t) {
|
||||
clampEdge?.to.port === 'value',
|
||||
JSON.stringify({ afterDrop, clampEdge }),
|
||||
);
|
||||
check(
|
||||
'and the dangling edge gives way to the real one',
|
||||
(await json(`__gm.graph.danglingEdge()`)) === false,
|
||||
);
|
||||
await undo();
|
||||
const undone = await graphCounts();
|
||||
check(
|
||||
@@ -203,6 +211,23 @@ export async function graph(t) {
|
||||
JSON.stringify(undone),
|
||||
);
|
||||
|
||||
// Cancelling the palette has to take the dangling edge with it, or it would hang there forever.
|
||||
await mouse('mouseMoved', axisX.x, axisX.y);
|
||||
await mouse('mousePressed', axisX.x, axisX.y);
|
||||
await mouse('mouseMoved', empty.x, empty.y, 'left', { buttons: 1 });
|
||||
await mouse('mouseReleased', empty.x, empty.y);
|
||||
await sleep(150);
|
||||
await press('Escape');
|
||||
await sleep(150);
|
||||
const cancelled = await graphCounts();
|
||||
check(
|
||||
'escaping the palette clears the edge and adds nothing',
|
||||
(await json(`__gm.graph.danglingEdge()`)) === false &&
|
||||
cancelled.nodes === beforeDrop.nodes &&
|
||||
cancelled.edges === beforeDrop.edges,
|
||||
JSON.stringify(cancelled),
|
||||
);
|
||||
|
||||
// 13e. Delete removes the selected node together with its edge; undo brings both back.
|
||||
await select({ kind: 'node', assetId: 'mover', nodeId: newNode.id });
|
||||
await press('Delete');
|
||||
|
||||
Reference in new issue
Block a user