feat(tiles): Move Tile Left/Right/Up/Down (Ctrl+Shift+Arrows)

Four rebindable registry chords in the Tiles group move the focused
tile: it trades places with the neighbour the Alt+Shift+Arrow focus
chords pick (tileInDirection), through the same _reorderTiles path as
the header drag, and keeps the focus. Nothing at an edge.

They go through tileShortcutFor()/runTileShortcut() like the other
tile chords, so every xterm key handler swallows them while they
apply: only while the grid is open, a zoomed grid included (a no-op
there, so the keys never reach the CLI), and never in a text field
other than xterm's own textarea, where Ctrl+Shift+Arrows select by
word.

Ctrl+Shift+Arrows because every other two-modifier arrow chord is
taken: Ctrl+Alt switches workspaces (GNOME, Xfce, some Windows
graphics drivers), Ctrl+Alt+Shift moves a window to another workspace
(GNOME, Cinnamon, Xfce), Super belongs to the desktop, Alt is the
browser's back and forward, Alt+Shift focuses tiles. No browser,
GNOME, KDE, macOS or Claude Code default uses Ctrl+Shift+Arrows; it
costs a terminal editor's word selection inside a tile while the grid
is open.

The Help modal lists the chords and the header drag; the shortcut
overlay lists the registry. zh-CN entries for every new string.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer
2026-10-07 23:49:11 +02:00
parent 2b20288ca0
commit 20c2561a45
7 changed files with 328 additions and 6 deletions
+39
View File
@@ -579,6 +579,45 @@ const DEFAULT_SHORTCUTS = [
bindings: [{ modifiers: ['alt', 'shift'], key: 'ArrowDown' }],
action: 'focusTileDown',
},
// Move the focused tile: it trades places with the neighbour the focus
// chords would pick. Ctrl+Shift+Arrows because every other two-modifier
// arrow chord is taken: Ctrl+Alt+Arrows switch workspaces (GNOME, Xfce, and
// rotate the screen on some Windows graphics drivers), Ctrl+Alt+Shift+Arrows
// move a window to another workspace (GNOME, Cinnamon, Xfce), Super chords
// belong to the desktop, Alt+Arrows are the browser's back and forward, and
// Alt+Shift+Arrows focus tiles. No browser, GNOME, KDE or macOS default and
// no Claude Code default uses Ctrl+Shift+Arrows (it parallels Ctrl+Shift+{ }
// for moving tabs); what it costs is word selection, so the chords skip a
// text field (tileShortcutFor) and give up only a terminal editor's
// word selection (nano, micro, emacs) inside a tile while the grid is open.
{
id: 'move-tile-left',
group: 'Tiles',
label: 'Move Tile Left',
bindings: [{ modifiers: ['ctrl', 'shift'], key: 'ArrowLeft' }],
action: 'moveTileLeft',
},
{
id: 'move-tile-right',
group: 'Tiles',
label: 'Move Tile Right',
bindings: [{ modifiers: ['ctrl', 'shift'], key: 'ArrowRight' }],
action: 'moveTileRight',
},
{
id: 'move-tile-up',
group: 'Tiles',
label: 'Move Tile Up',
bindings: [{ modifiers: ['ctrl', 'shift'], key: 'ArrowUp' }],
action: 'moveTileUp',
},
{
id: 'move-tile-down',
group: 'Tiles',
label: 'Move Tile Down',
bindings: [{ modifiers: ['ctrl', 'shift'], key: 'ArrowDown' }],
action: 'moveTileDown',
},
{
id: 'zoom-tile',
group: 'Tiles',