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.

fix(chat-view): closed-transcript dialog suspends into the panel shell too

reviewd749a1add3dc
diff --git a/src/renderer/components/ClosedTranscriptDialog.tsx b/src/renderer/components/ClosedTranscriptDialog.tsx
index 882b2c1b4..72792e4dc 100644
--- a/src/renderer/components/ClosedTranscriptDialog.tsx
+++ b/src/renderer/components/ClosedTranscriptDialog.tsx
@@ -3,6 +3,7 @@ import { createPortal } from 'react-dom'
import { useDialogStack } from './dialog-stack'
import type { ClosedSessionEntry } from '@shared/types'
import { closedTranscriptTarget } from '../lib/closedHistory'
+import { ChatPanelFallback } from '../nodes/ChatPanelFallback'
// Same code split as the ⌘M panel on a terminal node: the transcript reader and the markdown
// renderer are not on the path to painting a canvas, and this dialog opens on a click.
@@ -51,7 +52,9 @@ export function ClosedTranscriptDialog({ entry, onClose }: ClosedTranscriptDialo
}}
>
{target.ok ? (
- <Suspense fallback={null}>
+ <Suspense
+ fallback={<ChatPanelFallback title={entry.node.title || 'Closed session'} hint="Esc to close" />}
+ >
<ChatPanel
nodeId={target.nodeId}
sessionId={target.sessionId}
diff --git a/src/renderer/nodes/ChatPanelFallback.test.tsx b/src/renderer/nodes/ChatPanelFallback.test.tsx
index 5600ec20e..9cc26f865 100644
--- a/src/renderer/nodes/ChatPanelFallback.test.tsx
+++ b/src/renderer/nodes/ChatPanelFallback.test.tsx
@@ -31,6 +31,13 @@ describe('ChatPanelFallback', () => {
expect(shell.querySelector(':scope > .term-chat__msgs')).toBeTruthy()
})
+ it('shows the caller\'s own title and hint (the closed-transcript dialog: its title, "Esc to close")', () => {
+ act(() => root.render(<ChatPanelFallback title="Closed session" hint="Esc to close" />))
+ const bar = host.querySelector('.term-chat__bar') as HTMLElement
+ expect(bar.firstElementChild?.textContent).toBe('Closed session')
+ expect(bar.querySelector('.term-chat__hint')?.textContent).toBe('Esc to close')
+ })
+
it('says it is loading, with a spinner, inside a polite status region', () => {
act(() => root.render(<ChatPanelFallback />))
const status = host.querySelector('[role="status"]') as HTMLElement
@@ -41,11 +48,12 @@ describe('ChatPanelFallback', () => {
})
})
-// Both mount sites of the lazy ChatPanel (canvas node + kanban card modal) must show the shell
-// while the chunk loads; `fallback={null}` is what left the ⌘M face blank.
+// Every mount site of the lazy ChatPanel (canvas node, kanban card modal, closed-transcript dialog)
+// must show the shell while the chunk loads; `fallback={null}` is what left the ⌘M face blank.
describe.each([
['TerminalNode.tsx', join(__dirname, 'TerminalNode.tsx')],
- ['CardModal.tsx', join(__dirname, '../components/kanban/CardModal.tsx')]
+ ['CardModal.tsx', join(__dirname, '../components/kanban/CardModal.tsx')],
+ ['ClosedTranscriptDialog.tsx', join(__dirname, '../components/ClosedTranscriptDialog.tsx')]
])('%s lazy ChatPanel', (_name, file) => {
const src = readFileSync(file, 'utf8').replace(/\r\n/g, '\n')
it('suspends into ChatPanelFallback, never into nothing', () => {
diff --git a/src/renderer/nodes/ChatPanelFallback.tsx b/src/renderer/nodes/ChatPanelFallback.tsx
index c64e163e0..75d33891c 100644
--- a/src/renderer/nodes/ChatPanelFallback.tsx
+++ b/src/renderer/nodes/ChatPanelFallback.tsx
@@ -3,8 +3,9 @@ import { chipFor } from '../lib/keybindingOverrides'
/**
* What the ⌘M face shows while the lazy `ChatPanel` chunk (it carries the markdown renderer) is
- * still loading — the `<Suspense>` fallback at BOTH of its mount sites, the canvas terminal node
- * and the kanban card modal.
+ * still loading — the `<Suspense>` fallback at EVERY one of its mount sites: the canvas terminal
+ * node, the kanban card modal and the closed-transcript dialog (which passes its own title and
+ * "Esc to close" hint, exactly as it does to ChatPanel).
*
* It used to be `fallback={null}`, which rendered nothing: the terminal stayed visible under a
* face that had "opened", then the panel popped in over it — read as a blank or broken ⌘M. This
@@ -16,13 +17,13 @@ import { chipFor } from '../lib/keybindingOverrides'
* Deliberately free of any transcript logic and of ChatPanel's props: it must stay tiny, because
* it lives in the STARTUP chunk with the node that imports it — the whole point of the split.
*/
-export function ChatPanelFallback({ hint }: { hint?: string }) {
+export function ChatPanelFallback({ title, hint }: { title?: string; hint?: string }) {
// Same bar text ChatPanel renders by default, so the swap is not a visible jump.
const mdChip = chipFor('node.toggleMarkdown')
return (
<div className="term-chat nodrag nowheel">
<div className="term-chat__bar">
- <span>Chat</span>
+ <span>{title ?? 'Chat'}</span>
<span className="term-chat__bar-end">
<span className="term-chat__hint">{hint ?? (mdChip ? `${mdChip} to exit` : 'Exit')}</span>
</span>