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(kanban): Esc in the chat view's answer box or composer no longer closes the card modal
reviewf0af59715010
diff --git a/src/renderer/components/kanban/CardModal.test.tsx b/src/renderer/components/kanban/CardModal.test.tsxindex d296cea4d..a70365f70 100644--- a/src/renderer/components/kanban/CardModal.test.tsx+++ b/src/renderer/components/kanban/CardModal.test.tsx@@ -417,6 +417,55 @@ describe('CardModal', () => {act(() => root.unmount())})+ it('yields Escape to the ⌘M chat view\'s text fields (plan Revise box, composer) — typing is not lost', () => {+ const session: KanbanSession = {+ id: 'node-sticky-chat-esc',+ title: 'Chat Esc',+ color: '#ffd60a',+ kind: 'sticky',+ text: 'x',+ spawn: {}+ }+ const root = createRoot(host)+ const onClose = vi.fn()+ act(() =>+ root.render(+ <CardModal+ session={session}+ columnTitle="To Do"+ board={board}+ onChangeBoard={vi.fn()}+ onClose={onClose}+ onOpenCanvas={vi.fn()}+ onRename={vi.fn()}+ onEditSticky={vi.fn()}+ onSetIcon={vi.fn()}+ onBrowserNav={vi.fn()}+ />+ )+ )+ const esc = () =>+ act(() => {+ window.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }))+ })+ for (const cls of ['term-chat__answer', 'term-chat__compose']) {+ const wrap = document.createElement('div')+ wrap.className = cls+ const ta = document.createElement('textarea')+ wrap.append(ta)+ document.body.append(wrap)+ ta.focus()+ esc()+ expect(onClose).not.toHaveBeenCalled()+ ta.blur()+ wrap.remove()+ }+ // Focus elsewhere: Esc closes the modal as before.+ esc()+ expect(onClose).toHaveBeenCalledTimes(1)+ act(() => root.unmount())+ })+it('respects isTopDialog ownership: ignores Escape when another dialog is stacked on top', () => {const session: KanbanSession = {id: 'node-sticky-dialog-stack',diff --git a/src/renderer/components/kanban/CardModal.tsx b/src/renderer/components/kanban/CardModal.tsxindex dd2768848..5382decf8 100644--- a/src/renderer/components/kanban/CardModal.tsx+++ b/src/renderer/components/kanban/CardModal.tsx@@ -259,6 +259,10 @@ export function CardModal({ session, columnTitle, board, onChangeBoard, onClose,// Esc while focus is elsewhere (the board-log composer, the header, etc.).const ae = document.activeElementif (ae && ae.closest('.kanban-modal__term')) return+ // The ⌘M chat view's text fields own Esc too: the plan "Revise…" box cancels its own edit on+ // Esc, and closing the whole modal from inside it (or from the composer) threw the typed text+ // away. This listener runs in the CAPTURE phase, before any field's own handler could stop it.+ if (ae && ae.closest('.term-chat__answer, .term-chat__compose')) returne.preventDefault()e.stopPropagation()onClose()