Hide drawer on final terminal close

Co-authored-by: codex <[email protected]>
This commit is contained in:
Julius Marmingeandcodex committed 2026-02-15 00:14:02 -08:00
1 parent 0be98ea9d1
commit 6e46a7be38
2 files changed
+7 -7

No files matched your search

+2 -2
View File
@@ -287,7 +287,7 @@ describe("store reducer thread continuity", () => {
]);
});
it("closes the final terminal and keeps the drawer visibility unchanged", () => {
it("closes the final terminal and hides the drawer", () => {
const state = makeState(
makeThread({
terminalOpen: true,
@@ -300,7 +300,7 @@ describe("store reducer thread continuity", () => {
terminalId: DEFAULT_THREAD_TERMINAL_ID,
});
expect(next.threads[0]?.terminalOpen).toBe(true);
expect(next.threads[0]?.terminalOpen).toBe(false);
expect(next.threads[0]?.terminalIds).toEqual([DEFAULT_THREAD_TERMINAL_ID]);
expect(next.threads[0]?.runningTerminalIds).toEqual([]);
expect(next.threads[0]?.activeTerminalId).toBe(DEFAULT_THREAD_TERMINAL_ID);
+5 -5
View File
@@ -269,17 +269,17 @@ function closeThreadTerminal(thread: Thread, terminalId: string): Thread {
const remainingTerminalIds = thread.terminalIds.filter((id) => id !== terminalId);
if (remainingTerminalIds.length === 0) {
const nextTerminalId = terminalId;
const nextTerminalGroupId = fallbackGroupId(nextTerminalId);
const nextTerminalGroupId = fallbackGroupId(DEFAULT_THREAD_TERMINAL_ID);
return normalizeThreadTerminals({
...thread,
terminalIds: [nextTerminalId],
terminalOpen: false,
terminalIds: [DEFAULT_THREAD_TERMINAL_ID],
runningTerminalIds: [],
activeTerminalId: nextTerminalId,
activeTerminalId: DEFAULT_THREAD_TERMINAL_ID,
terminalGroups: [
{
id: nextTerminalGroupId,
terminalIds: [nextTerminalId],
terminalIds: [DEFAULT_THREAD_TERMINAL_ID],
},
],
activeTerminalGroupId: nextTerminalGroupId,