Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion apps/web/src/components/ChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,10 @@ export default function ChatView({ threadId }: ChatViewProps) {
const storeSetTerminalHeight = useTerminalStateStore((s) => s.setTerminalHeight);
const storeSplitTerminal = useTerminalStateStore((s) => s.splitTerminal);
const storeNewTerminal = useTerminalStateStore((s) => s.newTerminal);
const storeMoveTerminal = useTerminalStateStore((s) => s.moveTerminal);
const storeSetActiveTerminal = useTerminalStateStore((s) => s.setActiveTerminal);
const storeCloseTerminal = useTerminalStateStore((s) => s.closeTerminal);
const animatedCloseRef = useRef<((terminalId: string) => void) | null>(null);

const setPrompt = useCallback(
(nextPrompt: string) => {
Expand Down Expand Up @@ -2205,7 +2207,12 @@ export default function ChatView({ threadId }: ChatViewProps) {
event.preventDefault();
event.stopPropagation();
if (!terminalState.terminalOpen) return;
closeTerminal(terminalState.activeTerminalId);
const animatedClose = animatedCloseRef.current;
if (animatedClose) {
animatedClose(terminalState.activeTerminalId);
} else {
closeTerminal(terminalState.activeTerminalId);
}
return;
}

Expand Down Expand Up @@ -3889,9 +3896,13 @@ export default function ChatView({ threadId }: ChatViewProps) {
splitShortcutLabel={splitTerminalShortcutLabel ?? undefined}
newShortcutLabel={newTerminalShortcutLabel ?? undefined}
closeShortcutLabel={closeTerminalShortcutLabel ?? undefined}
onMoveTerminal={(terminalId, destination) =>
storeMoveTerminal(activeThread.id, terminalId, destination)
}
onActiveTerminalChange={activateTerminal}
onCloseTerminal={closeTerminal}
onHeightChange={setTerminalHeight}
animatedCloseRef={animatedCloseRef}
/>
);
})()}
Expand Down
Loading