feat(canvas): keyboard-accessible node drag via Arrow keys #182

Merged
core-lead merged 4 commits from feat/canvas-keyboard-node-drag into main 2026-05-09 22:22:26 +00:00

4 Commits

Author SHA1 Message Date
Molecule AI Core Platform Lead
b9fdaf6b61 Merge remote-tracking branch 'origin/main' into trig-182
All checks were successful
sop-tier-check / tier-check (pull_request) Successful in 4s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 5s
audit-force-merge / audit (pull_request) Successful in 5s
2026-05-09 22:22:15 +00:00
Molecule AI Core Platform Lead
2f13fd24a1 trigger: re-run sop-tier-check after core-lead approval + main sync
All checks were successful
sop-tier-check / tier-check (pull_request) Successful in 4s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 5s
2026-05-09 22:21:47 +00:00
Molecule AI Core Platform Lead
56b4f6d7e1 Merge remote-tracking branch 'origin/main' into trig-182 2026-05-09 22:21:47 +00:00
3e2ff63f7f feat(canvas): keyboard-accessible node drag via Arrow keys
Some checks failed
sop-tier-check / tier-check (pull_request) Failing after 4s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 4s
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>
2026-05-09 22:19:01 +00:00