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(kanban): full-page board toggle (tab bar, palette, cmd-shift-b) over the mounted canvas

enes7340c91b7dc3
diff --git a/src/renderer/canvas/Canvas.tsx b/src/renderer/canvas/Canvas.tsx
index 7b215304f..47b8596ee 100644
--- a/src/renderer/canvas/Canvas.tsx
+++ b/src/renderer/canvas/Canvas.tsx
@@ -54,6 +54,8 @@ import {
IconChat,
IconDino,
IconJump,
+ IconKanban,
+ IconCanvasView,
IconLock,
IconMarkdown,
IconNote,
@@ -176,7 +178,10 @@ import { requireProOr } from '../state/upgradeGate'
import { useEntitlement } from '../state/entitlement'
import type { SshServer } from '@shared/ssh'
import { sshHostKey } from '@shared/ssh'
-import type { CanvasNodeState, Project, SshProjectStatus, TranscriptHit } from '@shared/types'
+import type { CanvasNodeState, Project, ProjectKanban, SshProjectStatus, TranscriptHit } from '@shared/types'
+import { KanbanView } from '../components/kanban/KanbanView'
+import { defaultKanban } from '../lib/kanban'
+import { isKanbanOpen, useViewMode } from '../state/viewMode'
import {
createCanvasPublisher,
isEphemeralNodeId,
@@ -1167,6 +1172,25 @@ export function Canvas() {
if (!loadingRef.current) setDirty(true)
}, [])
+ const kanbanOpen = useViewMode((s) => !!activeProjectId && !!s.viewByProject[activeProjectId])
+ const projectKanban = useProjects((s) => s.projects.find((p) => p.id === s.activeProjectId)?.kanban)
+ // Fresh default per project — ids must not be shared across projects; NOT persisted
+ // until the first edit writes it (spec lazy-default rule).
+ const seedBoard = useMemo(
+ () => defaultKanban(),
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ [activeProjectId]
+ )
+ const onKanbanChange = useCallback(
+ (next: ProjectKanban) => {
+ const id = useProjects.getState().activeProjectId
+ if (!id) return
+ useProjects.getState().setProjectKanban(id, next)
+ markDirty() // rides the existing debounced persist (commitActiveToStore + workspace.save)
+ },
+ [markDirty]
+ )
+
// The node states that go on the wire: React Flow's managed nodes minus the ephemeral cards
// (subagent / loop), which every client derives for itself from the agent:status stream.
const publishableNow = useCallback((flow: CanvasNode[]): CanvasNodeState[] => {
@@ -1550,6 +1574,7 @@ export function Canvas() {
// Cmd/Ctrl+Z = undo, Cmd/Ctrl+Shift+Z or Cmd/Ctrl+Y = redo (ignored while typing).
useEffect(() => {
const onKey = (e: KeyboardEvent) => {
+ if (isKanbanOpen(useProjects.getState().activeProjectId)) return
if (!(e.metaKey || e.ctrlKey)) return
const k = e.key.toLowerCase()
if (k !== 'z' && k !== 'y') return
@@ -2421,6 +2446,7 @@ export function Canvas() {
// ⌘T = new terminal, ⌘⇧C = new default agent (ignored while typing in a field/terminal).
useEffect(() => {
const onKey = (e: KeyboardEvent) => {
+ if (isKanbanOpen(useProjects.getState().activeProjectId)) return
if (!(e.metaKey || e.ctrlKey)) return
const tag = (document.activeElement?.tagName || '').toLowerCase()
if (tag === 'input' || tag === 'textarea') return
@@ -2677,6 +2703,7 @@ export function Canvas() {
// Delete / Backspace asks for confirmation, then deletes the selected nodes.
useEffect(() => {
const onKey = (e: KeyboardEvent) => {
+ if (isKanbanOpen(useProjects.getState().activeProjectId)) return
if (e.key !== 'Delete' && e.key !== 'Backspace') return
const tag = (document.activeElement?.tagName || '').toLowerCase()
if (tag === 'input' || tag === 'textarea') return
@@ -3501,6 +3528,10 @@ export function Canvas() {
} else if ((e.metaKey || e.ctrlKey) && e.shiftKey && e.key.toLowerCase() === 'g') {
e.preventDefault()
setScOpen((v) => !v)
+ } else if ((e.metaKey || e.ctrlKey) && e.shiftKey && e.key.toLowerCase() === 'b') {
+ e.preventDefault()
+ const id = useProjects.getState().activeProjectId
+ if (id) useViewMode.getState().toggle(id)
} else if ((e.metaKey || e.ctrlKey) && e.shiftKey && e.key.toLowerCase() === 'l') {
e.preventDefault()
toggleSessionsPin()
@@ -5447,6 +5478,18 @@ export function Canvas() {
run: () => goToNode(n)
})
})
+ const kanbanId = useProjects.getState().activeProjectId
+ if (kanbanId) {
+ const kb = isKanbanOpen(kanbanId)
+ cmds.push({
+ id: 'toggle-kanban',
+ label: kb ? 'Canvas view' : 'Kanban view',
+ hint: '⌘⇧B',
+ section: 'View',
+ icon: kb ? <IconCanvasView /> : <IconKanban />,
+ run: () => useViewMode.getState().toggle(kanbanId)
+ })
+ }
return cmds
}, [
addTerminal,
@@ -5622,6 +5665,7 @@ export function Canvas() {
)
})()}
</div>
+ {kanbanOpen && <KanbanView board={projectKanban ?? seedBoard} onChange={onKanbanChange} />}
<UpdateCard />
<div
diff --git a/src/renderer/components/TabBar.tsx b/src/renderer/components/TabBar.tsx
index f84ce426b..01cfb2dda 100644
--- a/src/renderer/components/TabBar.tsx
+++ b/src/renderer/components/TabBar.tsx
@@ -9,6 +9,8 @@ import { sshAutoModeHint } from '../state/permissionMode'
import { useSystemAccount } from '../state/systemAccount'
import { sessionCount, sessionForProject, useProjectSession } from '../session/session'
import { tabClickAction } from '../session/relay-tab'
+import { useViewMode } from '../state/viewMode'
+import { IconCanvasView, IconKanban } from './icons'
import {
ALL_PERMISSION_MODES,
PERMISSION_MODE_LABELS,
@@ -77,6 +79,7 @@ export function TabBar({
// Closed projects are hidden here (reopen them from the start screen's "Recently closed").
const projects = useMemo(() => allProjects.filter((p) => !p.closed), [allProjects])
const activeId = useProjects((s) => s.activeProjectId)
+ const kanbanActive = useViewMode((s) => !!activeId && !!s.viewByProject[activeId])
// Unread dots need only the unread id set — subscribing to the whole status map re-rendered
// the TabBar on every working/waiting flip of any agent. Primitive signature → rare updates.
const unreadIds = useAgentStatus((s) => {
@@ -329,6 +332,15 @@ export function TabBar({
<button className="tab__add" title="New project" onClick={onOpenWelcome}>
+
</button>
+ {activeId && (
+ <button
+ className="tab__view-toggle"
+ title={kanbanActive ? 'Canvas view (⌘⇧B)' : 'Kanban view (⌘⇧B)'}
+ onClick={() => useViewMode.getState().toggle(activeId)}
+ >
+ {kanbanActive ? <IconCanvasView /> : <IconKanban />}
+ </button>
+ )}
</div>
</div>
diff --git a/src/renderer/components/icons.tsx b/src/renderer/components/icons.tsx
index 9a7cd290b..f139f5423 100644
--- a/src/renderer/components/icons.tsx
+++ b/src/renderer/components/icons.tsx
@@ -254,3 +254,19 @@ export const IconPhone = () => (
<circle cx="12" cy="18" r="0.9" fill="currentColor" stroke="none" />
</svg>
)
+
+export const IconKanban = () => (
+ <svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round">
+ <rect x="1.5" y="2.5" width="3.6" height="11" rx="1" />
+ <rect x="6.2" y="2.5" width="3.6" height="7.5" rx="1" />
+ <rect x="10.9" y="2.5" width="3.6" height="5" rx="1" />
+ </svg>
+)
+
+export const IconCanvasView = () => (
+ <svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round">
+ <rect x="1.5" y="1.5" width="6" height="5" rx="1" />
+ <rect x="9" y="4" width="5.5" height="4.5" rx="1" />
+ <rect x="3.5" y="9.5" width="5.5" height="5" rx="1" />
+ </svg>
+)
diff --git a/src/renderer/styles.css b/src/renderer/styles.css
index eb0b492e8..18252de85 100644
--- a/src/renderer/styles.css
+++ b/src/renderer/styles.css
@@ -6139,3 +6139,22 @@ body,
color: rgba(255, 255, 255, 0.8);
border-color: rgba(255, 255, 255, 0.3);
}
+
+.tab__view-toggle {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 26px;
+ height: 26px;
+ margin-left: 2px;
+ background: none;
+ border: none;
+ border-radius: 6px;
+ color: rgba(255, 255, 255, 0.55);
+ cursor: pointer;
+ -webkit-app-region: no-drag; /* the tab bar is the window drag region */
+}
+.tab__view-toggle:hover {
+ background: rgba(255, 255, 255, 0.08);
+ color: rgba(255, 255, 255, 0.9);
+}