@devries-cameron20 / t3code-1 / commits / 6e46a7be38
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Hide drawer on final terminal close

Co-authored-by: codex <codex@users.noreply.github.com>

Julius Marminge committed Feb 15, 2026 at 00:14 UTC 6e46a7be3899db0c03b9b6e304d973b3efa54c3d
2 files changed +7 -7
apps/web/src/store.test.ts
+2 -2
@@ -287,7 +287,7 @@ describe("store reducer thread continuity", () => {
287 ]);
288 });
289
290 - it("closes the final terminal and keeps the drawer visibility unchanged", () => {
290 + it("closes the final terminal and hides the drawer", () => {
291 const state = makeState(
292 makeThread({
293 terminalOpen: true,
@@ -300,7 +300,7 @@ describe("store reducer thread continuity", () => {
300 terminalId: DEFAULT_THREAD_TERMINAL_ID,
301 });
302
303 - expect(next.threads[0]?.terminalOpen).toBe(true);
303 + expect(next.threads[0]?.terminalOpen).toBe(false);
304 expect(next.threads[0]?.terminalIds).toEqual([DEFAULT_THREAD_TERMINAL_ID]);
305 expect(next.threads[0]?.runningTerminalIds).toEqual([]);
306 expect(next.threads[0]?.activeTerminalId).toBe(DEFAULT_THREAD_TERMINAL_ID);
apps/web/src/store.ts
+5 -5
@@ -269,17 +269,17 @@ function closeThreadTerminal(thread: Thread, terminalId: string): Thread {
269
270 const remainingTerminalIds = thread.terminalIds.filter((id) => id !== terminalId);
271 if (remainingTerminalIds.length === 0) {
272 - const nextTerminalId = terminalId;
273 - const nextTerminalGroupId = fallbackGroupId(nextTerminalId);
272 + const nextTerminalGroupId = fallbackGroupId(DEFAULT_THREAD_TERMINAL_ID);
273 return normalizeThreadTerminals({
274 ...thread,
276 - terminalIds: [nextTerminalId],
275 + terminalOpen: false,
276 + terminalIds: [DEFAULT_THREAD_TERMINAL_ID],
277 runningTerminalIds: [],
278 - activeTerminalId: nextTerminalId,
278 + activeTerminalId: DEFAULT_THREAD_TERMINAL_ID,
279 terminalGroups: [
280 {
281 id: nextTerminalGroupId,
282 - terminalIds: [nextTerminalId],
282 + terminalIds: [DEFAULT_THREAD_TERMINAL_ID],
283 },
284 ],
285 activeTerminalGroupId: nextTerminalGroupId,