Skip to content

Arrow-key canvas panning on Graph and Flows#23

Merged
damusix merged 4 commits into
mainfrom
keyboard-pan
Jul 15, 2026
Merged

Arrow-key canvas panning on Graph and Flows#23
damusix merged 4 commits into
mainfrom
keyboard-pan

Conversation

@damusix

@damusix damusix commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Arrow keys scroll the Graph and Flows canvases — 5px per keydown, 25px with Shift held; holding a key scrolls continuously via OS key-repeat.
  • Resolved through the existing resolveShortcut keymap (same guard slot as ?, since Shift is the step multiplier); routed to a new panBy(dx, dy) on GraphViewHandle and FlowsViewHandle. The flow SVG reuses its drag-pan screen→viewBox conversion.
  • Arrows stay native in the Dictionary (page scroll), in text fields (cursor movement), and under Cmd/Ctrl/Alt chords (OS navigation).

What this solves

The DG and DFD canvases were mouse-only for scrolling; keyboard users had no way to nudge the viewport.

damusix added 4 commits July 15, 2026 01:22
Arrows pan the active canvas 5px per keydown (25px with Shift) via a new
{type:'pan'} resolver action and panBy(dx,dy) on both view handles; OS
key-repeat gives continuous scrolling. Dict, editable targets, and
ctrl/meta/alt chords keep their native arrow behavior.
5px felt too slow for practical scrolling; PAN_STEP/PAN_STEP_FAST move
to 10/50 (ratio unchanged at 5x). Docs and tests updated to match.
@damusix
damusix marked this pull request as ready for review July 15, 2026 05:56
@damusix
damusix merged commit 4cfb3c3 into main Jul 15, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant