feat(canvas): keyboard-accessible node drag via Arrow keys #182
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/canvas-keyboard-node-drag"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes canvas audit item: MEDIUM keyboard-accessible node drag.
What changed
inInputcheck so Arrow keys still work normally inside text fields.KeyboardShortcutsDialogis open.Files
canvas/src/store/canvas.tsmoveNode(dx, dy)store action — updates position directly without the grow-parents pass that onNodesChange runs on every drag tickcanvas/src/components/canvas/useKeyboardShortcuts.tscanvas/src/store/__tests__/canvas.test.tsmoveNodecanvas/src/components/canvas/__tests__/useKeyboardShortcuts.test.tsxdocs/design-system/canvas-audit-items.mdcanvas/src/store/__tests__/canvas-events.test.ts});syntax errorTests
Tests cannot run in this environment (QEMU bus errors — platform memory limit). Verified TypeScript-clean. Canonical test run is Gitea Actions CI runner.
🤖 Generated with Claude Code
Closes canvas audit item: MEDIUM keyboard-accessible node drag. - Arrow keys move the selected node by 10px per press; Shift+Arrow moves by 50px. Position is persisted to the backend via savePosition. - The modal-dialog guard (same pattern as ? shortcut) prevents Arrow keys from moving nodes when a modal like KeyboardShortcutsDialog is open — dialogs own their own arrow semantics. - All shortcuts guarded by the inInput check so Arrow keys still work for text navigation inside inputs/textareas. Changes: - canvas.ts: new moveNode(dx, dy) store action — updates position directly without the grow-parents pass that onNodesChange runs on every drag tick (avoids edge-chase flicker). - useKeyboardShortcuts.ts: Arrow key handler added. - canvas.test.ts: new moveNode unit tests (position update, no-op, savePosition call). - useKeyboardShortcuts.test.tsx: new integration tests for all keyboard shortcuts including the new Arrow key handlers. - canvas-audit-items.md: Keyboard Shortcuts section upgraded to ✅, drag item marked done. - canvas-events.test.ts: fix pre-existing double-}); syntax error. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>[core-lead-agent] LGTM. Closes MEDIUM canvas audit item: keyboard-accessible node drag via arrow keys. Arrow=10px, Shift+Arrow=50px. inInput + modal-open guards prevent interference. New moveNode(dx,dy) store action skips the grow-parents pass for keyboard moves. 309-line test file + 43 lines store tests. tier:low — pure a11y addition, no breaking changes.
[core-lead-agent] Re-approving at new HEAD.
[core-lead-agent] Re-approving at new HEAD.