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.

feat(renderer): a Share live link button in the terminal node header

reviewff05e267b184
diff --git a/docs/live-links.md b/docs/live-links.md
index 9c533320e..06533569e 100644
--- a/docs/live-links.md
+++ b/docs/live-links.md
@@ -416,7 +416,8 @@ carry it to teammates and the canvas authority would write it into the git-share
sessions-sidebar row; hideable as `live-link`), the kanban card menu (per-project board AND the Omni
board's lanes, non-active projects included — a viewer of a node with no Session held spawns its own
read-only tmux client, so on a machine whose local terminals are tmux the node need not be on screen),
- the card modal header action, the palette ("Manage live links", and "Stop all live links (every
+ the terminal node's header button (between Comments and the eye; hideable as `share-link` — the LIVE
+ chip never is), the card modal header action, the palette ("Manage live links", and "Stop all live links (every
machine on this license)" for a Pro owner or while a link is listed), Settings → Live links (Remote &
team). Each row is judged by its node's OWN project's session (`liveLinkMenuItemsFor`, D2/M1).
ProCompare lists "Live read-only
@@ -579,7 +580,10 @@ Visual checks (renderer, Mac and a Server Edition browser tab):
26. Sessions sidebar row menu — active project and a non-active project (Duplicate · Share live link… ·
End session).
27. Kanban card menu (per-project, after the account rows) and the Omni board lane card menu.
-28. Card modal header: the broadcast action between ✦ and the comments button; disabled look + tooltip
+28. Terminal node header: the broadcast button between Comments and the eye, 22 px like its
+ neighbours; disabled look + tooltip on a relay tab, in a Server Edition tab and at 5 links; hidden
+ from Settings → Appearance → Terminal header buttons.
+ Card modal header: the broadcast action between ✦ and the comments button; disabled look + tooltip
(Chromium shows `title` on disabled buttons — confirm on the packaged build).
29. The create dialog: 460 px `.confirm` shell, radios wrapping, the warning wash, the URL row with
Copy/Copied!, "until HH:MM" in 12/24 h locales; long node titles; dark + light; Liquid Glass.
diff --git a/docs/superpowers/specs/2026-09-28-live-share-link-design.md b/docs/superpowers/specs/2026-09-28-live-share-link-design.md
index 25931e051..8e6cae654 100644
--- a/docs/superpowers/specs/2026-09-28-live-share-link-design.md
+++ b/docs/superpowers/specs/2026-09-28-live-share-link-design.md
@@ -449,6 +449,8 @@ server is the gate.
- **Node context menu** (terminal and agent nodes): "Share live link…". The sessions sidebar row
shares the `selectionItems` builder; the kanban card menu gets the same row from the same builder.
Hideable from Settings → Appearance as `live-link` (`HIDEABLE_MENU_ITEMS`).
+- **Terminal node header:** a "Share live link" button beside Comments, hideable from Settings →
+ Appearance as `share-link` (the LIVE chip is not).
- **Card modal header:** a "Share live link" action on terminal cards.
- **Command palette:** "Manage live links" (opens the Settings section) and "Stop all live links
(every machine on this license)". Stop all revokes every link of the license, other machines
diff --git a/src/renderer/lib/ui-visibility.test.ts b/src/renderer/lib/ui-visibility.test.ts
index a7d945011..7f12ef4c4 100644
--- a/src/renderer/lib/ui-visibility.test.ts
+++ b/src/renderer/lib/ui-visibility.test.ts
@@ -27,7 +27,7 @@ describe('hideable inventories', () => {
'markdown-view', 'refresh-terminal', 'live-link', 'vanilla-restart'
])
expect(HIDEABLE_HEADER_BUTTONS.map((r) => r.id)).toEqual([
- 'maximize', 'refresh', 'mic', 'ai-name', 'comments', 'hide-fanout', 'tidy-fanout', 'md-hint'
+ 'maximize', 'refresh', 'mic', 'ai-name', 'comments', 'share-link', 'hide-fanout', 'tidy-fanout', 'md-hint'
])
})
it('gives every entry a user-facing label', () => {
diff --git a/src/renderer/lib/ui-visibility.ts b/src/renderer/lib/ui-visibility.ts
index b53d17793..93be42ce1 100644
--- a/src/renderer/lib/ui-visibility.ts
+++ b/src/renderer/lib/ui-visibility.ts
@@ -41,6 +41,9 @@ export const HIDEABLE_HEADER_BUTTONS: readonly HideableRow[] = [
{ id: 'mic', label: 'Dictate' },
{ id: 'ai-name', label: 'Name with AI' },
{ id: 'comments', label: 'Comments' },
+ // The header twin of the node menu's "Share live link…" row. The button may be hidden; the LIVE
+ // chip it leads to never can (renderer/lib/live-link.guard.test.ts).
+ { id: 'share-link', label: 'Share live link' },
{ id: 'hide-fanout', label: 'Hide cards & connections' },
{ id: 'tidy-fanout', label: 'Tidy subagent cards' },
// Not in the header proper but the label row right under it (`lib/mdViewHint.ts`); it is the
diff --git a/src/renderer/nodes/TerminalNode.share-link.test.ts b/src/renderer/nodes/TerminalNode.share-link.test.ts
new file mode 100644
index 000000000..4e8f35298
--- /dev/null
+++ b/src/renderer/nodes/TerminalNode.share-link.test.ts
@@ -0,0 +1,48 @@
+// Source-level: TerminalNode cannot be mounted in a unit test (xterm, the pty transport and React
+// Flow's store all live behind it), so the header's "Share live link" button is pinned here. What it
+// does after the click — availability, the Pro gate, the dialog — is Canvas's `nodeterm:live-link`
+// listener, behaviour-tested through `openLiveLink` in lib/liveLinkEntry.test.tsx.
+import { describe, it, expect } from 'vitest'
+import { readFileSync } from 'node:fs'
+import { join } from 'node:path'
+
+const src = readFileSync(join(__dirname, 'TerminalNode.tsx'), 'utf8').replace(/\r\n/g, '\n')
+
+/** The header button's JSX block, from its hideable guard to the guard that follows it. */
+function shareBlock(): string {
+ const start = src.indexOf("{!isHidden('share-link', hiddenHeaderButtons) && (")
+ expect(start).toBeGreaterThan(-1)
+ const end = src.indexOf("{!isHidden('hide-fanout', hiddenHeaderButtons) && (", start)
+ expect(end).toBeGreaterThan(start)
+ return src.slice(start, end)
+}
+
+describe('TerminalNode header: Share live link', () => {
+ it('is a hideable header button that opens the live-link flow for THIS node', () => {
+ const b = shareBlock()
+ expect(b).toContain("new CustomEvent('nodeterm:live-link'")
+ expect(b).toContain('nodeId: id')
+ // A canvas node only ever lives in the active project's canvas.
+ expect(b).toContain('projectId: owningProjectId()')
+ expect(b).toContain('<IconBroadcast />')
+ })
+
+ it('is disabled, with the reason as its tooltip, wherever sharing is unavailable', () => {
+ const b = shareBlock()
+ expect(b).toContain('disabled={!!shareLinkWhy}')
+ expect(b).toContain("label={shareLinkWhy ?? 'Share live link'}")
+ // The ONE availability rule, judged by this node's session (a relay tab is refused), with a
+ // primitive store selector so the header does not re-render on every watch-link push.
+ expect(src).toMatch(/const shareLinkWhy = liveLinkUnavailable\(\{\s*serverEdition: isBrowserRuntime\(\),\s*source: session\.source,/)
+ expect(src).toContain('const activeLiveLinks = useWatchLinks((s) => s.links.length)')
+ })
+
+ it('sits between Comments and the cards & connections eye', () => {
+ const comments = src.indexOf("{!isHidden('comments', hiddenHeaderButtons) && (")
+ const share = src.indexOf("{!isHidden('share-link', hiddenHeaderButtons) && (")
+ const eye = src.indexOf("{!isHidden('hide-fanout', hiddenHeaderButtons) && (")
+ expect(comments).toBeGreaterThan(-1)
+ expect(comments).toBeLessThan(share)
+ expect(share).toBeLessThan(eye)
+ })
+})
diff --git a/src/renderer/nodes/TerminalNode.tsx b/src/renderer/nodes/TerminalNode.tsx
index fede07c04..14bc52834 100644
--- a/src/renderer/nodes/TerminalNode.tsx
+++ b/src/renderer/nodes/TerminalNode.tsx
@@ -224,7 +224,7 @@ import {
useMdModeFocus
} from '../terminal/useMdModeFocus'
import { canvasOwnsMarkdownChord } from '../lib/markdownChord'
-import { IconChat, IconChevronDown, IconChevronRight, IconClose, IconEye, IconEyeOff, IconGrid, IconMic, IconMoveTo, IconPlay, IconReload, IconSearch, IconSparkle } from '../components/icons'
+import { IconBroadcast, IconChat, IconChevronDown, IconChevronRight, IconClose, IconEye, IconEyeOff, IconGrid, IconMic, IconMoveTo, IconPlay, IconReload, IconSearch, IconSparkle } from '../components/icons'
import { NodeLabels } from '../components/kanban/NodeLabels'
import { MdViewHintButton } from '../components/MdViewHintButton'
import { mdViewHint } from '../lib/mdViewHint'
@@ -276,6 +276,8 @@ import { isRemoteSessionNode } from '@shared/worktree'
import { useSession, useActiveSessionPresence } from '../session/session'
import { isHostedReadOnly, useHostedReadOnly } from '../state/hostedTeams'
import { isBrowserRuntime } from '../bridge/runtime'
+import { liveLinkUnavailable } from '../lib/liveLinkEntry'
+import { useWatchLinks } from '../state/watchLinks'
import { agentLaunchOverride, COLLAPSED_HEIGHT, type CanvasNode } from '../state/workspace'
import { NodeColorSwatches } from '../components/NodeColorSwatches'
import { AccountChip, useAccountChip } from '../components/AccountChip'
@@ -1402,6 +1404,15 @@ export function TerminalNode({
// mounted node right away instead of waiting for a remount. Search, Close and the worktree-move
// button are absent from `isHidden`'s inventory and stay put whatever the list says.
const hiddenHeaderButtons = useSettings((s) => s.settings.hiddenHeaderButtons)
+ // The header's "Share live link" button: the same availability rule every opener checks before the
+ // Pro gate (lib/liveLinkEntry). A primitive selector — the header must not re-render on every
+ // watch-link state push.
+ const activeLiveLinks = useWatchLinks((s) => s.links.length)
+ const shareLinkWhy = liveLinkUnavailable({
+ serverEdition: isBrowserRuntime(),
+ source: session.source,
+ activeLinks: activeLiveLinks
+ })
const bodyRef = useRef<HTMLDivElement>(null)
const middleClickPaste = useSettings((st) => st.settings.terminalMiddleClickPaste)
// Chromium pastes the X PRIMARY selection into xterm's hidden textarea on middle click — a path
@@ -6472,6 +6483,28 @@ export function TerminalNode({
</button>
</Tooltip>
)}
+ {!isHidden('share-link', hiddenHeaderButtons) && (
+ <Tooltip label={shareLinkWhy ?? 'Share live link'}>
+ {/* The node menu's "Share live link…" row as a header button. Canvas opens the dialog
+ (`nodeterm:live-link`) after re-checking availability and the Pro gate; a node only
+ ever lives in the active project's canvas, so that is the project it names. */}
+ <button
+ className="term-node__share nodrag"
+ aria-label="Share live link"
+ disabled={!!shareLinkWhy}
+ onClick={(e) => {
+ e.stopPropagation()
+ window.dispatchEvent(
+ new CustomEvent('nodeterm:live-link', {
+ detail: { nodeId: id, title: data.title, projectId: owningProjectId() }
+ })
+ )
+ }}
+ >
+ <IconBroadcast />
+ </button>
+ </Tooltip>
+ )}
{!isHidden('hide-fanout', hiddenHeaderButtons) && (
<Tooltip label={hideFanout ? 'Show cards & connections' : 'Hide cards & connections'}>
<button
diff --git a/src/renderer/styles.css b/src/renderer/styles.css
index 937600e7d..467db8efc 100644
--- a/src/renderer/styles.css
+++ b/src/renderer/styles.css
@@ -2447,6 +2447,7 @@ body,
.term-node__close,
.term-node__move-worktree,
.term-node__hide-fanout,
+.term-node__share,
.term-node__tidy-fanout {
display: inline-flex;
align-items: center;
@@ -2476,6 +2477,7 @@ body,
.term-node__maximize:hover,
.term-node__move-worktree:hover,
.term-node__hide-fanout:hover,
+.term-node__share:hover:not(:disabled),
.term-node__tidy-fanout:hover {
background: rgba(var(--tint-rgb), 0.1);
color: var(--text);
@@ -2487,7 +2489,8 @@ body,
color: var(--danger);
}
-.term-node__ai:disabled {
+.term-node__ai:disabled,
+.term-node__share:disabled {
opacity: 0.6;
cursor: default;
}
diff --git a/src/renderer/terminal/agent-restart.ts b/src/renderer/terminal/agent-restart.ts
index 23fc7afca..a3706540e 100644
--- a/src/renderer/terminal/agent-restart.ts
+++ b/src/renderer/terminal/agent-restart.ts
@@ -24,7 +24,7 @@ import {
* an unknown CLI has no safe way to be asked to quit. One entry turns on both surfaces at once:
* the single-node "Restart agent (resume)" row in the node context menu, and the bulk "restart
* idle agents" action (pane menu + command palette). There is no header button for either —
- * `HIDEABLE_HEADER_BUTTONS` is refresh / mic / ai-name / comments. The matching relaunch line
+ * `HIDEABLE_HEADER_BUTTONS` holds no restart entry. The matching relaunch line
* always comes from `resumeCommand`.
*
* Each value is the CLI's own DOCUMENTED PRIMARY, and is sent BARE: