feat(FN-3941): separate graph pan from selection-gated drag

Separates graph panning from selection-gated drag by updating `useNodeDrag` and `useGraphInteraction` hooks to handle the two interaction modes independently, with `GraphTaskNode` now gating drag on selection state. Tests were added across the graph interaction, node drag, persistence, and integrati

Fusion-Task-Id: FN-3941
This commit is contained in:
Fusion
2026-05-10 11:34:17 -07:00
committed by gsxdsm
parent b046d70730
commit e2bd5000cf
12 changed files with 124 additions and 17 deletions

View File

@@ -64,6 +64,21 @@ describe("useGraphInteraction", () => {
expect(result.current.pan).toEqual({ x: -50, y: -50 });
});
it("continues with pan after pinch when one pointer remains", () => {
const { result } = renderHook(() => useGraphInteraction());
act(() => {
result.current.onPointerDown(1, { x: 100, y: 100 });
result.current.onPointerDown(2, { x: 200, y: 100 });
result.current.onPointerMove(2, { x: 250, y: 100 }, 800, 600);
result.current.onPointerUp(2);
result.current.onPointerMove(1, { x: 120, y: 130 }, 800, 600);
});
expect(result.current.zoom).toBe(1.5);
expect(result.current.pan).toEqual({ x: 20, y: 30 });
});
it("applies animation state for fit and reset", () => {
vi.useFakeTimers();
const { result } = renderHook(() => useGraphInteraction());