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): Trello-style card modal shell (scrim/Esc, rename, sticky editing)

enes36e725eb9b9f
diff --git a/src/renderer/canvas/Canvas.tsx b/src/renderer/canvas/Canvas.tsx
index f40a979b5..a2fa1679e 100644
--- a/src/renderer/canvas/Canvas.tsx
+++ b/src/renderer/canvas/Canvas.tsx
@@ -4880,6 +4880,16 @@ export function Canvas() {
[activeProjectId, setNodes, markDirty, writeDisk]
)
+ // Write-through a sticky node's body text from the kanban card modal (the canvas sticky
+ // reads the same data.text path).
+ const editStickyText = useCallback(
+ (nodeId: string, text: string) => {
+ setNodes((ns) => ns.map((n) => (n.id === nodeId ? { ...n, data: { ...n.data, text } } : n)))
+ markDirty()
+ },
+ [setNodes, markDirty]
+ )
+
// Sidebar "Name with AI": generate a title from the session's captured terminal output
// (same BYO-agent path as the terminal node's ✦), then apply it via renameSession.
const aiNameSession = useCallback(
@@ -5834,6 +5844,8 @@ export function Canvas() {
onChange={onKanbanChange}
onOpenNode={openNodeFromKanban}
onCreateNode={createNodeInColumn}
+ onRenameNode={(nodeId, title) => renameSession(activeProjectId, nodeId, title)}
+ onEditSticky={editStickyText}
/>
)}
<UpdateCard />
diff --git a/src/renderer/components/kanban/CardModal.tsx b/src/renderer/components/kanban/CardModal.tsx
new file mode 100644
index 000000000..ee29248d7
--- /dev/null
+++ b/src/renderer/components/kanban/CardModal.tsx
@@ -0,0 +1,114 @@
+import { useEffect, useRef, useState } from 'react'
+import { createPortal } from 'react-dom'
+import { isTopDialog, nextDialogId, popDialog, pushDialog } from '../dialog-stack'
+import type { KanbanSession } from './KanbanView'
+
+interface CardModalProps {
+ session: KanbanSession
+ /** Column title shown as a chip; null = Ungrouped. */
+ columnTitle: string | null
+ onClose: () => void
+ /** Secondary action: close the modal, switch to canvas, focus the node. */
+ onOpenCanvas: () => void
+ /** Rename funnel (same as the sidebar's). */
+ onRename: (title: string) => void
+ /** Sticky text write-through (only called for kind 'sticky'). */
+ onEditSticky: (text: string) => void
+}
+
+/** Trello-style card popup over the board. Scrim click / Esc close it; the board (and the
+ * canvas under it) stay mounted. Terminal pane arrives in Task 2 — until then terminal
+ * cards show the sticky/chat-style body with the open-on-canvas action. */
+export function CardModal({ session, columnTitle, onClose, onOpenCanvas, onRename, onEditSticky }: CardModalProps) {
+ const idRef = useRef<string>()
+ if (!idRef.current) idRef.current = nextDialogId()
+ const id = idRef.current
+ const [editingTitle, setEditingTitle] = useState(false)
+ const [title, setTitle] = useState(session.title)
+
+ useEffect(() => {
+ pushDialog(id)
+ return () => popDialog(id)
+ }, [id])
+
+ useEffect(() => {
+ const onKey = (e: KeyboardEvent) => {
+ if (e.key !== 'Escape' || !isTopDialog(id)) return
+ e.preventDefault()
+ e.stopPropagation()
+ onClose()
+ }
+ // Capture phase: beat the canvas/global keydown listeners to the Escape.
+ window.addEventListener('keydown', onKey, true)
+ return () => window.removeEventListener('keydown', onKey, true)
+ }, [id, onClose])
+
+ const commitTitle = () => {
+ const t = title.trim()
+ if (t && t !== session.title) onRename(t)
+ setEditingTitle(false)
+ }
+
+ return createPortal(
+ <div className="kanban-modal-scrim" onMouseDown={onClose}>
+ {/* stopPropagation: clicks inside the sheet must not reach the scrim-close */}
+ <div className="kanban-modal" onMouseDown={(e) => e.stopPropagation()}>
+ <div className="kanban-modal__header">
+ <span className="kanban-card__nodedot" style={{ background: session.color }} />
+ {editingTitle ? (
+ <input
+ className="kanban-modal__rename"
+ autoFocus
+ value={title}
+ onChange={(e) => setTitle(e.target.value)}
+ onBlur={commitTitle}
+ onKeyDown={(e) => {
+ if (e.key === 'Enter') commitTitle()
+ if (e.key === 'Escape') {
+ e.stopPropagation()
+ setEditingTitle(false)
+ }
+ }}
+ />
+ ) : (
+ <span
+ className="kanban-modal__title"
+ onClick={() => {
+ if (session.kind === 'sticky') return // a note's label IS its first line
+ setTitle(session.title)
+ setEditingTitle(true)
+ }}
+ >
+ {session.title}
+ </span>
+ )}
+ <span className="kanban-modal__column">{columnTitle ?? 'Ungrouped'}</span>
+ <button className="kanban-modal__action" title="Open on canvas" onClick={onOpenCanvas}>
+ ↗
+ </button>
+ <button className="kanban-modal__action" title="Close" onClick={onClose}>
+ ✕
+ </button>
+ </div>
+ <div className="kanban-modal__body">
+ {session.kind === 'sticky' ? (
+ <textarea
+ className="kanban-modal__sticky"
+ value={session.text ?? ''}
+ placeholder="Write a note…"
+ onChange={(e) => onEditSticky(e.target.value)}
+ />
+ ) : (
+ <div className="kanban-modal__pane" data-kind={session.kind}>
+ {/* Task 2 replaces this with the live co-attach terminal for kind 'terminal'. */}
+ <div className="kanban-modal__placeholder">
+ {session.kind === 'chat' ? 'Chat sessions open on the canvas.' : 'Terminal'}
+ </div>
+ </div>
+ )}
+ </div>
+ </div>
+ </div>,
+ document.body
+ )
+}
diff --git a/src/renderer/components/kanban/KanbanColumn.tsx b/src/renderer/components/kanban/KanbanColumn.tsx
index 5e5d4b66b..0ea3d3906 100644
--- a/src/renderer/components/kanban/KanbanColumn.tsx
+++ b/src/renderer/components/kanban/KanbanColumn.tsx
@@ -16,7 +16,8 @@ interface KanbanColumnProps {
onRename?: (title: string) => void
onRecolor?: (color: string) => void
onDelete?: () => void
- onOpenNode: (nodeId: string) => void
+ /** Open a card's modal (↗ / double-click on the card). */
+ onOpenCard: (nodeId: string) => void
/** "+ New" menu entries (agents, terminal, sticky) and what to do when one is picked. */
createOptions: KanbanCreateOption[]
onCreate: (choice: KanbanCreateChoice) => void
@@ -30,7 +31,7 @@ interface KanbanColumnProps {
}
export function KanbanColumn({
- column, cards, statusById, expandedIds, onToggleCard, onRename, onRecolor, onDelete, onOpenNode,
+ column, cards, statusById, expandedIds, onToggleCard, onRename, onRecolor, onDelete, onOpenCard,
createOptions, onCreate, onCardDragStart, onColumnDragStart, onDragEnd, onDropOnColumn,
onDropBeforeCard
}: KanbanColumnProps) {
@@ -128,7 +129,7 @@ export function KanbanColumn({
status={statusById[s.id]}
expanded={expandedIds.has(s.id)}
onToggle={() => onToggleCard(s.id)}
- onOpen={() => onOpenNode(s.id)}
+ onOpenModal={() => onOpenCard(s.id)}
onDragStart={() => onCardDragStart(s.id)}
onDragEnd={onDragEnd}
onDropBefore={() => onDropBeforeCard(s.id)}
diff --git a/src/renderer/components/kanban/KanbanView.tsx b/src/renderer/components/kanban/KanbanView.tsx
index 8e3d66c8c..4c609033d 100644
--- a/src/renderer/components/kanban/KanbanView.tsx
+++ b/src/renderer/components/kanban/KanbanView.tsx
@@ -5,9 +5,10 @@ import { useAgentStatus } from '../../state/agentStatus'
import { useProjects } from '../../state/projects'
import { useSettings } from '../../state/settings'
import {
- addColumn, assignNode, assignedTo, deleteColumn, moveColumn, nextColumnColor,
+ addColumn, assignNode, assignedTo, columnForNode, deleteColumn, moveColumn, nextColumnColor,
pruneAssignments, recolorColumn, renameColumn, unassigned
} from '../../lib/kanban'
+import { CardModal } from './CardModal'
import { KanbanColumn } from './KanbanColumn'
/** One session node shown as a board card — derived LIVE from the canvas nodes; the board
@@ -43,6 +44,10 @@ interface KanbanViewProps {
onOpenNode: (nodeId: string) => void
/** Create a node from a column's "+ New" menu (columnId null = Ungrouped: no assignment). */
onCreateNode: (choice: KanbanCreateChoice, columnId: string | null) => void
+ /** Rename a node (same funnel as the sessions sidebar). */
+ onRenameNode: (nodeId: string, title: string) => void
+ /** Write-through a sticky node's body text (only fired for kind 'sticky'). */
+ onEditSticky: (nodeId: string, text: string) => void
}
type Drag = { kind: 'card' | 'column'; id: string } | null
@@ -50,8 +55,12 @@ type Drag = { kind: 'card' | 'column'; id: string } | null
/** Full-page session board OVER the canvas. The canvas stays mounted underneath (its
* agent-status listeners must keep running, and display:none would 0×0-resize every
* terminal into a tmux SIGWINCH) — this is an opaque overlay, nothing more. */
-export function KanbanView({ board, sessions, onChange, onOpenNode, onCreateNode }: KanbanViewProps) {
+export function KanbanView({
+ board, sessions, onChange, onOpenNode, onCreateNode, onRenameNode, onEditSticky
+}: KanbanViewProps) {
const dragRef = useRef<Drag>(null)
+ // One card modal at a time; a deleted node closes it via the byId.has render guard.
+ const [modalNodeId, setModalNodeId] = useState<string | null>(null)
const statusById = useAgentStatus((s) => s.byId)
// Primitive selectors (not one object) — an object selector would re-render on every store set.
const projectName = useProjects((s) => s.projects.find((p) => p.id === s.activeProjectId)?.name)
@@ -130,7 +139,7 @@ export function KanbanView({ board, sessions, onChange, onOpenNode, onCreateNode
statusById={statusById}
expandedIds={expandedIds}
onToggleCard={toggleExpanded}
- onOpenNode={onOpenNode}
+ onOpenCard={setModalNodeId}
createOptions={createOptions}
onCreate={(choice) => onCreateNode(choice, null)}
onCardDragStart={(id) => (dragRef.current = { kind: 'card', id })}
@@ -149,7 +158,7 @@ export function KanbanView({ board, sessions, onChange, onOpenNode, onCreateNode
onRename={(t) => commit(renameColumn(board, col.id, t))}
onRecolor={(c) => commit(recolorColumn(board, col.id, c))}
onDelete={() => commit(deleteColumn(board, col.id))}
- onOpenNode={onOpenNode}
+ onOpenCard={setModalNodeId}
createOptions={createOptions}
onCreate={(choice) => onCreateNode(choice, col.id)}
onCardDragStart={(id) => (dragRef.current = { kind: 'card', id })}
@@ -166,6 +175,19 @@ export function KanbanView({ board, sessions, onChange, onOpenNode, onCreateNode
+ Add column
</button>
</div>
+ {modalNodeId && byId.has(modalNodeId) && (
+ <CardModal
+ session={byId.get(modalNodeId)!}
+ columnTitle={columnForNode(board, modalNodeId)?.title ?? null}
+ onClose={() => setModalNodeId(null)}
+ onOpenCanvas={() => {
+ setModalNodeId(null)
+ onOpenNode(modalNodeId)
+ }}
+ onRename={(t) => onRenameNode(modalNodeId, t)}
+ onEditSticky={(t) => onEditSticky(modalNodeId, t)}
+ />
+ )}
</div>
)
}
diff --git a/src/renderer/components/kanban/SessionCard.tsx b/src/renderer/components/kanban/SessionCard.tsx
index 9bedc2411..de4d7f294 100644
--- a/src/renderer/components/kanban/SessionCard.tsx
+++ b/src/renderer/components/kanban/SessionCard.tsx
@@ -6,10 +6,10 @@ interface SessionCardProps {
session: KanbanSession
status?: AgentNodeStatus
expanded: boolean
- /** Single click toggles the detail row — opening the node moved to ↗ / double-click. */
+ /** Single click toggles the detail row — opening the card moved to ↗ / double-click. */
onToggle: () => void
- /** Open on canvas: switch back to canvas view and focus this node. */
- onOpen: () => void
+ /** Open the card modal: both the ↗ button and double-click fire this. */
+ onOpenModal: () => void
onDragStart: () => void
onDragEnd: () => void
/** A dragged card was dropped on this card — insert it before this one. */
@@ -17,7 +17,7 @@ interface SessionCardProps {
}
export function SessionCard({
- session, status, expanded, onToggle, onOpen, onDragStart, onDragEnd, onDropBefore
+ session, status, expanded, onToggle, onOpenModal, onDragStart, onDragEnd, onDropBefore
}: SessionCardProps) {
const sticky = session.kind === 'sticky'
const badge =
@@ -44,7 +44,7 @@ export function SessionCard({
onClick={onToggle}
onDoubleClick={(e) => {
e.stopPropagation()
- onOpen()
+ onOpenModal()
}}
title={expanded ? 'Collapse' : 'Expand'}
>
@@ -77,7 +77,7 @@ export function SessionCard({
)}
</>
)}
- <button className="kanban-card__open" title="Open on canvas" onClick={onOpen}>
+ <button className="kanban-card__open" title="Open card" onClick={onOpenModal}>
↗
</button>
</div>
diff --git a/src/renderer/styles.css b/src/renderer/styles.css
index 0797d1076..07b49ae19 100644
--- a/src/renderer/styles.css
+++ b/src/renderer/styles.css
@@ -6632,3 +6632,103 @@ body,
-webkit-box-orient: vertical;
word-break: break-word;
}
+
+/* ---- Kanban card modal (Trello-style popup over the board) ---- */
+.kanban-modal-scrim {
+ position: fixed;
+ inset: 0;
+ z-index: 55; /* above the board (25) + drawers (~40), below ConfirmDialog (70+) */
+ background: rgba(0, 0, 0, 0.55);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.kanban-modal {
+ width: min(1040px, calc(100vw - 96px));
+ height: min(680px, calc(100vh - 120px));
+ display: flex;
+ flex-direction: column;
+ background: #161618;
+ border: 1px solid rgba(255, 255, 255, 0.12);
+ border-radius: 12px;
+ box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
+ overflow: hidden;
+}
+.kanban-modal__header {
+ flex: 0 0 auto;
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ padding: 12px 14px;
+ border-bottom: 1px solid rgba(255, 255, 255, 0.08);
+}
+.kanban-modal__title {
+ font-size: 14px;
+ font-weight: 700;
+ color: rgba(255, 255, 255, 0.92);
+ cursor: text;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+.kanban-modal__rename {
+ flex: 1;
+ min-width: 0;
+ background: rgba(255, 255, 255, 0.08);
+ border: 1px solid var(--accent);
+ border-radius: 5px;
+ color: #fff;
+ font-size: 13px;
+ padding: 3px 8px;
+ outline: none;
+}
+.kanban-modal__column {
+ font-size: 10px;
+ text-transform: uppercase;
+ letter-spacing: 0.04em;
+ color: rgba(255, 255, 255, 0.45);
+ border: 1px solid rgba(255, 255, 255, 0.15);
+ border-radius: 4px;
+ padding: 2px 6px;
+ margin-right: auto;
+}
+.kanban-modal__action {
+ background: rgba(255, 255, 255, 0.06);
+ border: none;
+ border-radius: 6px;
+ color: rgba(255, 255, 255, 0.7);
+ font-size: 13px;
+ padding: 4px 10px;
+ cursor: pointer;
+}
+.kanban-modal__action:hover {
+ background: rgba(255, 255, 255, 0.14);
+ color: #fff;
+}
+.kanban-modal__body {
+ flex: 1;
+ min-height: 0;
+ display: flex;
+}
+.kanban-modal__sticky {
+ flex: 1;
+ background: none;
+ border: none;
+ resize: none;
+ outline: none;
+ color: rgba(255, 255, 255, 0.9);
+ font-size: 13px;
+ line-height: 1.5;
+ padding: 14px 16px;
+ font-family: inherit;
+}
+.kanban-modal__pane {
+ flex: 1;
+ min-width: 0;
+ display: flex;
+}
+.kanban-modal__placeholder {
+ margin: auto;
+ color: rgba(255, 255, 255, 0.35);
+ font-size: 12px;
+}