Skip to content

Commit 3ba4903

Browse files
committed
REMOVE DEAD CODE
1 parent 83182cf commit 3ba4903

27 files changed

+14
-1713
lines changed

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

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,17 @@ import { MainSidebar } from "@features/sidebar/components/MainSidebar";
1313
import { useSidebarStore } from "@features/sidebar/stores/sidebarStore";
1414
import { TaskDetail } from "@features/task-detail/components/TaskDetail";
1515
import { TaskInput } from "@features/task-detail/components/TaskInput";
16-
import { TaskList } from "@features/task-list/components/TaskList";
1716
import { useIntegrations } from "@hooks/useIntegrations";
1817
import { Box, Flex } from "@radix-ui/themes";
1918
import { clearApplicationStorage } from "@renderer/lib/clearStorage";
20-
import type { Task } from "@shared/types";
2119
import { useNavigationStore } from "@stores/navigationStore";
2220
import { useCallback, useEffect, useState } from "react";
2321
import { useHotkeys } from "react-hotkeys-hook";
2422
import { Toaster } from "sonner";
2523

2624
export function MainLayout() {
27-
const {
28-
view,
29-
toggleSettings,
30-
navigateToTask,
31-
navigateToTaskInput,
32-
goBack,
33-
goForward,
34-
} = useNavigationStore();
25+
const { view, toggleSettings, navigateToTaskInput, goBack, goForward } =
26+
useNavigationStore();
3527
const clearAllLayouts = usePanelLayoutStore((state) => state.clearAllLayouts);
3628
const toggleLeftSidebar = useSidebarStore((state) => state.toggle);
3729
const toggleRightSidebar = useRightSidebarStore((state) => state.toggle);
@@ -120,21 +112,13 @@ export function MainLayout() {
120112
};
121113
}, [goBack, goForward]);
122114

123-
const handleSelectTask = (task: Task) => {
124-
navigateToTask(task);
125-
};
126-
127115
return (
128116
<Flex direction="column" height="100vh">
129117
<HeaderRow />
130118
<Flex flexGrow="1" overflow="hidden">
131119
<MainSidebar />
132120

133121
<Box flexGrow="1" overflow="hidden">
134-
{view.type === "task-list" && (
135-
<TaskList onSelectTask={handleSelectTask} />
136-
)}
137-
138122
{view.type === "task-input" && <TaskInput />}
139123

140124
{view.type === "task-detail" && view.data && (

apps/array/src/renderer/features/command/components/CommandMenu.tsx

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Command } from "@features/command/components/Command";
22
import { CommandKeyHints } from "@features/command/components/CommandKeyHints";
33
import { useTasks } from "@features/tasks/hooks/useTasks";
4-
import { FileTextIcon, ListBulletIcon } from "@radix-ui/react-icons";
4+
import { FileTextIcon } from "@radix-ui/react-icons";
55
import { Flex, Text } from "@radix-ui/themes";
66
import type { Task } from "@shared/types";
77
import { useNavigationStore } from "@stores/navigationStore";
@@ -14,8 +14,7 @@ interface CommandMenuProps {
1414
}
1515

1616
export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {
17-
const { navigateToTaskList, navigateToTask, navigateToTaskInput } =
18-
useNavigationStore();
17+
const { navigateToTask, navigateToTaskInput } = useNavigationStore();
1918
const { data: tasks = [] } = useTasks();
2019
const commandRef = useRef<HTMLDivElement>(null);
2120

@@ -64,11 +63,6 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {
6463
};
6564
}, [open, onOpenChange]);
6665

67-
const handleNavigateToTasks = () => {
68-
navigateToTaskList();
69-
onOpenChange(false);
70-
};
71-
7266
const handleCreateTask = () => {
7367
navigateToTaskInput();
7468
onOpenChange(false);
@@ -112,16 +106,6 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {
112106
</Command.Item>
113107
</Command.Group>
114108

115-
<Command.Group heading="Navigation">
116-
<Command.Item
117-
value="Go to tasks"
118-
onSelect={handleNavigateToTasks}
119-
>
120-
<ListBulletIcon className="mr-3 h-3 w-3 text-gray-11" />
121-
<Text size="1">Go to tasks</Text>
122-
</Command.Item>
123-
</Command.Group>
124-
125109
{tasks.length > 0 && (
126110
<Command.Group heading="Tasks">
127111
{tasks.map((task) => (

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,5 @@ export const DEFAULT_TAB_IDS = {
2323
LOGS: "logs",
2424
SHELL: "shell",
2525
FILES: "files",
26-
TODO_LIST: "todo-list",
27-
ARTIFACTS: "artifacts",
2826
CHANGES: "changes",
2927
} as const;

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

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -107,32 +107,6 @@ describe("panelLayoutStore", () => {
107107
});
108108
});
109109

110-
describe("openArtifact", () => {
111-
beforeEach(() => {
112-
usePanelLayoutStore.getState().initializeTask("task-1");
113-
});
114-
115-
it("adds artifact tab to main panel", () => {
116-
usePanelLayoutStore.getState().openArtifact("task-1", "plan.md");
117-
118-
const panel = findPanelById(getPanelTree("task-1"), "main-panel");
119-
const artifactTab = panel?.content.tabs.find((t: { id: string }) =>
120-
t.id.startsWith("artifact-"),
121-
);
122-
expect(artifactTab?.id).toBe("artifact-plan.md");
123-
});
124-
125-
it("tracks open artifacts in metadata", () => {
126-
usePanelLayoutStore.getState().openArtifact("task-1", "plan.md");
127-
usePanelLayoutStore.getState().openArtifact("task-1", "notes.md");
128-
129-
const layout = getLayout("task-1");
130-
expect(layout.openArtifacts).toContain("plan.md");
131-
expect(layout.openArtifacts).toContain("notes.md");
132-
expect(layout.openArtifacts).toHaveLength(2);
133-
});
134-
});
135-
136110
describe("closeTab", () => {
137111
beforeEach(() => {
138112
usePanelLayoutStore.getState().initializeTask("task-1");

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

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
import {
88
addNewTabToPanel,
99
applyCleanupWithFallback,
10-
createArtifactTabId,
1110
createDiffTabId,
1211
createFileTabId,
1312
generatePanelId,
@@ -32,7 +31,6 @@ import type { PanelNode, Tab } from "./panelTypes";
3231
export interface TaskLayout {
3332
panelTree: PanelNode;
3433
openFiles: string[];
35-
openArtifacts: string[];
3634
draggingTabId: string | null;
3735
draggingTabPanelId: string | null;
3836
focusedPanelId: string | null;
@@ -48,14 +46,8 @@ export interface PanelLayoutStore {
4846
taskId: string,
4947
terminalLayoutMode?: "split" | "tabbed",
5048
) => void;
51-
openFile: (taskId: string, filePath: string, asPreview?: boolean) => void;
52-
openArtifact: (taskId: string, fileName: string) => void;
53-
openDiff: (
54-
taskId: string,
55-
filePath: string,
56-
status?: string,
57-
asPreview?: boolean,
58-
) => void;
49+
openFile: (taskId: string, filePath: string) => void;
50+
openDiff: (taskId: string, filePath: string, status?: string) => void;
5951
keepTab: (taskId: string, panelId: string, tabId: string) => void;
6052
closeTab: (taskId: string, panelId: string, tabId: string) => void;
6153
closeOtherTabs: (taskId: string, panelId: string, tabId: string) => void;
@@ -287,11 +279,6 @@ export const usePanelLayoutStore = createWithEqualityFn<PanelLayoutStore>()(
287279
set((state) => openTab(state, taskId, tabId, asPreview));
288280
},
289281

290-
openArtifact: (taskId, fileName) => {
291-
const tabId = createArtifactTabId(fileName);
292-
set((state) => openTab(state, taskId, tabId, false));
293-
},
294-
295282
openDiff: (taskId, filePath, status, asPreview = true) => {
296283
const tabId = createDiffTabId(filePath, status);
297284
set((state) => openTab(state, taskId, tabId, asPreview));

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

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { GroupPanel, LeafPanel, PanelNode, Tab } from "./panelTypes";
77
export const DEFAULT_FALLBACK_TAB = DEFAULT_TAB_IDS.LOGS;
88

99
// Tab ID utilities
10-
export type TabType = "file" | "artifact" | "diff" | "system";
10+
export type TabType = "file" | "diff" | "system";
1111

1212
export interface ParsedTabId {
1313
type: TabType;
@@ -18,10 +18,6 @@ export function createFileTabId(filePath: string): string {
1818
return `file-${filePath}`;
1919
}
2020

21-
export function createArtifactTabId(fileName: string): string {
22-
return `artifact-${fileName}`;
23-
}
24-
2521
export function createDiffTabId(filePath: string, status?: string): string {
2622
if (status) {
2723
return `diff-${status}:${filePath}`;
@@ -44,9 +40,6 @@ export function parseTabId(tabId: string): ParsedTabId & { status?: string } {
4440
if (tabId.startsWith("file-")) {
4541
return { type: "file", value: tabId.slice(5) };
4642
}
47-
if (tabId.startsWith("artifact-")) {
48-
return { type: "artifact", value: tabId.slice(9) };
49-
}
5043
if (tabId.startsWith("diff-")) {
5144
const rest = tabId.slice(5);
5245
// Check for status:path format
@@ -184,12 +177,6 @@ export function createNewTab(
184177
status: (parsed.status || "modified") as GitFileStatus,
185178
};
186179
break;
187-
case "artifact":
188-
data = {
189-
type: "artifact",
190-
artifactId: parsed.value,
191-
};
192-
break;
193180
case "system":
194181
if (tabId === "logs") {
195182
data = { type: "logs" };
@@ -282,26 +269,18 @@ export function updateMetadataForTab(
282269
layout: TaskLayout,
283270
tabId: string,
284271
action: "add" | "remove",
285-
): Pick<TaskLayout, "openFiles" | "openArtifacts"> {
272+
): Pick<TaskLayout, "openFiles"> {
286273
const parsed = parseTabId(tabId);
287274

288275
if (parsed.type === "file") {
289276
const openFiles =
290277
action === "add"
291278
? [...layout.openFiles, parsed.value]
292279
: layout.openFiles.filter((f) => f !== parsed.value);
293-
return { openFiles, openArtifacts: layout.openArtifacts };
294-
}
295-
296-
if (parsed.type === "artifact") {
297-
const openArtifacts =
298-
action === "add"
299-
? [...layout.openArtifacts, parsed.value]
300-
: layout.openArtifacts.filter((f) => f !== parsed.value);
301-
return { openFiles: layout.openFiles, openArtifacts };
280+
return { openFiles };
302281
}
303282

304-
return { openFiles: layout.openFiles, openArtifacts: layout.openArtifacts };
283+
return { openFiles: layout.openFiles };
305284
}
306285

307286
// Cleanup utilities

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ export type TabData =
3333
command: string;
3434
scriptType: "init" | "start";
3535
}
36-
| {
37-
type: "artifact";
38-
artifactId: string;
39-
}
4036
| {
4137
type: "logs";
4238
}

apps/array/src/renderer/features/sidebar/hooks/useSidebarData.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export interface SidebarData {
5757
}
5858

5959
interface ViewState {
60-
type: "task-list" | "task-detail" | "task-input" | "settings";
60+
type: "task-detail" | "task-input" | "settings";
6161
data?: Task;
6262
}
6363

@@ -155,11 +155,8 @@ function createTaskViews(currentUser: Schemas.User | undefined): TaskView[] {
155155

156156
function getActiveViewId(
157157
views: TaskView[],
158-
activeView: ViewState,
159158
activeFilters: ActiveFilters,
160159
): string | null {
161-
if (activeView.type !== "task-list") return null;
162-
163160
for (const view of views) {
164161
if (filtersMatch(activeFilters, view.filters)) {
165162
return view.id;
@@ -191,7 +188,7 @@ export function useSidebarData({
191188
const isHomeActive = activeView.type === "task-input";
192189

193190
const views = createTaskViews(currentUser);
194-
const activeViewId = getActiveViewId(views, activeView, activeFilters);
191+
const activeViewId = getActiveViewId(views, activeFilters);
195192

196193
const repositories = buildRepositoryMap(allTasks);
197194
const activeRepository = getActiveRepository(activeFilters);

apps/array/src/renderer/features/task-list/components/FilterOperatorToggle.tsx

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

0 commit comments

Comments
 (0)