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 metadata — members, due dates, dated activity feed

enes13475baa471e
diff --git a/src/core/workspace-files.test.ts b/src/core/workspace-files.test.ts
index 15ed7844b..2092f0cf9 100644
--- a/src/core/workspace-files.test.ts
+++ b/src/core/workspace-files.test.ts
@@ -251,7 +251,8 @@ describe('kanban board persistence', () => {
{ id: 'kcol-a', title: 'To Do', color: '#0a84ff' },
{ id: 'kcol-b', title: 'Done', color: '#32d74b' }
],
- assignments: [{ nodeId: 'term-abc', columnId: 'kcol-a' }]
+ assignments: [{ nodeId: 'term-abc', columnId: 'kcol-a' }],
+ meta: [{ nodeId: 'term-abc', assignees: [{ name: 'enes', color: '#0a84ff' }], dueAt: 1784500000000 }]
}
it('rides the project file round-trip', () => {
const f = projectToFile(project({ kanban: board }), 1, '2026-07-18T00:00:00.000Z')
diff --git a/src/renderer/components/kanban/BoardLogPanel.tsx b/src/renderer/components/kanban/BoardLogPanel.tsx
index 2e20f7888..5e0b35bb6 100644
--- a/src/renderer/components/kanban/BoardLogPanel.tsx
+++ b/src/renderer/components/kanban/BoardLogPanel.tsx
@@ -27,9 +27,33 @@ function eventLine(name: string, e: BoardLogEvent): string {
return `${name} renamed column ${e.from ?? ''} → ${e.to ?? ''}`
case 'column-deleted':
return `${name} deleted column ${e.title ?? ''}`.trimEnd()
+ case 'member-assigned':
+ return `${name} assigned ${e.to ?? 'someone'}`
+ case 'member-unassigned':
+ return `${name} removed ${e.to ?? 'someone'}`
+ case 'due-set':
+ return `${name} set the due date → ${e.to ? formatStamp(Date.parse(e.to)) : ''}`.trimEnd()
+ case 'due-cleared':
+ return `${name} removed the due date`
+ default:
+ // A newer peer may write event types this build doesn't know — show them neutrally.
+ return `${name} updated this card`
}
}
+/** Absolute, Trello-style stamp ("19 Jul 2026, 22:50") — the feed shows dates, not "2h ago"
+ * (the relative form stays in the row's tooltip). */
+function formatStamp(ts: number): string {
+ if (!Number.isFinite(ts)) return ''
+ return new Date(ts).toLocaleString(undefined, {
+ day: 'numeric',
+ month: 'short',
+ year: 'numeric',
+ hour: '2-digit',
+ minute: '2-digit'
+ })
+}
+
/** Right panel of the card modal (all card kinds): a composer on top and the card's own
* comments + activity feed newest-first. Reads/writes the board log for the ACTIVE project via
* its session api — resolved here (not threaded from Canvas). Subscribes on mount, so a teammate's
@@ -93,16 +117,22 @@ export function BoardLogPanel({ card }: BoardLogPanelProps) {
}
function FeedRow({ entry }: { entry: BoardLogEntry }) {
- const when = formatTimeAgo(entry.ts)
+ const when = formatStamp(entry.ts)
+ const whenAgo = formatTimeAgo(entry.ts)
if (entry.kind === 'event' && entry.event) {
- return <div className="board-log__event">{eventLine(entry.author.name, entry.event)}</div>
+ return (
+ <div className="board-log__event" title={whenAgo}>
+ {eventLine(entry.author.name, entry.event)}
+ <span className="board-log__time">{when}</span>
+ </div>
+ )
}
return (
<div className="board-log__comment">
<div className="board-log__meta">
<span className="board-log__dot" style={{ background: entry.author.color }} />
<span className="board-log__author">{entry.author.name}</span>
- <span className="board-log__time">{when}</span>
+ <span className="board-log__time" title={whenAgo}>{when}</span>
</div>
<div className="board-log__text">{entry.text}</div>
</div>
diff --git a/src/renderer/components/kanban/CardMetaBar.tsx b/src/renderer/components/kanban/CardMetaBar.tsx
new file mode 100644
index 000000000..10a2aafeb
--- /dev/null
+++ b/src/renderer/components/kanban/CardMetaBar.tsx
@@ -0,0 +1,116 @@
+import { useMemo, useState } from 'react'
+import type { BoardLogAuthor, ProjectKanban } from '@shared/types'
+import { cardMeta, setCardDue, toggleAssignee } from '../../lib/kanban'
+import { loadIdentity, selectOthers, usePresence } from '../../state/presence'
+import { useBoardLog } from '../../state/boardLog'
+import { useProjects } from '../../state/projects'
+
+const initialOf = (name: string): string => (name.trim()[0] ?? '?').toUpperCase()
+
+/** Local-wallclock value for a datetime-local input (its value is timezone-less). */
+function toLocalInput(ts: number): string {
+ const d = new Date(ts)
+ const p = (n: number): string => String(n).padStart(2, '0')
+ return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())}T${p(d.getHours())}:${p(d.getMinutes())}`
+}
+
+interface CardMetaBarProps {
+ nodeId: string
+ board: ProjectKanban
+ onChange: (next: ProjectKanban) => void
+}
+
+/** Trello-style Members / Due date strip under the modal header. The assignable pool is
+ * everyone the session can NAME: me (presence identity), live presence peers, and every
+ * author already seen in the board log — no separate membership system. */
+export function CardMetaBar({ nodeId, board, onChange }: CardMetaBarProps) {
+ const [pickerOpen, setPickerOpen] = useState(false)
+ const meta = cardMeta(board, nodeId)
+ const projectId = useProjects((s) => s.activeProjectId)
+ const logEntries = useBoardLog((s) => s.entriesFor(projectId))
+ const peers = usePresence(selectOthers)
+
+ const pool = useMemo(() => {
+ const seen = new Map<string, BoardLogAuthor>()
+ const add = (a: { name?: string; color?: string } | null | undefined): void => {
+ if (a?.name && a.color && !seen.has(a.name)) seen.set(a.name, { name: a.name, color: a.color })
+ }
+ add(loadIdentity() ?? { name: 'you', color: '#8e8e93' })
+ for (const p of peers) add(p)
+ for (const e of logEntries) add(e.author)
+ return [...seen.values()]
+ }, [peers, logEntries])
+
+ const assignees = meta?.assignees ?? []
+ const due = meta?.dueAt
+ const overdue = due !== undefined && due < Date.now()
+
+ return (
+ <div className="kanban-meta">
+ <div className="kanban-meta__group">
+ <span className="kanban-meta__label">Members</span>
+ <div className="kanban-meta__row">
+ {assignees.map((a) => (
+ <button
+ key={a.name}
+ className="kanban-avatar"
+ style={{ background: a.color }}
+ title={`${a.name} — click to unassign`}
+ onClick={() => onChange(toggleAssignee(board, nodeId, a))}
+ >
+ {initialOf(a.name)}
+ </button>
+ ))}
+ <button
+ className="kanban-avatar kanban-avatar--add"
+ title="Assign a member"
+ onClick={() => setPickerOpen((v) => !v)}
+ >
+ +
+ </button>
+ {pickerOpen && (
+ <div className="kanban-meta__picker">
+ {pool.map((p) => {
+ const on = assignees.some((a) => a.name === p.name)
+ return (
+ <button key={p.name} onClick={() => onChange(toggleAssignee(board, nodeId, p))}>
+ <span className="kanban-avatar" style={{ background: p.color }}>
+ {initialOf(p.name)}
+ </span>
+ <span className="kanban-meta__pname">{p.name}</span>
+ {on && <span className="kanban-meta__check">✓</span>}
+ </button>
+ )
+ })}
+ </div>
+ )}
+ </div>
+ </div>
+ <div className="kanban-meta__group">
+ <span className="kanban-meta__label">Due date</span>
+ <div className="kanban-meta__row">
+ <input
+ type="datetime-local"
+ className="kanban-meta__due"
+ value={due !== undefined ? toLocalInput(due) : ''}
+ onChange={(e) =>
+ onChange(
+ setCardDue(board, nodeId, e.target.value ? new Date(e.target.value).getTime() : null)
+ )
+ }
+ />
+ {overdue && <span className="kanban-due kanban-due--overdue">Overdue</span>}
+ {due !== undefined && (
+ <button
+ className="kanban-meta__clear"
+ title="Clear due date"
+ onClick={() => onChange(setCardDue(board, nodeId, null))}
+ >
+ ✕
+ </button>
+ )}
+ </div>
+ </div>
+ </div>
+ )
+}
diff --git a/src/renderer/components/kanban/CardModal.tsx b/src/renderer/components/kanban/CardModal.tsx
index 31c51b0f3..02b1d59f1 100644
--- a/src/renderer/components/kanban/CardModal.tsx
+++ b/src/renderer/components/kanban/CardModal.tsx
@@ -5,14 +5,19 @@ import { IconChat, IconMic, IconSearch } from '../icons'
import { ContextMeter } from '../ContextMeter'
import { useAgentStatus } from '../../state/agentStatus'
import { useSession } from '../../session/session'
+import type { ProjectKanban } from '@shared/types'
import type { KanbanSession } from './KanbanView'
import { BoardLogPanel } from './BoardLogPanel'
+import { CardMetaBar } from './CardMetaBar'
import { ModalTerminal } from './ModalTerminal'
interface CardModalProps {
session: KanbanSession
/** Column title shown as a chip; null = Ungrouped. */
columnTitle: string | null
+ /** The live board + its pruned commit — the Members/Due strip edits through them. */
+ board: ProjectKanban
+ onChangeBoard: (next: ProjectKanban) => void
onClose: () => void
/** Secondary action: close the modal, switch to canvas, focus the node. */
onOpenCanvas: () => void
@@ -25,7 +30,7 @@ interface CardModalProps {
/** Trello-style card popup over the board. Scrim click / Esc close it; the board (and the
* canvas under it) stay mounted. Terminal cards carry the node header's actions too:
* search / dictate / AI-name / markdown view (the node itself is hidden under the board). */
-export function CardModal({ session, columnTitle, onClose, onOpenCanvas, onRename, onEditSticky }: CardModalProps) {
+export function CardModal({ session, columnTitle, board, onChangeBoard, onClose, onOpenCanvas, onRename, onEditSticky }: CardModalProps) {
const { api } = useSession()
const idRef = useRef<string>()
if (!idRef.current) idRef.current = nextDialogId()
@@ -156,6 +161,7 @@ export function CardModal({ session, columnTitle, onClose, onOpenCanvas, onRenam
✕
</button>
</div>
+ <CardMetaBar nodeId={session.id} board={board} onChange={onChangeBoard} />
<div className="kanban-modal__body">
{/* Body is a flex row: the card's own pane (2/3) + the board-log panel (1/3, all kinds). */}
<div className="kanban-modal__main">
diff --git a/src/renderer/components/kanban/KanbanColumn.tsx b/src/renderer/components/kanban/KanbanColumn.tsx
index c7e6d8f46..e6e2c4608 100644
--- a/src/renderer/components/kanban/KanbanColumn.tsx
+++ b/src/renderer/components/kanban/KanbanColumn.tsx
@@ -3,6 +3,7 @@ import type { KanbanColumn as KanbanColumnT } from '@shared/types'
import type { AgentNodeStatus } from '../../state/agentStatus'
import { NODE_COLORS } from '../../state/workspace'
import { SessionCard } from './SessionCard'
+import type { KanbanCardMeta } from '@shared/types'
import type { KanbanCreateChoice, KanbanCreateOption, KanbanSession } from './KanbanView'
interface KanbanColumnProps {
@@ -15,6 +16,8 @@ interface KanbanColumnProps {
onDelete?: () => void
/** Open a card's modal (↗ / double-click on the card). */
onOpenCard: (nodeId: string) => void
+ /** Card metadata lookup (assignees/due) for the chips on each card. */
+ metaOf: (nodeId: string) => KanbanCardMeta | undefined
/** "+ New" menu entries (agents, terminal, sticky) and what to do when one is picked. */
createOptions: KanbanCreateOption[]
onCreate: (choice: KanbanCreateChoice) => void
@@ -28,7 +31,7 @@ interface KanbanColumnProps {
}
export function KanbanColumn({
- column, cards, statusById, onRename, onRecolor, onDelete, onOpenCard,
+ column, cards, statusById, metaOf, onRename, onRecolor, onDelete, onOpenCard,
createOptions, onCreate, onCardDragStart, onColumnDragStart, onDragEnd, onDropOnColumn,
onDropBeforeCard
}: KanbanColumnProps) {
@@ -129,6 +132,7 @@ export function KanbanColumn({
key={s.id}
session={s}
status={statusById[s.id]}
+ meta={metaOf(s.id)}
onOpen={() => onOpenCard(s.id)}
onDragStart={() => onCardDragStart(s.id)}
onDragEnd={onDragEnd}
diff --git a/src/renderer/components/kanban/KanbanView.tsx b/src/renderer/components/kanban/KanbanView.tsx
index 3be1c4e65..0752b5a5d 100644
--- a/src/renderer/components/kanban/KanbanView.tsx
+++ b/src/renderer/components/kanban/KanbanView.tsx
@@ -5,8 +5,8 @@ import { useAgentStatus } from '../../state/agentStatus'
import { useProjects } from '../../state/projects'
import { useSettings } from '../../state/settings'
import {
- addColumn, assignNode, assignedTo, columnForNode, deleteColumn, moveColumn, nextColumnColor,
- pruneAssignments, recolorColumn, renameColumn, unassigned
+ addColumn, assignNode, assignedTo, cardMeta, columnForNode, deleteColumn, moveColumn,
+ nextColumnColor, pruneAssignments, recolorColumn, renameColumn, unassigned
} from '../../lib/kanban'
import { CardModal } from './CardModal'
import { KanbanColumn } from './KanbanColumn'
@@ -131,6 +131,7 @@ export function KanbanView({
column={null}
cards={sessionsFor(unassigned(board, sessions.map((s) => s.id)))}
statusById={statusById}
+ metaOf={(id) => cardMeta(board, id)}
onOpenCard={setModalNodeId}
createOptions={createOptions}
onCreate={(choice) => onCreateNode(choice, null)}
@@ -145,6 +146,7 @@ export function KanbanView({
column={col}
cards={sessionsFor(assignedTo(board, col.id))}
statusById={statusById}
+ metaOf={(id) => cardMeta(board, id)}
onRename={(t) => commit(renameColumn(board, col.id, t))}
onRecolor={(c) => commit(recolorColumn(board, col.id, c))}
onDelete={() => commit(deleteColumn(board, col.id))}
@@ -169,6 +171,8 @@ export function KanbanView({
<CardModal
session={byId.get(modalNodeId)!}
columnTitle={columnForNode(board, modalNodeId)?.title ?? null}
+ board={board}
+ onChangeBoard={commit}
onClose={() => setModalNodeId(null)}
onOpenCanvas={() => {
setModalNodeId(null)
diff --git a/src/renderer/components/kanban/SessionCard.tsx b/src/renderer/components/kanban/SessionCard.tsx
index a0b0daea8..cf79f7c36 100644
--- a/src/renderer/components/kanban/SessionCard.tsx
+++ b/src/renderer/components/kanban/SessionCard.tsx
@@ -1,4 +1,5 @@
import { useState } from 'react'
+import type { KanbanCardMeta } from '@shared/types'
import type { AgentNodeStatus } from '../../state/agentStatus'
import { ContextMeter } from '../ContextMeter'
import type { KanbanSession } from './KanbanView'
@@ -6,6 +7,7 @@ import type { KanbanSession } from './KanbanView'
interface SessionCardProps {
session: KanbanSession
status?: AgentNodeStatus
+ meta?: KanbanCardMeta
/** Single click opens the card modal directly (the expand/collapse step was dropped). */
onOpen: () => void
onDragStart: () => void
@@ -14,7 +16,7 @@ interface SessionCardProps {
onDropBefore: () => void
}
-export function SessionCard({ session, status, onOpen, onDragStart, onDragEnd, onDropBefore }: SessionCardProps) {
+export function SessionCard({ session, status, meta, onOpen, onDragStart, onDragEnd, onDropBefore }: SessionCardProps) {
// Local drag state only styles THIS card (ghost look) — the drag payload lives in KanbanView.
const [dragging, setDragging] = useState(false)
const badge =
@@ -24,6 +26,9 @@ export function SessionCard({ session, status, onOpen, onDragStart, onDragEnd, o
? 'needs'
: null
const stickyPreview = session.kind === 'sticky' ? (session.text ?? '').trim() : ''
+ const assignees = meta?.assignees ?? []
+ const due = meta?.dueAt
+ const overdue = due !== undefined && due < Date.now()
const hasDetail = !!status?.sessionId || !!status?.session || stickyPreview.includes('\n')
return (
<div
@@ -55,6 +60,23 @@ export function SessionCard({ session, status, onOpen, onDragStart, onDragEnd, o
{badge === 'needs' && <span className="kanban-badge kanban-badge--needs">NEEDS YOU</span>}
{status?.unread && <span className="kanban-card__unread" />}
</div>
+ {(assignees.length > 0 || due !== undefined) && (
+ <div className="kanban-card__metarow">
+ {due !== undefined && (
+ <span className={`kanban-due${overdue ? ' kanban-due--overdue' : ''}`}>
+ {new Date(due).toLocaleDateString(undefined, { day: 'numeric', month: 'short' })}
+ </span>
+ )}
+ <span className="kanban-card__avatars">
+ {assignees.slice(0, 3).map((a) => (
+ <span key={a.name} className="kanban-avatar kanban-avatar--sm" style={{ background: a.color }} title={a.name}>
+ {(a.name.trim()[0] ?? '?').toUpperCase()}
+ </span>
+ ))}
+ {assignees.length > 3 && <span className="kanban-avatar kanban-avatar--sm kanban-avatar--more">+{assignees.length - 3}</span>}
+ </span>
+ </div>
+ )}
{/* Detail line is ALWAYS visible when the card has something to say (no expand step):
agents show the context meter + session chip; multi-line notes show a preview. */}
{hasDetail && (
diff --git a/src/renderer/lib/boardLogDiff.test.ts b/src/renderer/lib/boardLogDiff.test.ts
index 0236fd167..b84972d52 100644
--- a/src/renderer/lib/boardLogDiff.test.ts
+++ b/src/renderer/lib/boardLogDiff.test.ts
@@ -103,3 +103,34 @@ describe('boardLogEvents', () => {
])
})
})
+
+describe('card meta events', () => {
+ const enes = { name: 'enes', color: '#0a84ff' }
+ const mehmet = { name: 'mehmet', color: '#bf5af2' }
+ const titles = (id: string) => (id === 'dead' ? '' : 'card ' + id)
+ const base = () => board([col('c1', 'To Do')], [])
+ it('assigning and unassigning members emit per-person events', () => {
+ const next = { ...base(), meta: [{ nodeId: 'n1', assignees: [enes, mehmet] }] }
+ expect(boardLogEvents(base(), next, titles)).toEqual([
+ { nodeId: 'n1', event: { type: 'member-assigned', to: 'enes' } },
+ { nodeId: 'n1', event: { type: 'member-assigned', to: 'mehmet' } }
+ ])
+ const back = boardLogEvents(next, { ...base(), meta: [{ nodeId: 'n1', assignees: [enes] }] }, titles)
+ expect(back).toEqual([{ nodeId: 'n1', event: { type: 'member-unassigned', to: 'mehmet' } }])
+ })
+ it('due set / changed / cleared emit due events with ISO stamps', () => {
+ const at = Date.UTC(2026, 6, 21, 10, 0, 0)
+ const withDue = { ...base(), meta: [{ nodeId: 'n2', dueAt: at }] }
+ expect(boardLogEvents(base(), withDue, titles)).toEqual([
+ { nodeId: 'n2', event: { type: 'due-set', to: new Date(at).toISOString() } }
+ ])
+ expect(boardLogEvents(withDue, base(), titles)).toEqual([
+ { nodeId: 'n2', event: { type: 'due-cleared' } }
+ ])
+ })
+ it('meta of a dead node (prune) emits nothing; unchanged meta emits nothing', () => {
+ const withMeta = { ...base(), meta: [{ nodeId: 'dead', assignees: [enes], dueAt: 5 }] }
+ expect(boardLogEvents(withMeta, base(), titles)).toEqual([])
+ expect(boardLogEvents(withMeta, withMeta, titles)).toEqual([])
+ })
+})
diff --git a/src/renderer/lib/boardLogDiff.ts b/src/renderer/lib/boardLogDiff.ts
index b20f75e18..09a83e0db 100644
--- a/src/renderer/lib/boardLogDiff.ts
+++ b/src/renderer/lib/boardLogDiff.ts
@@ -1,4 +1,4 @@
-import type { BoardLogEvent, ProjectKanban } from '@shared/types'
+import type { BoardLogEvent, KanbanCardMeta, ProjectKanban } from '@shared/types'
// Pure prev→next board diff → the events worth recording in the board log. No fs, no IPC:
// the caller computes the next board (renderer/lib/kanban.ts) and asks here what changed.
@@ -61,5 +61,40 @@ export function boardLogEvents(
}
out.push({ nodeId, event: { type: 'card-moved', from: fromName, to: toName } })
}
+ // Card metadata: assignee add/remove (per person, matched by name) and due set/change/clear.
+ // A dead node's meta disappearing is the prune path — suppressed via the same cardTitle guard.
+ const metaOf = (k: ProjectKanban): Map<string, KanbanCardMeta> => {
+ const m = new Map<string, KanbanCardMeta>()
+ if (Array.isArray(k.meta)) for (const e of k.meta) if (e?.nodeId) m.set(e.nodeId, e)
+ return m
+ }
+ const prevM = metaOf(prev)
+ const nextM = metaOf(next)
+ const metaIds: string[] = []
+ const seenM = new Set<string>()
+ for (const id of [...prevM.keys(), ...nextM.keys()]) {
+ if (!seenM.has(id)) {
+ seenM.add(id)
+ metaIds.push(id)
+ }
+ }
+ for (const nodeId of metaIds) {
+ const pm = prevM.get(nodeId)
+ const nm = nextM.get(nodeId)
+ if (!nm && !cardTitle(nodeId)) continue // node gone (prune) → nothing to narrate
+ const pa = pm?.assignees ?? []
+ const na = nm?.assignees ?? []
+ for (const a of na) if (!pa.some((x) => x.name === a.name))
+ out.push({ nodeId, event: { type: 'member-assigned', to: a.name } })
+ for (const a of pa) if (!na.some((x) => x.name === a.name))
+ out.push({ nodeId, event: { type: 'member-unassigned', to: a.name } })
+ const pd = pm?.dueAt
+ const nd = nm?.dueAt
+ if (pd !== nd) {
+ if (nd !== undefined) out.push({ nodeId, event: { type: 'due-set', to: new Date(nd).toISOString() } })
+ else out.push({ nodeId, event: { type: 'due-cleared' } })
+ }
+ }
+
return out
}
diff --git a/src/renderer/lib/kanban.test.ts b/src/renderer/lib/kanban.test.ts
index a0b6e44d9..e1ce2972d 100644
--- a/src/renderer/lib/kanban.test.ts
+++ b/src/renderer/lib/kanban.test.ts
@@ -2,7 +2,8 @@ import { describe, it, expect } from 'vitest'
import type { ProjectKanban } from '@shared/types'
import {
addColumn, assignNode, assignedTo, defaultKanban, deleteColumn, moveColumn,
- columnForNode, nextColumnColor, pruneAssignments, recolorColumn, renameColumn, unassigned
+ cardMeta, columnForNode, nextColumnColor, pruneAssignments, recolorColumn, renameColumn,
+ setCardDue, toggleAssignee, unassigned
} from './kanban'
const board = (): ProjectKanban => ({
@@ -98,3 +99,39 @@ describe('columnForNode', () => {
expect(columnForNode(undefined, 'n1')).toBeUndefined()
})
})
+
+describe('card meta', () => {
+ const enes = { name: 'enes', color: '#0a84ff' }
+ const mehmet = { name: 'mehmet', color: '#bf5af2' }
+ it('cardMeta tolerates absent/malformed meta', () => {
+ expect(cardMeta(board(), 'n1')).toBeUndefined()
+ const bad = { ...board(), meta: 42 } as unknown as ProjectKanban
+ expect(cardMeta(bad, 'n1')).toBeUndefined()
+ })
+ it('toggleAssignee adds then removes by name; empty meta entries are dropped', () => {
+ const k1 = toggleAssignee(board(), 'n1', enes)
+ expect(cardMeta(k1, 'n1')?.assignees).toEqual([enes])
+ const k2 = toggleAssignee(k1, 'n1', mehmet)
+ expect(cardMeta(k2, 'n1')?.assignees).toEqual([enes, mehmet])
+ const k3 = toggleAssignee(k2, 'n1', { ...enes, color: '#fff' }) // match by NAME
+ expect(cardMeta(k3, 'n1')?.assignees).toEqual([mehmet])
+ const k4 = toggleAssignee(toggleAssignee(k3, 'n1', mehmet), 'n1', enes)
+ expect(cardMeta(k4, 'n1')?.assignees).toEqual([enes])
+ const k5 = toggleAssignee(k4, 'n1', enes)
+ expect(cardMeta(k5, 'n1')).toBeUndefined() // nothing left → entry dropped
+ })
+ it('setCardDue sets and clears; clearing the only field drops the entry', () => {
+ const k1 = setCardDue(board(), 'n2', 1784500000000)
+ expect(cardMeta(k1, 'n2')?.dueAt).toBe(1784500000000)
+ const k2 = setCardDue(k1, 'n2', null)
+ expect(cardMeta(k2, 'n2')).toBeUndefined()
+ })
+ it('pruneAssignments also drops dead nodes\' meta, and stays identity-stable on no-op', () => {
+ const k = setCardDue(toggleAssignee(board(), 'n1', enes), 'n9', 5)
+ const pruned = pruneAssignments(k, ['n1', 'n2', 'n3'])
+ expect(cardMeta(pruned, 'n1')?.assignees).toEqual([enes])
+ expect(cardMeta(pruned, 'n9')).toBeUndefined()
+ const same = setCardDue(board(), 'n1', 7)
+ expect(pruneAssignments(same, ['n1', 'n2', 'n3'])).toBe(same)
+ })
+})
diff --git a/src/renderer/lib/kanban.ts b/src/renderer/lib/kanban.ts
index 2881d9c06..8d0c6458b 100644
--- a/src/renderer/lib/kanban.ts
+++ b/src/renderer/lib/kanban.ts
@@ -1,4 +1,4 @@
-import type { KanbanAssignment, KanbanColumn, ProjectKanban } from '@shared/types'
+import type { BoardLogAuthor, KanbanAssignment, KanbanCardMeta, KanbanColumn, ProjectKanban } from '@shared/types'
import { NODE_COLORS } from '../state/workspace'
// Pure kanban board transforms — the ONLY place board structure changes. The UI computes
@@ -108,7 +108,16 @@ export function assignNode(
export function pruneAssignments(k: ProjectKanban, liveIds: string[]): ProjectKanban {
const live = new Set(liveIds)
const assignments = k.assignments.filter((a) => live.has(a.nodeId))
- return assignments.length === k.assignments.length ? k : { ...k, assignments }
+ const meta = metaList(k).filter((m) => m && live.has(m.nodeId))
+ const sameAssignments = assignments.length === k.assignments.length
+ const sameMeta = meta.length === metaList(k).length
+ if (sameAssignments && sameMeta) return k
+ const next: ProjectKanban = { ...k, assignments }
+ if (Array.isArray(k.meta)) {
+ if (meta.length) next.meta = meta
+ else delete next.meta
+ }
+ return next
}
/** The column a node is assigned to, resolved against a project's board — undefined when
@@ -122,3 +131,49 @@ export function columnForNode(
const a = k.assignments.find((x) => x.nodeId === nodeId)
return a ? k.columns.find((c) => c.id === a.columnId) : undefined
}
+
+/** Tolerant read of a card's metadata — `meta` may be absent or (hand-edited) malformed. */
+export function cardMeta(k: ProjectKanban, nodeId: string): KanbanCardMeta | undefined {
+ if (!Array.isArray(k.meta)) return undefined
+ return k.meta.find((m) => m && m.nodeId === nodeId)
+}
+
+const metaList = (k: ProjectKanban): KanbanCardMeta[] => (Array.isArray(k.meta) ? k.meta : [])
+
+/** Writes one card's meta back; an entry with no fields left is DROPPED (absent = clean file),
+ * and an emptied meta array drops the key entirely. */
+function withCardMeta(
+ k: ProjectKanban,
+ nodeId: string,
+ next: Omit<KanbanCardMeta, 'nodeId'> | null
+): ProjectKanban {
+ const rest = metaList(k).filter((m) => m && m.nodeId !== nodeId)
+ const keep = next && ((next.assignees?.length ?? 0) > 0 || next.dueAt !== undefined)
+ const meta = keep ? [...rest, { nodeId, ...next }] : rest
+ const { meta: _m, ...bare } = k
+ return meta.length ? { ...bare, meta } : bare
+}
+
+/** Adds the person to the card (or removes them if already assigned — matched by NAME, the
+ * presence identity's stable part; color is display-only and may drift per machine). */
+export function toggleAssignee(
+ k: ProjectKanban,
+ nodeId: string,
+ person: BoardLogAuthor
+): ProjectKanban {
+ const cur = cardMeta(k, nodeId)
+ const had = (cur?.assignees ?? []).some((a) => a.name === person.name)
+ const assignees = had
+ ? (cur?.assignees ?? []).filter((a) => a.name !== person.name)
+ : [...(cur?.assignees ?? []), person]
+ return withCardMeta(k, nodeId, { assignees, dueAt: cur?.dueAt })
+}
+
+/** Sets (or clears, with null) the card's due timestamp. */
+export function setCardDue(k: ProjectKanban, nodeId: string, dueAt: number | null): ProjectKanban {
+ const cur = cardMeta(k, nodeId)
+ return withCardMeta(k, nodeId, {
+ assignees: cur?.assignees,
+ ...(dueAt === null ? {} : { dueAt })
+ })
+}
diff --git a/src/renderer/styles.css b/src/renderer/styles.css
index 35cc0917d..f6fee80c0 100644
--- a/src/renderer/styles.css
+++ b/src/renderer/styles.css
@@ -6941,3 +6941,146 @@ body,
.term-node__comments .board-log {
border-left: none;
}
+
+/* ---- Card metadata (Trello-style Members / Due date) ---- */
+.kanban-meta {
+ flex: 0 0 auto;
+ display: flex;
+ align-items: flex-start;
+ gap: 28px;
+ padding: 10px 16px;
+ border-bottom: 1px solid rgba(255, 255, 255, 0.08);
+}
+.kanban-meta__group {
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
+}
+.kanban-meta__label {
+ font-size: 11px;
+ font-weight: 700;
+ color: rgba(255, 255, 255, 0.55);
+}
+.kanban-meta__row {
+ position: relative;
+ display: flex;
+ align-items: center;
+ gap: 6px;
+}
+.kanban-avatar {
+ width: 28px;
+ height: 28px;
+ border-radius: 50%;
+ border: none;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 12px;
+ font-weight: 700;
+ color: #fff;
+ cursor: pointer;
+ padding: 0;
+}
+.kanban-avatar--add {
+ background: rgba(255, 255, 255, 0.1);
+ color: rgba(255, 255, 255, 0.7);
+ border: 1px dashed rgba(255, 255, 255, 0.3);
+}
+.kanban-avatar--add:hover {
+ background: rgba(255, 255, 255, 0.18);
+ color: #fff;
+}
+.kanban-avatar--sm {
+ width: 18px;
+ height: 18px;
+ font-size: 9px;
+ cursor: default;
+}
+.kanban-avatar--more {
+ background: rgba(255, 255, 255, 0.18);
+}
+.kanban-meta__picker {
+ position: absolute;
+ top: 100%;
+ left: 0;
+ margin-top: 6px;
+ min-width: 180px;
+ background: #1c1c1e;
+ border: 1px solid rgba(255, 255, 255, 0.12);
+ border-radius: 8px;
+ box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
+ padding: 4px;
+ z-index: 6;
+ display: flex;
+ flex-direction: column;
+}
+.kanban-meta__picker > button {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ background: none;
+ border: none;
+ border-radius: 6px;
+ color: rgba(255, 255, 255, 0.88);
+ font-size: 12.5px;
+ padding: 5px 8px;
+ cursor: pointer;
+}
+.kanban-meta__picker > button:hover {
+ background: var(--accent);
+ color: #fff;
+}
+.kanban-meta__pname {
+ flex: 1;
+ text-align: left;
+}
+.kanban-meta__check {
+ color: #32d74b;
+}
+.kanban-meta__due {
+ background: rgba(255, 255, 255, 0.06);
+ border: 1px solid rgba(255, 255, 255, 0.15);
+ border-radius: 6px;
+ color: rgba(255, 255, 255, 0.88);
+ font-size: 12.5px;
+ padding: 4px 8px;
+ outline: none;
+ color-scheme: dark;
+}
+.kanban-meta__clear {
+ background: none;
+ border: none;
+ color: rgba(255, 255, 255, 0.4);
+ cursor: pointer;
+ font-size: 11px;
+}
+.kanban-meta__clear:hover {
+ color: #ff453a;
+}
+.kanban-due {
+ font-size: 10px;
+ font-weight: 700;
+ letter-spacing: 0.03em;
+ border-radius: 4px;
+ padding: 2px 6px;
+ background: rgba(255, 255, 255, 0.1);
+ color: rgba(255, 255, 255, 0.75);
+}
+.kanban-due--overdue {
+ background: rgba(255, 69, 58, 0.18);
+ color: #ff6961;
+}
+.kanban-card__metarow {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ margin-top: 7px;
+}
+.kanban-card__avatars {
+ margin-left: auto;
+ display: inline-flex;
+ gap: 4px;
+}
+.board-log__event .board-log__time {
+ margin-left: 6px;
+}
diff --git a/src/shared/types.ts b/src/shared/types.ts
index f48d5cc41..73730d2af 100644
--- a/src/shared/types.ts
+++ b/src/shared/types.ts
@@ -211,9 +211,21 @@ export interface KanbanAssignment {
* Absent = never edited: the renderer shows a default 3-column board and writes
* nothing until the first change. Cards are the project's session nodes — the board
* stores only their column assignments. */
+/** Trello-style per-card metadata. Lives beside the assignments (not on the node) so it rides
+ * the same git/mirror machinery; absent entries mean "no metadata". Assignee identity is the
+ * presence identity — the same {name, color} the board log attributes comments to. */
+export interface KanbanCardMeta {
+ nodeId: string
+ assignees?: BoardLogAuthor[]
+ /** Due timestamp (ms). Absent = no due date. */
+ dueAt?: number
+}
+
export interface ProjectKanban {
columns: KanbanColumn[]
assignments: KanbanAssignment[]
+ /** Optional card metadata; tolerated as absent/malformed by every reader (lib normalizes). */
+ meta?: KanbanCardMeta[]
}
/** Who produced a board-log entry (a teammate on a shared board, or this user). */
@@ -225,7 +237,16 @@ export interface BoardLogAuthor {
/** A structural board change worth recording. `type` is closed; the optional fields carry
* the human-readable names resolved at event time (the virtual column is named 'Ungrouped'). */
export interface BoardLogEvent {
- type: 'card-created' | 'card-moved' | 'column-added' | 'column-renamed' | 'column-deleted'
+ type:
+ | 'card-created'
+ | 'card-moved'
+ | 'column-added'
+ | 'column-renamed'
+ | 'column-deleted'
+ | 'member-assigned'
+ | 'member-unassigned'
+ | 'due-set'
+ | 'due-cleared'
from?: string
to?: string
/** Column title for column-added/deleted; card title for card-created. */