Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

Hide drawer on final terminal close

Julius Marminge6e46a7be3899
diff --git a/apps/web/src/store.test.ts b/apps/web/src/store.test.ts
index e2e083e3b..176a6a73f 100644
--- a/apps/web/src/store.test.ts
+++ b/apps/web/src/store.test.ts
@@ -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);
diff --git a/apps/web/src/store.ts b/apps/web/src/store.ts
index 44d2ff02d..3f944601b 100644
--- a/apps/web/src/store.ts
+++ b/apps/web/src/store.ts
@@ -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,