Skip to content

Commit db14508

Browse files
committed
Rename the logs tab to chat
1 parent fa540d0 commit db14508

8 files changed

Lines changed: 26 additions & 22 deletions

File tree

apps/array/src/renderer/features/panels/components/PanelTree.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type { PanelNode, Tab } from "../store/panelStore";
88
* Example:
99
* <PanelGroupTree direction="horizontal" sizes={[75, 25]}>
1010
* <PanelLeaf>
11-
* <PanelTab id="logs">{logsContent}</PanelTab>
11+
* <PanelTab id="chat">{chatContent}</PanelTab>
1212
* </PanelLeaf>
1313
* <PanelLeaf showTabs={false}>{content}</PanelLeaf>
1414
* </PanelGroupTree>

apps/array/src/renderer/features/panels/constants/panelConstants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const DEFAULT_PANEL_IDS = {
2020
} as const;
2121

2222
export const DEFAULT_TAB_IDS = {
23-
LOGS: "logs",
23+
CHAT: "chat",
2424
SHELL: "shell",
2525
FILES: "files",
2626
TODO_LIST: "todo-list",

apps/array/src/renderer/features/panels/store/panelLayoutStore.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ describe("panelLayoutStore", () => {
5252
assertPanelLayout(root, [
5353
{
5454
panelId: "main-panel",
55-
expectedTabs: ["logs", "shell"],
56-
activeTab: "logs",
55+
expectedTabs: ["chat", "shell"],
56+
activeTab: "chat",
5757
},
5858
]);
5959
});
@@ -72,7 +72,7 @@ describe("panelLayoutStore", () => {
7272
assertPanelLayout(getPanelTree("task-1"), [
7373
{
7474
panelId: "main-panel",
75-
expectedTabs: ["logs", "shell", "file-src/App.tsx"],
75+
expectedTabs: ["chat", "shell", "file-src/App.tsx"],
7676
},
7777
]);
7878
});

apps/array/src/renderer/features/panels/store/panelLayoutStore.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,22 +103,22 @@ export interface PanelLayoutStore {
103103
function createDefaultPanelTree(
104104
terminalLayoutMode: "split" | "tabbed" = "split",
105105
): PanelNode {
106-
const logsPanel: PanelNode = {
106+
const chatPanel: PanelNode = {
107107
type: "leaf",
108108
id: DEFAULT_PANEL_IDS.MAIN_PANEL,
109109
content: {
110110
id: DEFAULT_PANEL_IDS.MAIN_PANEL,
111111
tabs: [
112112
{
113-
id: DEFAULT_TAB_IDS.LOGS,
113+
id: DEFAULT_TAB_IDS.CHAT,
114114
label: "Chat",
115-
data: { type: "logs" },
115+
data: { type: "chat" },
116116
component: null,
117117
closeable: false,
118118
draggable: true,
119119
},
120120
],
121-
activeTabId: DEFAULT_TAB_IDS.LOGS,
121+
activeTabId: DEFAULT_TAB_IDS.CHAT,
122122
showTabs: true,
123123
droppable: true,
124124
},
@@ -156,7 +156,7 @@ function createDefaultPanelTree(
156156
id: "left-group",
157157
direction: "vertical",
158158
sizes: [70, 30],
159-
children: [logsPanel, terminalPanel],
159+
children: [chatPanel, terminalPanel],
160160
}
161161
: {
162162
type: "leaf",
@@ -165,9 +165,9 @@ function createDefaultPanelTree(
165165
id: DEFAULT_PANEL_IDS.MAIN_PANEL,
166166
tabs: [
167167
{
168-
id: DEFAULT_TAB_IDS.LOGS,
168+
id: DEFAULT_TAB_IDS.CHAT,
169169
label: "Chat",
170-
data: { type: "logs" },
170+
data: { type: "chat" },
171171
component: null,
172172
closeable: false,
173173
draggable: true,
@@ -185,7 +185,7 @@ function createDefaultPanelTree(
185185
draggable: true,
186186
},
187187
],
188-
activeTabId: DEFAULT_TAB_IDS.LOGS,
188+
activeTabId: DEFAULT_TAB_IDS.CHAT,
189189
showTabs: true,
190190
droppable: true,
191191
},

apps/array/src/renderer/features/panels/store/panelStoreHelpers.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { SplitDirection, TaskLayout } from "./panelLayoutStore";
44
import type { GroupPanel, LeafPanel, PanelNode, Tab } from "./panelTypes";
55

66
// Constants
7-
export const DEFAULT_FALLBACK_TAB = DEFAULT_TAB_IDS.LOGS;
7+
export const DEFAULT_FALLBACK_TAB = DEFAULT_TAB_IDS.CHAT;
88

99
// Tab ID utilities
1010
export type TabType = "file" | "artifact" | "diff" | "system";
@@ -85,6 +85,10 @@ export function createTabLabel(tabId: string): string {
8585
const label = getStatusLabel(parsed.status);
8686
return `${fileName} (${label})`;
8787
}
88+
// Capitalize first letter for system tabs
89+
if (parsed.type === "system" && parsed.value) {
90+
return parsed.value.charAt(0).toUpperCase() + parsed.value.slice(1);
91+
}
8892
return parsed.value;
8993
}
9094

@@ -187,8 +191,8 @@ export function createNewTab(tabId: string, closeable = true): Tab {
187191
};
188192
break;
189193
case "system":
190-
if (tabId === "logs") {
191-
data = { type: "logs" };
194+
if (tabId === "chat") {
195+
data = { type: "chat" };
192196
} else if (tabId.startsWith("shell")) {
193197
data = {
194198
type: "terminal",

apps/array/src/renderer/features/panels/store/panelTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export type TabData =
3838
artifactId: string;
3939
}
4040
| {
41-
type: "logs";
41+
type: "chat";
4242
}
4343
| {
4444
type: "other";

apps/array/src/renderer/features/task-detail/components/PanelSplitting.integration.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const PANEL_IDS = {
2020
} as const;
2121

2222
const TAB_IDS = {
23-
LOGS: "logs",
23+
CHAT: "chat",
2424
SHELL: "shell",
2525
} as const;
2626

@@ -284,7 +284,7 @@ describe("Panel Splitting Integration Tests", () => {
284284
if (bottomPanel.type === "leaf") {
285285
expect(bottomPanel.content.tabs).toHaveLength(4);
286286
const tabIds = bottomPanel.content.tabs.map((t) => t.id);
287-
expect(tabIds).toContain(TAB_IDS.LOGS);
287+
expect(tabIds).toContain(TAB_IDS.CHAT);
288288
expect(tabIds).toContain(TAB_IDS.SHELL);
289289
expect(tabIds).toContain(TEST_FILES.APP);
290290
expect(tabIds).toContain(TEST_FILES.README);
@@ -343,7 +343,7 @@ describe("Panel Splitting Integration Tests", () => {
343343
expect(bottomPanel.type).toBe("leaf");
344344
if (bottomPanel.type === "leaf") {
345345
expect(bottomPanel.content.tabs).toHaveLength(1);
346-
expect(bottomPanel.content.tabs[0].id).toBe(TAB_IDS.LOGS);
346+
expect(bottomPanel.content.tabs[0].id).toBe(TAB_IDS.CHAT);
347347
}
348348
}
349349
}
@@ -354,7 +354,7 @@ describe("Panel Splitting Integration Tests", () => {
354354
await tester.setupWithFile();
355355

356356
// Close logs and shell tabs to leave only 1 tab
357-
tester.closeTab(PANEL_IDS.MAIN, TAB_IDS.LOGS);
357+
tester.closeTab(PANEL_IDS.MAIN, TAB_IDS.CHAT);
358358
tester.closeTab(PANEL_IDS.MAIN, TAB_IDS.SHELL);
359359

360360
await waitFor(() => {

apps/array/src/renderer/features/task-detail/components/TabContentRenderer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function TabContentRenderer({
2525
const { data } = tab;
2626

2727
switch (data.type) {
28-
case "logs":
28+
case "chat":
2929
return <TaskLogsPanel taskId={taskId} task={task} />;
3030

3131
case "terminal":

0 commit comments

Comments
 (0)