Skip to content

Commit fcb7111

Browse files
committed
more changes
1 parent 3e6a5b8 commit fcb7111

File tree

12 files changed

+86
-130
lines changed

12 files changed

+86
-130
lines changed

apps/array/src/renderer/components/MainLayout.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { MainSidebar } from "@components/MainSidebar";
22
import { StatusBar } from "@components/StatusBar";
33
import { UpdatePrompt } from "@components/UpdatePrompt";
4-
import { TopBar } from "@components/ui/topnav/TopBar";
54
import { CommandMenu } from "@features/command/components/CommandMenu";
65
import { usePanelLayoutStore } from "@features/panels/store/panelLayoutStore";
76
import { SettingsView } from "@features/settings/components/SettingsView";
@@ -82,7 +81,6 @@ export function MainLayout() {
8281

8382
return (
8483
<Flex direction="column" height="100vh">
85-
<TopBar onSearchClick={() => setCommandMenuOpen(true)} />
8684
<Flex flexGrow="1" overflow="hidden">
8785
<MainSidebar />
8886

apps/array/src/renderer/components/ui/sidebar/Sidebar.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { SIDEBAR_BORDER } from "@components/ui/sidebar/Context";
2+
import { SidebarTrigger } from "@components/ui/sidebar/SidebarTrigger";
23
import { Box, Flex } from "@radix-ui/themes";
34
import { useSidebarStore } from "@stores/sidebarStore";
45
import React from "react";
@@ -65,6 +66,18 @@ export const Sidebar: React.FC<{ children: React.ReactNode }> = ({
6566
height: "100%",
6667
}}
6768
>
69+
<Flex
70+
align="center"
71+
className="drag"
72+
px="2"
73+
style={{
74+
height: "40px",
75+
minHeight: "40px",
76+
borderBottom: SIDEBAR_BORDER,
77+
}}
78+
>
79+
<SidebarTrigger />
80+
</Flex>
6881
{children}
6982
</Flex>
7083
{open && (

apps/array/src/renderer/components/ui/topnav/TopBar.tsx

Lines changed: 0 additions & 47 deletions
This file was deleted.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ export const DEFAULT_PANEL_IDS = {
1515
ROOT: "root",
1616
MAIN_PANEL: "main-panel",
1717
RIGHT_GROUP: "right-group",
18-
DETAILS_PANEL: "details-panel",
19-
FILES_PANEL: "files-panel",
18+
TOP_RIGHT: "top-right",
19+
BOTTOM_RIGHT: "bottom-right",
2020
} as const;
2121

2222
export const DEFAULT_TAB_IDS = {

apps/array/src/renderer/features/panels/hooks/usePanelLayoutHooks.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { ChangesTabBadge } from "@features/task-detail/components/ChangesTabBadge";
21
import { TabContentRenderer } from "@features/task-detail/components/TabContentRenderer";
32
import type { Task } from "@shared/types";
43
import { useCallback, useEffect, useMemo, useRef } from "react";
@@ -85,10 +84,6 @@ export function useTabInjection(
8584
closeTab(taskId, panelId, tab.id);
8685
}
8786
: undefined,
88-
badge:
89-
tab.id === "changes" ? (
90-
<ChangesTabBadge taskId={taskId} task={task} />
91-
) : undefined,
9287
})),
9388
[tabs, panelId, taskId, task, closeTab],
9489
);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ describe("panelLayoutStore", () => {
379379
it("moves tab to different panel", () => {
380380
usePanelLayoutStore
381381
.getState()
382-
.moveTab("task-1", "file-src/App.tsx", "main-panel", "details-panel");
382+
.moveTab("task-1", "file-src/App.tsx", "main-panel", "top-right");
383383

384384
assertTabInNestedPanel("task-1", "file-src/App.tsx", false, "left");
385385
assertTabInNestedPanel(
@@ -394,7 +394,7 @@ describe("panelLayoutStore", () => {
394394
it("sets moved tab as active in target panel", () => {
395395
usePanelLayoutStore
396396
.getState()
397-
.moveTab("task-1", "file-src/App.tsx", "main-panel", "details-panel");
397+
.moveTab("task-1", "file-src/App.tsx", "main-panel", "top-right");
398398

399399
assertActiveTabInNestedPanel(
400400
"task-1",

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -130,20 +130,13 @@ function createDefaultPanelTree(): PanelNode {
130130
children: [
131131
{
132132
type: "leaf",
133-
id: DEFAULT_PANEL_IDS.DETAILS_PANEL,
133+
id: DEFAULT_PANEL_IDS.TOP_RIGHT,
134134
content: {
135-
id: DEFAULT_PANEL_IDS.DETAILS_PANEL,
135+
id: DEFAULT_PANEL_IDS.TOP_RIGHT,
136136
tabs: [
137137
{
138-
id: DEFAULT_TAB_IDS.DETAILS,
139-
label: "Details",
140-
component: null,
141-
closeable: false,
142-
draggable: false,
143-
},
144-
{
145-
id: DEFAULT_TAB_IDS.TODO_LIST,
146-
label: "Todo list",
138+
id: DEFAULT_TAB_IDS.FILES,
139+
label: "Files",
147140
component: null,
148141
closeable: false,
149142
draggable: false,
@@ -156,20 +149,20 @@ function createDefaultPanelTree(): PanelNode {
156149
draggable: false,
157150
},
158151
],
159-
activeTabId: DEFAULT_TAB_IDS.DETAILS,
152+
activeTabId: DEFAULT_TAB_IDS.FILES,
160153
showTabs: true,
161154
droppable: false,
162155
},
163156
},
164157
{
165158
type: "leaf",
166-
id: DEFAULT_PANEL_IDS.FILES_PANEL,
159+
id: DEFAULT_PANEL_IDS.BOTTOM_RIGHT,
167160
content: {
168-
id: DEFAULT_PANEL_IDS.FILES_PANEL,
161+
id: DEFAULT_PANEL_IDS.BOTTOM_RIGHT,
169162
tabs: [
170163
{
171-
id: DEFAULT_TAB_IDS.FILES,
172-
label: "Files",
164+
id: DEFAULT_TAB_IDS.TODO_LIST,
165+
label: "Todo list",
173166
component: null,
174167
closeable: false,
175168
draggable: false,
@@ -181,8 +174,15 @@ function createDefaultPanelTree(): PanelNode {
181174
closeable: false,
182175
draggable: false,
183176
},
177+
{
178+
id: DEFAULT_TAB_IDS.DETAILS,
179+
label: "Details",
180+
component: null,
181+
closeable: false,
182+
draggable: false,
183+
},
184184
],
185-
activeTabId: DEFAULT_TAB_IDS.FILES,
185+
activeTabId: DEFAULT_TAB_IDS.TODO_LIST,
186186
showTabs: true,
187187
droppable: false,
188188
},
@@ -654,7 +654,7 @@ export const usePanelLayoutStore = createWithEqualityFn<PanelLayoutStore>()(
654654
{
655655
name: "panel-layout-store",
656656
// Bump this version when the default panel structure changes to reset all layouts
657-
version: 2,
657+
version: 3,
658658
migrate: () => ({ taskLayouts: {} }),
659659
},
660660
),

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

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,29 @@ export function ChangesTabBadge({ taskId, task }: ChangesTabBadgeProps) {
2323
return null;
2424
}
2525

26+
const filesLabel = diffStats.filesChanged === 1 ? "file" : "files";
27+
2628
return (
27-
<Flex gap="1">
28-
<Text size="1" color="blue">
29-
{diffStats.filesChanged}
30-
</Text>
29+
<Flex gap="2">
3130
{diffStats.linesAdded > 0 && (
32-
<>
33-
{" "}
31+
<Text size="1">
3432
<Text size="1" color="green">
3533
+{diffStats.linesAdded}
3634
</Text>
37-
</>
35+
,
36+
</Text>
3837
)}
3938
{diffStats.linesRemoved > 0 && (
40-
<Text size="1" color="red">
41-
-{diffStats.linesRemoved}
39+
<Text size="1">
40+
<Text size="1" color="red">
41+
-{diffStats.linesRemoved}
42+
</Text>
43+
,
4244
</Text>
4345
)}
46+
<Text size="1">
47+
<Text color="blue">{diffStats.filesChanged}</Text> {filesLabel} changed
48+
</Text>
4449
</Flex>
4550
);
4651
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { PanelMessage } from "@components/ui/PanelMessage";
12
import { FileTextIcon } from "@radix-ui/react-icons";
23
import { Box, Card, Flex, Text, Tooltip } from "@radix-ui/themes";
34
import type { TaskArtifact } from "@shared/types";
@@ -34,7 +35,7 @@ export function TaskArtifacts({
3435
});
3536

3637
if (!repoPath || artifacts.length === 0) {
37-
return null;
38+
return <PanelMessage>No artifacts yet</PanelMessage>;
3839
}
3940

4041
const formatFileSize = (bytes: number): string => {

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

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { PanelLayout } from "@features/panels";
2+
import { ChangesTabBadge } from "@features/task-detail/components/ChangesTabBadge";
23
import { useTaskData } from "@features/task-detail/hooks/useTaskData";
34
import { useTaskExecution } from "@features/task-detail/hooks/useTaskExecution";
45
import { useBlurOnEscape } from "@hooks/useBlurOnEscape";
56
import { useFileWatcher } from "@hooks/useFileWatcher";
67
import { useStatusBar } from "@hooks/useStatusBar";
7-
import { Flex } from "@radix-ui/themes";
8+
import { Box, Code, Flex, Text } from "@radix-ui/themes";
89
import type { Task } from "@shared/types";
910

1011
interface TaskDetailProps {
@@ -47,7 +48,30 @@ export function TaskDetail({ task: initialTask }: TaskDetailProps) {
4748

4849
return (
4950
<Flex direction="column" height="100%">
50-
<PanelLayout taskId={taskId} task={task} />
51+
<Flex
52+
align="center"
53+
justify="between"
54+
px="3"
55+
className="drag"
56+
style={{
57+
height: "40px",
58+
minHeight: "40px",
59+
borderBottom: "1px solid var(--gray-6)",
60+
}}
61+
>
62+
<Flex align="center" gap="2">
63+
<Code size="2" color="gray" variant="ghost" style={{ flexShrink: 0 }}>
64+
{task.slug}
65+
</Code>
66+
<Text size="2" weight="medium" truncate>
67+
{task.title}
68+
</Text>
69+
</Flex>
70+
<ChangesTabBadge taskId={taskId} task={task} />
71+
</Flex>
72+
<Box flexGrow="1" style={{ minHeight: 0 }}>
73+
<PanelLayout taskId={taskId} task={task} />
74+
</Box>
5175
</Flex>
5276
);
5377
}

0 commit comments

Comments
 (0)