Merge branch 'feat/canvas-magnetism-20260411-082412'

This commit is contained in:
2026-04-11 10:47:03 +02:00
50 changed files with 2589 additions and 354 deletions

View File

@@ -142,6 +142,7 @@ vi.mock("next-intl", () => ({
vi.mock("@xyflow/react", () => ({
Handle: () => null,
Position: { Left: "left", Right: "right" },
useConnection: () => ({ inProgress: false }),
}));
import AgentNode from "@/components/canvas/nodes/agent-node";

View File

@@ -60,6 +60,7 @@ vi.mock("@xyflow/react", () => ({
});
},
Position: { Left: "left", Right: "right" },
useConnection: () => ({ inProgress: false }),
}));
const translations: Record<string, string> = {

View File

@@ -20,6 +20,7 @@ vi.mock("@xyflow/react", () => ({
});
},
Position: { Left: "left", Right: "right" },
useConnection: () => ({ inProgress: false }),
}));
const translations: Record<string, string> = {

View File

@@ -54,6 +54,7 @@ vi.mock("@/components/canvas/nodes/base-node-wrapper", () => ({
vi.mock("@xyflow/react", () => ({
Handle: () => null,
Position: { Left: "left", Right: "right" },
useConnection: () => ({ inProgress: false }),
useReactFlow: () => ({
getEdges: mocks.getEdges,
getNode: mocks.getNode,

View File

@@ -18,6 +18,7 @@ const mocks = vi.hoisted(() => ({
vi.mock("@xyflow/react", () => ({
Handle: () => null,
Position: { Left: "left", Right: "right" },
useConnection: () => ({ inProgress: false }),
}));
vi.mock("next-intl", () => ({

View File

@@ -19,6 +19,7 @@ const parameterSliderState = vi.hoisted(() => ({
vi.mock("@xyflow/react", () => ({
Handle: () => null,
Position: { Left: "left", Right: "right" },
useConnection: () => ({ inProgress: false }),
}));
vi.mock("convex/react", () => ({

View File

@@ -135,6 +135,7 @@ vi.mock("@/components/canvas/nodes/base-node-wrapper", () => ({
vi.mock("@xyflow/react", () => ({
Handle: () => null,
Position: { Left: "left", Right: "right" },
useConnection: () => ({ inProgress: false }),
useStore: (selector: (state: { edges: typeof mocks.edges; nodes: typeof mocks.nodes }) => unknown) =>
selector({ edges: mocks.edges, nodes: mocks.nodes }),
useReactFlow: () => ({

View File

@@ -691,6 +691,7 @@ describe("preview histogram call sites", () => {
vi.doMock("@xyflow/react", () => ({
Handle: () => null,
Position: { Left: "left", Right: "right" },
useConnection: () => ({ inProgress: false }),
}));
vi.doMock("convex/react", () => ({
useMutation: () => vi.fn(async () => undefined),
@@ -754,6 +755,8 @@ describe("preview histogram call sites", () => {
}));
vi.doMock("@/lib/canvas-utils", () => ({
resolveMediaAspectRatio: () => null,
canvasHandleAccentColor: () => "rgb(13, 148, 136)",
canvasHandleAccentColorWithAlpha: () => "rgba(13, 148, 136, 0.4)",
}));
vi.doMock("@/lib/image-formats", () => ({
parseAspectRatioString: () => ({ w: 1, h: 1 }),
@@ -875,6 +878,7 @@ describe("preview histogram call sites", () => {
vi.doMock("@xyflow/react", () => ({
Handle: () => null,
Position: { Left: "left", Right: "right" },
useConnection: () => ({ inProgress: false }),
}));
vi.doMock("convex/react", () => ({
useMutation: () => vi.fn(async () => undefined),
@@ -935,6 +939,8 @@ describe("preview histogram call sites", () => {
}));
vi.doMock("@/lib/canvas-utils", () => ({
resolveMediaAspectRatio: () => null,
canvasHandleAccentColor: () => "rgb(13, 148, 136)",
canvasHandleAccentColorWithAlpha: () => "rgba(13, 148, 136, 0.4)",
}));
vi.doMock("@/lib/image-formats", () => ({
parseAspectRatioString: () => ({ w: 1, h: 1 }),
@@ -1063,6 +1069,7 @@ describe("preview histogram call sites", () => {
vi.doMock("@xyflow/react", () => ({
Handle: () => null,
Position: { Left: "left", Right: "right" },
useConnection: () => ({ inProgress: false }),
}));
vi.doMock("convex/react", () => ({
useMutation: () => vi.fn(async () => undefined),
@@ -1126,6 +1133,8 @@ describe("preview histogram call sites", () => {
}));
vi.doMock("@/lib/canvas-utils", () => ({
resolveMediaAspectRatio: () => null,
canvasHandleAccentColor: () => "rgb(13, 148, 136)",
canvasHandleAccentColorWithAlpha: () => "rgba(13, 148, 136, 0.4)",
}));
vi.doMock("@/lib/image-formats", () => ({
parseAspectRatioString: () => ({ w: 1, h: 1 }),

View File

@@ -123,6 +123,7 @@ vi.mock("@/components/canvas/nodes/base-node-wrapper", () => ({
vi.mock("@xyflow/react", () => ({
Handle: () => null,
Position: { Left: "left", Right: "right" },
useConnection: () => ({ inProgress: false }),
useStore: (selector: (state: { edges: typeof mocks.edges; nodes: typeof mocks.nodes }) => unknown) =>
selector({ edges: mocks.edges, nodes: mocks.nodes }),
useReactFlow: () => ({