Skip to content

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.

refactor(canvas): move the maximize toggle into the right-hand header group

enesc6e100d78c12
diff --git a/src/renderer/components/icons.tsx b/src/renderer/components/icons.tsx
index 0edd2d98e..2e511fb0f 100644
--- a/src/renderer/components/icons.tsx
+++ b/src/renderer/components/icons.tsx
@@ -336,3 +336,24 @@ export const IconCanvasView = () => (
<rect x="3.5" y="9.5" width="5.5" height="5" rx="1" />
</svg>
)
+
+/** Fullscreen expand — outward diagonal arrows: the maximize toggle's "will fill the viewport"
+ * state (issue #399). Pairs with IconRestoreSize; the two states must not share a glyph. */
+export const IconMaximize = () => (
+ <svg {...S}>
+ <path d="M14 4h6v6" />
+ <path d="M20 4l-6 6" />
+ <path d="M10 20H4v-6" />
+ <path d="M4 20l6-6" />
+ </svg>
+)
+
+/** Fullscreen restore — the same arrows pointing back inward: the maximize toggle's second click. */
+export const IconRestoreSize = () => (
+ <svg {...S}>
+ <path d="M20 10h-6V4" />
+ <path d="M20 4l-6 6" />
+ <path d="M4 14h6v6" />
+ <path d="M4 20l6-6" />
+ </svg>
+)
diff --git a/src/renderer/nodes/DiffNode.tsx b/src/renderer/nodes/DiffNode.tsx
index ebf8caade..996a803c4 100644
--- a/src/renderer/nodes/DiffNode.tsx
+++ b/src/renderer/nodes/DiffNode.tsx
@@ -140,12 +140,12 @@ export function DiffNode({ id, data, selected }: NodeProps<CanvasNode>) {
<NodeResizer minWidth={NODE_MIN_SIZES.diff.width} minHeight={NODE_MIN_SIZES.diff.height} isVisible={selected} color={data.color} />
<div className="term-node__header">
- <MaximizeButton id={id} maximized={!!data.premaxRect} />
<span className="term-node__title-text" title={`${rel} — ${commitOid ? commitOid.slice(0, 7) : staged ? 'staged' : 'working'}`}>
{rel.split('/').pop()}
<span className="diff-node__tag">{commitOid ? commitOid.slice(0, 7) : staged ? 'staged' : 'changes'}</span>
</span>
<span className="term-node__spacer" />
+ <MaximizeButton id={id} maximized={!!data.premaxRect} />
<button
className="term-node__close"
title="Close"
diff --git a/src/renderer/nodes/EditorNode.tsx b/src/renderer/nodes/EditorNode.tsx
index 29a03dd69..c71717abf 100644
--- a/src/renderer/nodes/EditorNode.tsx
+++ b/src/renderer/nodes/EditorNode.tsx
@@ -263,7 +263,6 @@ export function EditorNode({ id, data, selected }: NodeProps<CanvasNode>) {
/>
<div className="term-node__header">
- <MaximizeButton id={id} maximized={!!data.premaxRect} />
<span className="term-node__title-text" title={filePath}>
{fileName}
{!isImage && !isPdf && dirty ? ' ●' : ''}
@@ -290,6 +289,7 @@ export function EditorNode({ id, data, selected }: NodeProps<CanvasNode>) {
</button>
</>
)}
+ <MaximizeButton id={id} maximized={!!data.premaxRect} />
<button
className="term-node__close"
title="Close"
diff --git a/src/renderer/nodes/MaximizeButton.tsx b/src/renderer/nodes/MaximizeButton.tsx
index d179b7aeb..94b46dfe0 100644
--- a/src/renderer/nodes/MaximizeButton.tsx
+++ b/src/renderer/nodes/MaximizeButton.tsx
@@ -1,12 +1,13 @@
-// The macOS-style green maximize toggle in a node's header (issue #399). One click resizes the
-// NODE to fill the visible canvas — a real resize through the normal resize path, so a terminal
-// reflows and gains rows (the camera never moves; canvas zoom is a CSS transform and magnifying
-// an 80×24 shows no extra line). The second click restores the exact previous rect. Shared by the
-// terminal, editor and diff nodes; the transforms live in state/workspace.ts so grouped nodes
-// re-fit their ancestor frames in the same tick.
+// The maximize toggle in a node header's right-hand button group (issue #399). One click resizes
+// the NODE to fill the visible canvas — a real resize through the normal resize path, so a
+// terminal reflows and gains rows (the camera never moves; canvas zoom is a CSS transform and
+// magnifying an 80×24 shows no extra line). The second click restores the exact previous rect.
+// Shared by the terminal, editor and diff nodes; the transforms live in state/workspace.ts so
+// grouped nodes re-fit their ancestor frames in the same tick.
import { useReactFlow, useStoreApi } from '@xyflow/react'
import { Tooltip } from '../components/Tooltip'
+import { IconMaximize, IconRestoreSize } from '../components/icons'
import { markWorkspaceDirty } from '../state/workspaceDirty'
import { maximizeNodeToRect, restoreMaximizedNode, type CanvasNode } from '../state/workspace'
import { maximizeTargetRect } from '../lib/nodeMaximize'
@@ -41,20 +42,7 @@ export function MaximizeButton({ id, maximized }: { id: string; maximized: boole
toggle()
}}
>
- {/* macOS traffic-light arrows: outward when it will maximize, inward when it will restore. */}
- <svg viewBox="0 0 12 12" aria-hidden="true">
- {maximized ? (
- <>
- <path d="M 5.2 1.6 L 5.2 6.8 L 0 6.8 Z" />
- <path d="M 6.8 10.4 L 6.8 5.2 L 12 5.2 Z" />
- </>
- ) : (
- <>
- <path d="M 1.6 6.8 L 1.6 1.6 L 6.8 1.6 Z" />
- <path d="M 10.4 5.2 L 10.4 10.4 L 5.2 10.4 Z" />
- </>
- )}
- </svg>
+ {maximized ? <IconRestoreSize /> : <IconMaximize />}
</button>
</Tooltip>
)
diff --git a/src/renderer/nodes/TerminalNode.tsx b/src/renderer/nodes/TerminalNode.tsx
index be20c3a64..818505e64 100644
--- a/src/renderer/nodes/TerminalNode.tsx
+++ b/src/renderer/nodes/TerminalNode.tsx
@@ -4438,9 +4438,6 @@ export function TerminalNode({
))}
</div>
)}
- {!collapsed && !isHidden('maximize', hiddenHeaderButtons) && (
- <MaximizeButton id={id} maximized={!!data.premaxRect} />
- )}
{editingTitle ? (
<input
className="term-node__title nodrag"
@@ -4744,6 +4741,9 @@ export function TerminalNode({
</button>
</Tooltip>
)}
+ {!collapsed && !isHidden('maximize', hiddenHeaderButtons) && (
+ <MaximizeButton id={id} maximized={!!data.premaxRect} />
+ )}
<button
className="term-node__close"
title="Close (ends the session)"
diff --git a/src/renderer/styles.css b/src/renderer/styles.css
index a35fc5807..e37ed2793 100644
--- a/src/renderer/styles.css
+++ b/src/renderer/styles.css
@@ -1255,35 +1255,24 @@ body,
flex-shrink: 0;
}
-/* Maximize toggle (issue #399): the macOS green traffic light, next to the color dot. The arrow
- glyphs appear on header hover — same behavior as the real thing. */
+/* Maximize toggle (issue #399): a regular right-group header icon button, next to the close ×.
+ Same recipe as .term-node__refresh — the toggle is ordinary chrome, not a traffic light. */
.term-node__maximize {
- width: 12px;
- height: 12px;
- border-radius: 50%;
+ background: transparent;
border: none;
- padding: 0;
- background: #28c840;
+ color: var(--muted);
cursor: pointer;
+ line-height: 1;
+ padding: 2px 5px;
+ border-radius: 4px;
flex-shrink: 0;
display: inline-flex;
align-items: center;
- justify-content: center;
-}
-
-.term-node__maximize svg {
- width: 8px;
- height: 8px;
- fill: rgba(0, 0, 0, 0.55);
- opacity: 0;
-}
-
-.term-node__header:hover .term-node__maximize svg {
- opacity: 1;
}
.term-node__maximize:hover {
- background: #2fd948;
+ background: rgba(10, 132, 255, 0.18);
+ color: var(--accent-text);
}
.term-node__title {