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(updates): Figma-style Update button in the title bar

reviewa8ad0762bb02
diff --git a/src/renderer/components/TabBar.tsx b/src/renderer/components/TabBar.tsx
index 602a1285a..fc40c0755 100644
--- a/src/renderer/components/TabBar.tsx
+++ b/src/renderer/components/TabBar.tsx
@@ -12,7 +12,8 @@ import { sessionCount, sessionForProject, useProjectSession } from '../session/s
import { tabClickAction } from '../session/relay-tab'
import { useMenuFlip } from '../ui/useMenuFlip'
import { commandTooltip } from '../lib/keybindingOverrides'
-import { IconCanvasView, IconKanban, IconMoreVertical, IconPlus } from './icons'
+import { IconCanvasView, IconKanban, IconMoreVertical, IconPlus, IconUpdate } from './icons'
+import { runPendingUpdate, usePendingUpdate } from '../state/pendingUpdate'
import { ProjectGlyph } from './ProjectGlyph'
import {
ALL_PERMISSION_MODES,
@@ -212,6 +213,7 @@ export function TabBar({
// The strip scrolls without a visible scrollbar (see .tabbar__tabs), so keep it navigable:
// a plain mouse wheel scrolls it horizontally, and the active tab is brought into view.
const tabsRef = useRef<HTMLDivElement>(null)
+ const pendingUpdate = usePendingUpdate((s) => s.pending)
useEffect(() => {
tabsRef.current
?.querySelector('.tab.active')
@@ -249,6 +251,24 @@ export function TabBar({
)}
<div className="tabbar">
+ {pendingUpdate && (
+ // Figma-style: first thing after the traffic lights, accent-filled, no ✕. It stays until
+ // the update is installed, the card's dismiss never reaches it.
+ <button
+ className="tabbar__update"
+ title={
+ pendingUpdate.kind === 'downloaded'
+ ? `nodeterm v${pendingUpdate.version} is ready, restart to update`
+ : pendingUpdate.kind === 'manual'
+ ? `nodeterm v${pendingUpdate.version} is available, download it to update`
+ : 'This version is no longer supported, update to continue'
+ }
+ onClick={() => runPendingUpdate(pendingUpdate)}
+ >
+ <IconUpdate />
+ Update
+ </button>
+ )}
<div className="brand">
<svg className="brand__mark" viewBox="0 0 48 48" width="22" height="22" aria-hidden="true">
<defs>
diff --git a/src/renderer/components/UpdateCard.tsx b/src/renderer/components/UpdateCard.tsx
index 98953370b..d1cbb2601 100644
--- a/src/renderer/components/UpdateCard.tsx
+++ b/src/renderer/components/UpdateCard.tsx
@@ -2,6 +2,7 @@ import { useEffect, useRef, useState } from 'react'
import { IconClose } from './icons'
import { noSelfInstallCopy } from '@shared/update-platform'
import type { UpdateProgress } from '@shared/types'
+import { RELEASES_URL, usePendingUpdate } from '../state/pendingUpdate'
// The full updater lifecycle as one status union, driving a fixed bottom-right card.
// `checking` is only ever shown for a user-initiated manual check; automatic checks stay
@@ -21,8 +22,6 @@ type Status =
| { kind: 'required'; minSupported: string | null }
| { kind: 'error'; message: string }
-const RELEASES_URL = 'https://nodeterm.dev/releases'
-
export function UpdateCard(): JSX.Element | null {
const [status, setStatus] = useState<Status>({ kind: 'idle' })
const [minimized, setMinimized] = useState(false)
@@ -115,6 +114,17 @@ export function UpdateCard(): JSX.Element | null {
}
}, [])
+ // Mirror an owed update into the title-bar button. Deliberately never cleared from here: the
+ // card's ✕ sets `idle`, and dismissing the card must not take the install path away with it.
+ const setPending = usePendingUpdate((s) => s.setPending)
+ useEffect(() => {
+ if (status.kind === 'downloaded' || status.kind === 'manual') {
+ setPending({ kind: status.kind, version: status.version })
+ } else if (status.kind === 'required') {
+ setPending({ kind: 'required', minSupported: status.minSupported })
+ }
+ }, [status, setPending])
+
if (status.kind === 'idle') return null
const openReleases = () => window.open(RELEASES_URL, '_blank', 'noopener')
diff --git a/src/renderer/components/icons.tsx b/src/renderer/components/icons.tsx
index 7017f78c3..d65b5bfed 100644
--- a/src/renderer/components/icons.tsx
+++ b/src/renderer/components/icons.tsx
@@ -184,6 +184,16 @@ export const IconReload = () => (
</svg>
)
+/** Two chasing arrows — the title-bar "Update" button (an app update is waiting). */
+export const IconUpdate = () => (
+ <svg {...S}>
+ <path d="M20 11a8 8 0 0 0-14.3-4.9L4 8" />
+ <path d="M4 4v4h4" />
+ <path d="M4 13a8 8 0 0 0 14.3 4.9L20 16" />
+ <path d="M20 20v-4h-4" />
+ </svg>
+)
+
/** Power symbol — restarting a PROCESS (the agent CLI), as opposed to IconReload's
* circular arrow, which reloads a VIEW. The two restart actions must not share a glyph. */
export const IconPower = () => (
diff --git a/src/renderer/state/pendingUpdate.ts b/src/renderer/state/pendingUpdate.ts
new file mode 100644
index 000000000..913ef0e6e
--- /dev/null
+++ b/src/renderer/state/pendingUpdate.ts
@@ -0,0 +1,33 @@
+import { create } from 'zustand'
+
+// The update the user still owes, as seen by the title-bar "Update" button (Figma-style: a
+// prominent pill beside the traffic lights that cannot be dismissed). UpdateCard owns the updater
+// subscriptions and writes here; the card's own ✕ only hides the CARD, never this, so a dismissed
+// card still leaves a way to install. Transient: a relaunch re-derives it from the updater.
+//
+// downloaded → staged, click restarts into it
+// manual → a .deb/.rpm Linux install can't self-install, click opens the download page
+// required → below the channel minimum, click triggers a check (which downloads it)
+export type PendingUpdate =
+ | { kind: 'downloaded'; version: string }
+ | { kind: 'manual'; version: string }
+ | { kind: 'required'; minSupported: string | null }
+
+interface PendingUpdateState {
+ pending: PendingUpdate | null
+ setPending: (p: PendingUpdate | null) => void
+}
+
+export const usePendingUpdate = create<PendingUpdateState>((set) => ({
+ pending: null,
+ setPending: (pending) => set({ pending })
+}))
+
+export const RELEASES_URL = 'https://nodeterm.dev/releases'
+
+/** What clicking the title-bar button does for each pending kind. */
+export function runPendingUpdate(p: PendingUpdate): void {
+ if (p.kind === 'downloaded') window.nodeTerminal.updates.restart()
+ else if (p.kind === 'manual') window.open(RELEASES_URL, '_blank', 'noopener')
+ else window.nodeTerminal.updates.check()
+}
diff --git a/src/renderer/styles.css b/src/renderer/styles.css
index c9ab23251..8f5ad5dcc 100644
--- a/src/renderer/styles.css
+++ b/src/renderer/styles.css
@@ -389,6 +389,35 @@ body,
-webkit-app-region: no-drag;
}
+/* Title-bar "Update" button (Figma-style): right after the traffic lights, deliberately loud and
+ not dismissible, shown only while an update is staged / owed (state/pendingUpdate.ts). */
+.tabbar__update {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ flex-shrink: 0;
+ height: 28px;
+ padding: 0 12px 0 10px;
+ background: var(--accent);
+ border: none;
+ border-radius: 7px;
+ color: #fff;
+ font-size: 13px;
+ font-weight: 600;
+ white-space: nowrap;
+ cursor: pointer;
+}
+
+.tabbar__update:hover {
+ background: var(--accent-hover);
+}
+
+.tabbar__update svg {
+ width: 15px;
+ height: 15px;
+ stroke-width: 2.2;
+}
+
/* Brand: gradient app-tile + wordmark */
.brand {
display: flex;