Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.
TypeScript adhdagent-orchestrationai-agentscanvasclaude-codecodexcoding-agentsdeveloper-toolselectrongeminilinuxmacosmultiplexeropencodeparallel-agentsterminalterminal-emulatorterminal-multiplexertmuxworkspace-manager
feat(keybindings): node.maximize command — Cmd+Shift+Enter maximize/restore
enes6ba8af90ddd4
diff --git a/src/renderer/canvas/Canvas.tsx b/src/renderer/canvas/Canvas.tsxindex ef3892cd2..77cf6bf81 100644--- a/src/renderer/canvas/Canvas.tsx+++ b/src/renderer/canvas/Canvas.tsx@@ -234,6 +234,7 @@ import {viewportForRect,type FocusableNode} from '../lib/nodeFocus'+import { maximizeTargetRect } from '../lib/nodeMaximize'import {recordBreadcrumb,stepBreadcrumb,@@ -453,6 +454,8 @@ import {accountsForProject,sshAccountsHint,ungroupNodes,+ maximizeNodeToRect,+ restoreMaximizedNode,type CanvasNode} from '../state/workspace'import { codexAccountSelectable, codexAccountSwitchStillEligible } from './codex-account-switch'@@ -6128,6 +6131,37 @@ export function Canvas() {[viewCenter])+ /**+ * The header maximize toggle's chord (issue #399). Same origin rule as `moveNodeFocus`: the+ * node the keyboard is actually IN (hover-dwell focuses a terminal without selecting it), else+ * the single selected node — a multi-selection is ambiguous, so it declines and the chord+ * falls through. Declines (false) rather than half-acts everywhere the button would not show:+ * group frames, collapsed nodes, an unmeasured container.+ */+ const toggleMaximizeCommand = useCallback((): boolean => {+ const nodes = nodesRef.current+ const focusedId = document.activeElement+ ?.closest(`.${FLOW_NODE_CLASS}`)+ ?.getAttribute('data-id')+ const selected = nodes.filter((n) => n.selected)+ const target =+ (focusedId ? nodes.find((n) => n.id === focusedId) : undefined) ??+ (selected.length === 1 ? selected[0] : undefined)+ if (!target || target.type === 'group') return false+ if (target.data.premaxRect) {+ setNodes((ns) => restoreMaximizedNode(ns, target.id))+ markDirty()+ return true+ }+ if (target.data.collapsed) return false+ const wrap = flowWrapRef.current?.getBoundingClientRect()+ const rect = wrap ? maximizeTargetRect(getViewport(), wrap.width, wrap.height) : null+ if (!rect) return false+ setNodes((ns) => maximizeNodeToRect(ns, target.id, rect))+ markDirty()+ return true+ }, [setNodes, markDirty, getViewport])+// ONE window keydown for every registry command + the legacy gestures. The deps live in a// ref refreshed each render so the listener is registered once; handlers return whether// they claimed the chord (an unavailable surface falls through to the platform).@@ -6207,7 +6241,8 @@ export function Canvas() {'node.focusLeft': () => moveNodeFocus('left'),'node.focusRight': () => moveNodeFocus('right'),'node.focusUp': () => moveNodeFocus('up'),- 'node.focusDown': () => moveNodeFocus('down')+ 'node.focusDown': () => moveNodeFocus('down'),+ 'node.maximize': toggleMaximizeCommand// node.close / node.toggleMarkdown: main-process intercepted on desktop; deliberately// no renderer handler (the browser owns ⌘W in the Server Edition — see bridge/stubs.ts).// terminal.* / scm.commit / speech.dictation: owned by their local listeners.diff --git a/src/renderer/nodes/MaximizeButton.tsx b/src/renderer/nodes/MaximizeButton.tsxindex 94b46dfe0..8aee3d6a3 100644--- a/src/renderer/nodes/MaximizeButton.tsx+++ b/src/renderer/nodes/MaximizeButton.tsx@@ -8,6 +8,7 @@import { useReactFlow, useStoreApi } from '@xyflow/react'import { Tooltip } from '../components/Tooltip'import { IconMaximize, IconRestoreSize } from '../components/icons'+import { commandTooltip } from '../lib/keybindingOverrides'import { markWorkspaceDirty } from '../state/workspaceDirty'import { maximizeNodeToRect, restoreMaximizedNode, type CanvasNode } from '../state/workspace'import { maximizeTargetRect } from '../lib/nodeMaximize'@@ -31,7 +32,10 @@ export function MaximizeButton({ id, maximized }: { id: string; maximized: boolereturn (<Tooltip- label={maximized ? 'Restore previous size and position' : 'Maximize — fill the visible canvas'}+ label={commandTooltip(+ maximized ? 'Restore previous size and position' : 'Maximize — fill the visible canvas',+ 'node.maximize'+ )}><buttonclassName="term-node__maximize nodrag"diff --git a/src/shared/keybindings.test.ts b/src/shared/keybindings.test.tsindex 6d9b5c131..7ce4718d0 100644--- a/src/shared/keybindings.test.ts+++ b/src/shared/keybindings.test.ts@@ -141,6 +141,8 @@ describe('registry invariants', () => {darwin: ['Cmd+ArrowUp'], other: ['Ctrl+Shift+ArrowUp'], allowInTerminal: true },{ id: 'node.focusDown', title: 'Focus node below', group: 'Nodes', scope: 'canvas',darwin: ['Cmd+ArrowDown'], other: ['Ctrl+Shift+ArrowDown'], allowInTerminal: true },+ { id: 'node.maximize', title: 'Maximize / restore node', group: 'Nodes', scope: 'canvas',+ darwin: ['Cmd+Shift+Enter'], other: ['Cmd+Shift+Enter'], allowInTerminal: true },{ id: 'node.close', title: 'Close node / window', group: 'Nodes', scope: 'app',darwin: ['Cmd+W'], other: ['Cmd+W'], allowInTerminal: true, allowWhileTyping: true },{ id: 'node.toggleMarkdown', title: 'Toggle markdown view', group: 'Nodes', scope: 'app',diff --git a/src/shared/keybindings.ts b/src/shared/keybindings.tsindex 14a42e5c3..da2ba12de 100644--- a/src/shared/keybindings.ts+++ b/src/shared/keybindings.ts@@ -76,6 +76,7 @@ export type CommandId =| 'node.focusRight'| 'node.focusUp'| 'node.focusDown'+ | 'node.maximize'| 'node.close'| 'node.toggleMarkdown'| 'terminal.find'@@ -199,6 +200,13 @@ export const COMMAND_DEFINITIONS: readonly CommandDefinition[] = [{ id: 'node.focusDown', title: 'Focus node below', group: 'Nodes', scope: 'canvas',defaultBindings: { darwin: ['Cmd+ArrowDown'], other: ['Ctrl+Shift+ArrowDown'] },allowInTerminal: true },+ // The header maximize toggle's chord (issue #399): fill the viewport with the node under the+ // keyboard (else the single selected node), or restore it. allowInTerminal for focus-mode's+ // reason — the hand that wants more rows is already typing in the terminal being enlarged.+ // ⌘⇧Enter is iTerm2's maximize-pane chord — the same gesture terminal users already know —+ // and collides with nothing here (scm.commit's ⌘Enter is a different chord, scm scope).+ { id: 'node.maximize', title: 'Maximize / restore node', group: 'Nodes', scope: 'canvas',+ defaultBindings: both('Cmd+Shift+Enter'), allowInTerminal: true },// Main-process intercepted today (unconditional): keep firing everywhere.{ id: 'node.close', title: 'Close node / window', group: 'Nodes', scope: 'app',defaultBindings: both('Cmd+W'), allowInTerminal: true, allowWhileTyping: true },