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.
TypeScript adhdagent-orchestrationai-agentscanvasclaude-codecodexcoding-agentsdeveloper-toolselectrongeminilinuxmacosmultiplexeropencodeparallel-agentsterminalterminal-emulatorterminal-multiplexertmuxworkspace-manager
fix: style sticky-note tables and honour board --project (#1179) (#1220)
eneskircabe211c78a8c1
diff --git a/src/core/canvas-control-core.ts b/src/core/canvas-control-core.tsindex 8c3307938..8a5da9ec3 100644--- a/src/core/canvas-control-core.ts+++ b/src/core/canvas-control-core.ts@@ -1048,8 +1048,9 @@ export function buildCanvasControlInstructions(shimPath: string): string {' nothing matches. A body that STARTS with `--` must use the `=` form: `--text=<body>`. No',' confirm dialog — the note shows who wrote it and when. Use it to keep an external source',' (tickets, status) live on the canvas: rewrite one titled note each run.',- '- `board` — the project\'s kanban board: every column (id + title) and the session cards in each,',- ' plus the virtual Ungrouped column. Start here when you need a column id or want the board state.',+ '- `board [--project <id>]` — the project\'s kanban board: every column (id + title) and the session',+ ' cards in each, plus the virtual Ungrouped column. Start here when you need a column id or want the',+ ' board state. `--project` reads another project you own or open-project returned to you.','- `assign --node <id> [--column <id|title>] [--before <nodeId>]` — move a session card to a column',' (match by column id or title). Omit `--column` (or pass `ungrouped`) to send it back to Ungrouped.',' `--before <nodeId>` drops it above that card within the column; without `--before` it lands at the',@@ -1681,9 +1682,11 @@ ${boardCommentGuidanceLines().map((l) => ` ${l}`).join('\n')}which agent last wrote it and when. This is the door for syncing an external source(Linear/Jira/GitHub tickets, build status…) onto the canvas: keep ONE titled note per sourceand rewrite it each run — e.g. \`sticky --node "Linear: my tickets" --create yes --text "…"\`.-- \`board\` — read the project's kanban board: every column (id + title) and the session cards- filed in each, plus the virtual Ungrouped column (unfiled sessions). Start here when you need- a column id, or to see how the work is currently laid out.+- \`board [--project <id>]\` — read the project's kanban board: every column (id + title) and the+ session cards filed in each, plus the virtual Ungrouped column (unfiled sessions). Start here+ when you need a column id, or to see how the work is currently laid out. Without \`--project\`+ it is YOUR project's board; \`--project\` reads another project's (your own, or an id+ open-project returned to you — any other id is refused).- \`assign --node <id> [--column <id|title>] [--before <nodeId>]\` — file a session card under acolumn, matching \`--column\` by id or (case-insensitive) title. Omit \`--column\`, or pass\`ungrouped\`, to send it back to Ungrouped; \`--before <nodeId>\` drops it just above that card@@ -1715,8 +1718,9 @@ Notes:in particular, never re-send a \`denied by user\` request hoping the dialog is off now.\`a confirmation is already pending\` means a dialog for an EARLIER request is open: wait forthe user, do not spin. Server Edition uses the process-local ownership rule for \`close\` instead.-- \`board\` and \`assign\` act on the CURRENTLY OPEN project's board — the same one you see when you- toggle the kanban view. They need no confirmation.+- \`board\` and \`assign\` act on YOUR project's board (the project your node is in), not on the+ one the user happens to have on screen; \`board --project <id>\` reads another project's board,+ \`assign\` takes no \`--project\`. They need no confirmation.- If the CLI says canvas control is unavailable, you are not in a controllable nodeterm session — do not retry.${ownerUnreachableGuidanceLines().join('\n')}diff --git a/src/core/project-grants.ts b/src/core/project-grants.tsindex 0ffc12c2d..e38ac18cd 100644--- a/src/core/project-grants.ts+++ b/src/core/project-grants.ts@@ -63,7 +63,8 @@ export function clearAll(): void {/** The verbs that accept `--project` (spec §2.2): the three open verbs, `run` (#925), plus* `settings`, whose per-project keys (@shared/settings-verb) may name a project other than the* caller's — own or granted only, the same rule, decided here before anything is forwarded.- * `--project` on any other verb is dead weight the gate deliberately ignores (spec §7.5). */+ * `--project` on any other verb is dead weight the gate deliberately ignores (spec §7.5). The+ * renderer resolves a targetable verb's `--project` itself; a verb added here owes that too. */export const PROJECT_TARGETABLE_VERBS: ReadonlySet<string> = new Set(['open-terminal','open-claude',@@ -73,7 +74,10 @@ export const PROJECT_TARGETABLE_VERBS: ReadonlySet<string> = new Set(['settings',// Read-only GitHub lane of a project (core/github/control-read.ts): own or granted, like the rest.'issues',- 'prs'+ 'prs',+ // #1179: a read of another project's kanban board — own or granted, like issues/prs. Without it+ // `--project` was ignored and the caller's own board answered, silently about another project.+ 'board'])/** The flat refusal an UNVERIFIED caller's `--project` gets — one sentence, no diagnosis, nodiff --git a/src/main/canvas-control-core.test.ts b/src/main/canvas-control-core.test.tsindex 2629c595b..08e2b128a 100644--- a/src/main/canvas-control-core.test.ts+++ b/src/main/canvas-control-core.test.ts@@ -1669,6 +1669,24 @@ describe('the read-only GitHub lane verbs (issues, prs) in both agent-facing bod})})+describe('board --project (issue #1179)', () => {+ const bodies: [string, string][] = [+ ['skill', buildCanvasSkillBody('/x/shim.sh')],+ ['instructions', buildCanvasControlInstructions('/x/shim.sh')]+ ]++ it('board is --project-targetable, so main gates the id (own or granted)', () => {+ expect(PROJECT_TARGETABLE_VERBS.has('board')).toBe(true)+ })++ it('no body still claims board acts on the CURRENTLY OPEN project', () => {+ for (const [name, body] of bodies) {+ expect(body, name).not.toMatch(/CURRENTLY OPEN project/)+ expect(body, name).toContain('`board [--project <id>]`')+ }+ })+})+describe('open-project --name limit in the agent-facing text (issue #940)', () => {it('both bodies name the limit, rendered from PROJECT_NAME_MAX', () => {const sentence = `\`--name\` over ${PROJECT_NAME_MAX} characters`diff --git a/src/main/project-grants.test.ts b/src/main/project-grants.test.tsindex f54f6cef0..a3c691115 100644--- a/src/main/project-grants.test.ts+++ b/src/main/project-grants.test.ts@@ -124,6 +124,12 @@ describe('gateProjectTarget (spec §3/§5) — every branch, fail closed', () =>})})+ it('refuses `board --project <foreign, ungranted>` like any stranger id (#1179)', () => {+ expect(gateProjectTarget({ ...base, verb: 'board', targetProjectId: 'proj-foreign' })).toEqual({+ refuse: PROJECT_TARGET_REFUSED+ })+ })+it('is a no-op when no --project is present', () => {expect(gateProjectTarget({ ...base, targetProjectId: undefined })).toBe('allow')})diff --git a/src/renderer/canvas/Canvas.tsx b/src/renderer/canvas/Canvas.tsxindex 724d00702..21ad95571 100644--- a/src/renderer/canvas/Canvas.tsx+++ b/src/renderer/canvas/Canvas.tsx@@ -769,7 +769,7 @@ import type {TranscriptHit} from '@shared/types'import type { KanbanCreateChoice, KanbanSession } from '../components/kanban/KanbanView'-import { assignNode, assignedTo, defaultKanban, labelsForCard, migrateProjectTags, resolveColumnRef, unassigned } from '../lib/kanban'+import { assignNode, defaultKanban, labelsForCard, migrateProjectTags, resolveColumnRef } from '../lib/kanban'import { registerWorkspaceDirty } from '../state/workspaceDirty'import { snapNodeToGrid } from '../lib/nodeSizing'import { snapResizeChanges } from '../lib/resizeSnap'@@ -942,6 +942,7 @@ import {import type { CodexAccount } from '@shared/codex-account'import { useSystemCodexAccount } from '../state/systemCodexAccount'import { kanbanSessionsFrom, toKanbanSession } from './toKanbanSession'+import { boardVerbReply } from '../lib/boardVerb'import type { TeamStation } from '../lib/teamProgress'import { canvasTeamStations, useTeamStations } from '../state/teamStations'import { applyPullAutoMove } from '../lib/pullAutoMove'@@ -13277,6 +13278,38 @@ export function Canvas() {return}}+ // #1179: `board --project <id>` reads THAT project's board. Main has already gated the id (own+ // or granted, PROJECT_TARGETABLE_VERBS); this resolves it with the same belt as `run`. It used+ // to fall through and answer with the caller's own board, silently about the wrong project.+ // Read-only: the board is answered from the target's nodes (live when it is on screen, else+ // its serialized ones) and never moves the user's view.+ if (verb === 'board' && args.project !== undefined) {+ const boardStore = useProjects.getState()+ const boardResolved = resolveProjectTarget({+ targetId: args.project,+ sourceNodeId,+ liveNodes: nodesRef.current,+ projects: boardStore.projects,+ activeProjectId: boardStore.activeProjectId,+ sshVerbWord: 'opening'+ })+ if (boardResolved.kind === 'refused') {+ reply({ ok: false, error: boardResolved.error })+ return+ }+ if (boardResolved.kind === 'target') {+ const target = boardResolved.project+ const targetNodes =+ target.id === boardStore.activeProjectId && nodesProjectIdRef.current === target.id+ ? (nodesRef.current as CanvasNode[])+ : nodeStatesToFlow(target.nodes)+ const sessions = targetNodes+ .map(toKanbanSession)+ .filter((s): s is KanbanSession => s !== null)+ reply({ ok: true, ...boardVerbReply(target.kanban, sessions, target.name) })+ return+ }+ }// ── end of the early-handled (store-answered) verbs ─────────────────────────────────────// Which canvas answers? React Flow holds only the ACTIVE project's nodes, but every OTHER@@ -15633,56 +15666,19 @@ export function Canvas() {return}case 'board': {- // Read-only snapshot of the CALLER'S project's kanban board: columns + the session- // cards filed in each, plus the virtual Ungrouped column. The board's cards ARE the- // canvas session nodes (toKanbanSession), derived from `ctlNodes()` — the board file- // only stores column assignments, so a session with no/dangling assignment sits- // Ungrouped.+ // Read-only snapshot of the CALLER'S project's kanban board (lib/boardVerb): columns ++ // the session cards filed in each, plus the virtual Ungrouped column. The board's cards+ // ARE the canvas session nodes (toKanbanSession), derived from `ctlNodes()`.+ // `board --project <other>` never reaches here — it is answered before the routing.//// `ctlProject`, not `activeProjectId`: off canvas those are two different projects, and// reading the active one would answer a background agent's `board` with whatever the// human happens to be looking at. On screen they are the same project, which is why// the old read was never wrong in practice — the travel had already made it true.- const board = ctlProject?.kanbanconst sessions = ctlNodes().map(toKanbanSession).filter((s): s is KanbanSession => s !== null)- const titleOf = new Map(sessions.map((s) => [s.id, s.title || 'Untitled']))- const sessionIds = sessions.map((s) => s.id)- if (!board) {- // No board yet (lazy default not written) — every session is Ungrouped.- const lines = [- 'Kanban board: (no columns yet — default To Do / In Progress / Done appears on first edit)',- `Ungrouped (${sessionIds.length}):`,- ...sessionIds.map((id) => ` - ${titleOf.get(id)} (id: ${id})`)- ]- reply({- ok: true,- message: lines.join('\n'),- result: { columns: [], ungrouped: sessionIds }- })- return- }- const columnsOut = board.columns.map((c) => {- const ids = assignedTo(board, c.id).filter((id) => titleOf.has(id))- return { id: c.id, title: c.title, cards: ids }- })- const ungroupedIds = unassigned(board, sessionIds)- const fmt = (ids: string[]) => ids.map((id) => ` - ${titleOf.get(id)} (id: ${id})`)- const lines = [- 'Kanban board:',- ...columnsOut.flatMap((c) => [- `${c.title} (${c.cards.length}) [column id: ${c.id}]:`,- ...fmt(c.cards)- ]),- `Ungrouped (${ungroupedIds.length}):`,- ...fmt(ungroupedIds)- ]- reply({- ok: true,- message: lines.join('\n'),- result: { columns: columnsOut, ungrouped: ungroupedIds }- })+ reply({ ok: true, ...boardVerbReply(ctlProject?.kanban, sessions) })return}case 'assign': {diff --git a/src/renderer/canvas/board-project.source.test.ts b/src/renderer/canvas/board-project.source.test.tsnew file mode 100644index 000000000..0f4bfe173--- /dev/null+++ b/src/renderer/canvas/board-project.source.test.ts@@ -0,0 +1,23 @@+import { describe, expect, it } from 'vitest'+import { readFileSync } from 'node:fs'+import { join } from 'node:path'++/**+ * Issue #1179: `board --project <id>` used to fall through to `case 'board'`, which answers from the+ * CALLER's project — so the agent was told about its own board while believing it read another.+ * The targeted read must be answered before the routing, from the TARGET project.+ */+const SRC = readFileSync(join(__dirname, 'Canvas.tsx'), 'utf8').replace(/\r\n/g, '\n')++describe('board --project wiring', () => {+ it('is resolved before the routing, through resolveProjectTarget, from the target project', () => {+ const at = SRC.indexOf("if (verb === 'board' && args.project !== undefined) {")+ const end = SRC.indexOf('// ── end of the early-handled (store-answered) verbs')+ expect(at).toBeGreaterThan(-1)+ expect(at).toBeLessThan(end)+ const block = SRC.slice(at, end)+ expect(block).toContain('resolveProjectTarget(')+ expect(block).toContain('boardVerbReply(target.kanban, sessions, target.name)')+ expect(block).not.toContain('ctlProject')+ })+})diff --git a/src/renderer/canvas/control-open-project.source.test.ts b/src/renderer/canvas/control-open-project.source.test.tsindex a90249c26..758ec5529 100644--- a/src/renderer/canvas/control-open-project.source.test.ts+++ b/src/renderer/canvas/control-open-project.source.test.ts@@ -125,12 +125,12 @@ describe('the --project targeted-opens block (source pins)', () => {)})- it('the --project belt is ONE definition: open-* and run both call resolveProjectTarget (#925)', () => {+ it('the --project belt is ONE definition: open-*, run and board all call resolveProjectTarget (#925, #1179)', () => {// Two hand-copies of the caller-project resolution + source + target checks are how one of// them drifts (CLAUDE.md "Adding a new agent" rule 10). Neither block may re-grow an inline// copy of the belt; each passes only the word its refusal differs in.const body = targetedOpensBody()- expect(body.match(/resolveProjectTarget\(/g)?.length).toBe(2)+ expect(body.match(/resolveProjectTarget\(/g)?.length).toBe(3)expect(body).toMatch(/resolveProjectTarget\(\{[^}]*sshVerbWord: 'opening'/)expect(body).toMatch(/resolveProjectTarget\(\{[^}]*sshVerbWord: 'starting'/)for (const inline of [diff --git a/src/renderer/lib/boardVerb.test.ts b/src/renderer/lib/boardVerb.test.tsnew file mode 100644index 000000000..5b2fce768--- /dev/null+++ b/src/renderer/lib/boardVerb.test.ts@@ -0,0 +1,43 @@+import { describe, expect, it } from 'vitest'+import { boardVerbReply } from './boardVerb'+import type { ProjectKanban } from '@shared/types'++const board: ProjectKanban = {+ columns: [+ { id: 'c1', title: 'To Do' },+ { id: 'c2', title: 'Done' }+ ],+ assignments: [+ { nodeId: 'a', columnId: 'c2' },+ { nodeId: 'gone', columnId: 'c1' }+ ]+} as ProjectKanban++describe('boardVerbReply', () => {+ it('lists each column with its live session cards and the rest as Ungrouped', () => {+ const r = boardVerbReply(board, [+ { id: 'a', title: 'Alpha' },+ { id: 'b', title: '' }+ ])+ expect(r.result).toEqual({+ columns: [+ { id: 'c1', title: 'To Do', cards: [] },+ { id: 'c2', title: 'Done', cards: ['a'] }+ ],+ ungrouped: ['b']+ })+ expect(r.message).toContain('Done (1) [column id: c2]:\n - Alpha (id: a)')+ expect(r.message).toContain('Ungrouped (1):\n - Untitled (id: b)')+ expect(r.message.startsWith('Kanban board:')).toBe(true)+ })++ it('a board-less project puts every session in Ungrouped', () => {+ const r = boardVerbReply(undefined, [{ id: 'a', title: 'Alpha' }])+ expect(r.result).toEqual({ columns: [], ungrouped: ['a'] })+ expect(r.message).toMatch(/no columns yet/)+ })++ it('names the project when reading another project (board --project)', () => {+ expect(boardVerbReply(undefined, [], 'Other').message).toMatch(/^Kanban board of project "Other"/)+ })+})diff --git a/src/renderer/lib/boardVerb.ts b/src/renderer/lib/boardVerb.tsnew file mode 100644index 000000000..465377e52--- /dev/null+++ b/src/renderer/lib/boardVerb.ts@@ -0,0 +1,54 @@+/**+ * The `board` control verb's answer: the kanban board's columns, the session cards filed in each,+ * and the virtual Ungrouped column. Pure, so the two callers — the caller's own project (the+ * dispatch's `case 'board'`) and `board --project <id>` (an own or granted project, issue #1179) —+ * cannot describe a board two ways.+ *+ * `sessions` are the project's session cards (`toKanbanSession` over that project's nodes): the+ * board file only stores column assignments, so a session with no/dangling assignment sits+ * Ungrouped, and an assignment for a node that is not a session is not listed.+ */+import type { ProjectKanban } from '@shared/types'+import { assignedTo, unassigned } from './kanban'++export interface BoardVerbReply {+ message: string+ result: { columns: { id: string; title: string; cards: string[] }[]; ungrouped: string[] }+}++export function boardVerbReply(+ board: ProjectKanban | undefined,+ sessions: readonly { id: string; title?: string }[],+ projectName?: string+): BoardVerbReply {+ const titleOf = new Map(sessions.map((s) => [s.id, s.title || 'Untitled']))+ const sessionIds = sessions.map((s) => s.id)+ const head = projectName ? `Kanban board of project "${projectName}"` : 'Kanban board'+ const fmt = (ids: string[]) => ids.map((id) => ` - ${titleOf.get(id)} (id: ${id})`)+ if (!board) {+ // No board yet (lazy default not written) — every session is Ungrouped.+ return {+ message: [+ `${head}: (no columns yet — default To Do / In Progress / Done appears on first edit)`,+ `Ungrouped (${sessionIds.length}):`,+ ...fmt(sessionIds)+ ].join('\n'),+ result: { columns: [], ungrouped: sessionIds }+ }+ }+ const columns = board.columns.map((c) => ({+ id: c.id,+ title: c.title,+ cards: assignedTo(board, c.id).filter((id) => titleOf.has(id))+ }))+ const ungrouped = unassigned(board, sessionIds)+ return {+ message: [+ `${head}:`,+ ...columns.flatMap((c) => [`${c.title} (${c.cards.length}) [column id: ${c.id}]:`, ...fmt(c.cards)]),+ `Ungrouped (${ungrouped.length}):`,+ ...fmt(ungrouped)+ ].join('\n'),+ result: { columns, ungrouped }+ }+}diff --git a/src/renderer/styles.css b/src/renderer/styles.cssindex 44ba26424..2800dbd20 100644--- a/src/renderer/styles.css+++ b/src/renderer/styles.css@@ -3233,9 +3233,11 @@ body,and a horizontal scroll inside the table for one wider than the view, so the thread neverscrolls sideways. A column's `:---:` alignment arrives as an `align` attribute, which an author`text-align` would override — so only a header WITHOUT one is set (to the start edge, matching- its cells, instead of the browser's centred default). */+ its cells, instead of the browser's centred default). Sticky notes (on the canvas and in the+ kanban card modal — both render through `.sticky-node__md`) share the group (issue #1179). */.term-md__content table,-.term-chat__text table {+.term-chat__text table,+.sticky-node__md table {display: block;width: max-content;max-width: 100%;@@ -3247,20 +3249,24 @@ body,.term-md__content th,.term-md__content td,.term-chat__text th,-.term-chat__text td {+.term-chat__text td,+.sticky-node__md th,+.sticky-node__md td {border: 1px solid rgba(var(--tint-rgb), 0.22);padding: 4px 10px;vertical-align: top;}.term-md__content th,-.term-chat__text th {+.term-chat__text th,+.sticky-node__md th {background: rgba(var(--tint-rgb), 0.06);font-weight: 600;}.term-md__content th:not([align]),-.term-chat__text th:not([align]) {+.term-chat__text th:not([align]),+.sticky-node__md th:not([align]) {text-align: start;}diff --git a/src/renderer/styles.markdown-table.test.ts b/src/renderer/styles.markdown-table.test.tsindex fb8c500e7..9bf318be4 100644--- a/src/renderer/styles.markdown-table.test.ts+++ b/src/renderer/styles.markdown-table.test.ts@@ -5,7 +5,8 @@ import { join } from 'node:path'/*** Rendered-Markdown tables get gridlines in every reading view. The chat view had no table rules* at all (cells ran together with no lines), and the output view's lines used the 10% separator- * token. One rule group now covers both containers; this pins that neither drops out of it.+ * token. One rule group now covers both containers, and sticky notes (canvas + kanban card modal,+ * issue #1179); this pins that none of them drops out of it.*/const CSS = readFileSync(join(__dirname, 'styles.css'), 'utf8').replace(/\r\n/g, '\n')@@ -19,17 +20,17 @@ function group(selectors: string[]): string {describe('Markdown table gridlines', () => {it('every cell of both views has a visible border', () => {- const cells = group(['.term-md__content th', '.term-md__content td', '.term-chat__text th', '.term-chat__text td'])+ const cells = group(['.term-md__content th', '.term-md__content td', '.term-chat__text th', '.term-chat__text td', '.sticky-node__md th', '.sticky-node__md td'])expect(cells).toMatch(/border:\s*1px solid rgba\(var\(--tint-rgb\), 0\.22\)/)})it('header cells are tinted in both views', () => {- expect(group(['.term-md__content th', '.term-chat__text th'])).toMatch(/background:/)+ expect(group(['.term-md__content th', '.term-chat__text th', '.sticky-node__md th'])).toMatch(/background:/)})it('a wide table scrolls inside itself in both views', () => {- const table = group(['.term-md__content table', '.term-chat__text table'])+ const table = group(['.term-md__content table', '.term-chat__text table', '.sticky-node__md table'])expect(table).toMatch(/border-collapse:\s*collapse/)expect(table).toMatch(/overflow-x:\s*auto/)@@ -37,8 +38,8 @@ describe('Markdown table gridlines', () => {})it('leaves text-align to the Markdown column alignment, start-aligning only unaligned headers', () => {- const cells = group(['.term-md__content th', '.term-md__content td', '.term-chat__text th', '.term-chat__text td'])- const unaligned = group(['.term-md__content th:not([align])', '.term-chat__text th:not([align])'])+ const cells = group(['.term-md__content th', '.term-md__content td', '.term-chat__text th', '.term-chat__text td', '.sticky-node__md th', '.sticky-node__md td'])+ const unaligned = group(['.term-md__content th:not([align])', '.term-chat__text th:not([align])', '.sticky-node__md th:not([align])'])expect(cells).not.toMatch(/text-align/)expect(unaligned).toMatch(/text-align:\s*start/)