chore: refresh fxnode gesture fixes

Amp-Thread-ID: https://ampcode.com/threads/T-019f9d91-77c1-7206-a60f-ed6554ce92ab

Co-authored-by: Heaust Azure <heaust.azure@gmail.com>
This commit is contained in:
Amp
2026-07-29 10:26:50 +00:00
co-authored by heaust
parent 90406ae18f
commit 27e3dd64ae
6 changed files with 88 additions and 15 deletions
+45
View File
@@ -161,6 +161,51 @@ test("logic nodes accept five links through one input and application evaluation
expect(initial.incoming).toBe(5);
expect(initial.labels).toContain("AND: false");
await page.evaluate(async () => {
const view = window.fxnodeStandalone.view!;
const modifiers = { alt: false, control: false, meta: false, shift: false };
view.feedInput({
kind: "pointer",
phase: "down",
pointerId: 41,
pointerType: "mouse",
position: { x: 353, y: 190 },
button: 0,
buttons: 1,
modifiers,
});
view.feedInput({
kind: "pointer",
phase: "move",
pointerId: 41,
pointerType: "mouse",
position: { x: 464, y: 468 },
button: 0,
buttons: 1,
modifiers,
});
await view.whenRendered();
view.feedInput({
kind: "pointer",
phase: "up",
pointerId: 41,
pointerType: "mouse",
position: { x: 464, y: 468 },
button: 0,
buttons: 0,
modifiers,
});
});
await expect
.poll(() =>
page.evaluate(() =>
window.fxnodeStandalone
.root!.getState()
.then((state) => state.links.filter((link) => link.toSocketId === "or:inputs").length),
),
)
.toBe(4);
await page.evaluate(async () => {
const root = window.fxnodeStandalone.root!;
const source = (await root.getState()).nodes.find((node) => node.id === "c")!;
+8
View File
@@ -497,6 +497,14 @@ test("multi-input sockets use pill hit bounds and stable per-link anchors", () =
for (const [id, anchor] of socket.linkAnchors) {
assert.deepEqual(snapshot.links.get(id)!.points.at(-1), anchor);
}
const next = planLink(
snapshot,
sources[0]!.sockets.find((candidate) => candidate.key === "mesh")!.id,
socket.id,
linkId("fresh-link"),
);
assert.equal(next?.type, "link.add");
if (next?.type === "link.add") assert.equal(next.link.id, linkId("fresh-link"));
assert.deepEqual(hitTest(snapshot, worldToView({ x: socket.anchor.x, y: socket.bounds!.y - 2 }, transform)), {
kind: "socket",
id: socket.id,