Skip to content

Commit 38078e1

Browse files
authored
chore: remove dead code (#4212)
Remove dead useAutosave hook, useDraggable (lib/dragdrop), testUtils.tsx, settingGroupSlug, 30 unused mobile type re-exports, and unused state variables. All deletions independently verified via grep.
1 parent 946ed33 commit 38078e1

15 files changed

Lines changed: 14 additions & 1342 deletions

File tree

electron/src/ipc.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ export function initializeIpcHandlers(): void {
734734
});
735735

736736
// Window control handlers
737-
ipcMain.on(IpcChannels.WINDOW_CLOSE, (event) => {
737+
ipcMain.on(IpcChannels.WINDOW_CLOSE, (_event) => {
738738
try {
739739
const window = BrowserWindow.getFocusedWindow();
740740
if (window) {
@@ -745,7 +745,7 @@ export function initializeIpcHandlers(): void {
745745
}
746746
});
747747

748-
ipcMain.on(IpcChannels.WINDOW_MINIMIZE, (event) => {
748+
ipcMain.on(IpcChannels.WINDOW_MINIMIZE, (_event) => {
749749
try {
750750
const window = BrowserWindow.getFocusedWindow();
751751
if (window) {
@@ -756,7 +756,7 @@ export function initializeIpcHandlers(): void {
756756
}
757757
});
758758

759-
ipcMain.on(IpcChannels.WINDOW_MAXIMIZE, (event) => {
759+
ipcMain.on(IpcChannels.WINDOW_MAXIMIZE, (_event) => {
760760
try {
761761
const window = BrowserWindow.getFocusedWindow();
762762
if (window) {
@@ -773,7 +773,7 @@ export function initializeIpcHandlers(): void {
773773

774774
createIpcMainHandler(
775775
IpcChannels.ON_CREATE_WORKFLOW,
776-
async (event, workflow) => {
776+
async (_event, workflow) => {
777777
logMessage(`Creating workflow: ${workflow.name}`);
778778
registerWorkflowShortcut(workflow);
779779
emitWorkflowsChanged();
@@ -782,7 +782,7 @@ export function initializeIpcHandlers(): void {
782782

783783
createIpcMainHandler(
784784
IpcChannels.ON_UPDATE_WORKFLOW,
785-
async (event, workflow) => {
785+
async (_event, workflow) => {
786786
logMessage(`Updating workflow: ${workflow.name}`);
787787
registerWorkflowShortcut(workflow);
788788
emitWorkflowsChanged();
@@ -791,7 +791,7 @@ export function initializeIpcHandlers(): void {
791791

792792
createIpcMainHandler(
793793
IpcChannels.ON_DELETE_WORKFLOW,
794-
async (event, workflow) => {
794+
async (_event, workflow) => {
795795
logMessage(`Deleting workflow: ${workflow.name}`);
796796
if (workflow.settings?.shortcut) {
797797
globalShortcut.unregister(workflow.settings.shortcut);

mobile/src/components/graph_editor/ChainEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { NodePickerModal } from "./NodePickerModal";
2929
import type { NodeMetadata } from "../../types/ApiTypes";
3030

3131
export const ChainEditor: React.FC = () => {
32-
const { colors, shadows, isDark } = useTheme();
32+
const { colors } = useTheme();
3333
const scrollRef = useRef<ScrollView>(null);
3434

3535
// ── Store selectors ────────────────────────────────────────────────

mobile/src/types/ApiTypes.ts

Lines changed: 5 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -12,63 +12,26 @@ import type {
1212
// Graph & Node types
1313
Node,
1414
Edge,
15-
// Media refs
16-
ImageRef,
17-
AudioRef,
18-
VideoRef,
19-
TextRef,
20-
DataframeRef,
21-
ColumnDef,
22-
DocumentRef,
23-
FolderRef,
24-
FontRef,
25-
AssetRef,
26-
WorkflowRef,
27-
NodeRef,
28-
NPArray,
29-
SVGElement,
30-
PlotlyConfig,
31-
Datetime,
32-
CalendarEvent,
3315
// Asset types
3416
Asset,
35-
AssetList,
36-
AssetUpdateRequest,
3717
// Workflow types
3818
Workflow,
3919
WorkflowGraph,
4020
// Thread & Message types
4121
Thread,
42-
ThreadList,
4322
Message,
4423
MessageContent,
4524
// Node Metadata types
4625
PropertyTypeMetadata,
4726
Property,
4827
OutputSlot,
4928
NodeMetadata as _NodeMetadata,
50-
IndexResponse,
5129
// Job types
52-
JobResponse,
53-
JobListResponse,
5430
RunJobRequest,
55-
ResourceLimits,
5631
// Model types
57-
Provider,
5832
ProviderInfo,
5933
LanguageModel,
60-
ImageModel,
61-
TTSModel,
62-
ASRModel,
63-
VideoModel,
6434
ModelPack,
65-
// System types
66-
SystemStats,
67-
SecretResponse,
68-
// File/Workspace types
69-
CollectionResponse,
70-
CollectionList,
71-
CollectionCreate,
7235
// WebSocket message types
7336
NodeUpdate,
7437
OutputUpdate,
@@ -84,60 +47,24 @@ import type {
8447
// Graph & Node
8548
export type { Node, Edge };
8649

87-
// Media refs
88-
export type {
89-
ImageRef,
90-
AudioRef,
91-
VideoRef,
92-
TextRef,
93-
DataframeRef,
94-
ColumnDef,
95-
DocumentRef,
96-
FolderRef,
97-
FontRef,
98-
AssetRef,
99-
WorkflowRef,
100-
NodeRef,
101-
NPArray,
102-
SVGElement,
103-
PlotlyConfig,
104-
Datetime,
105-
CalendarEvent,
106-
};
107-
10850
// Asset
109-
export type { Asset, AssetList, AssetUpdateRequest };
51+
export type { Asset };
11052

11153
// Workflow
11254
export type { Workflow, WorkflowGraph };
11355

11456
// Thread & Message
115-
export type { Thread, ThreadList, Message, MessageContent };
57+
export type { Thread, Message, MessageContent };
11658

11759
// Node Metadata
118-
export type { Property, OutputSlot, IndexResponse };
60+
export type { Property, OutputSlot };
11961
export type { PropertyTypeMetadata };
12062

12163
// Job
122-
export type { JobResponse, JobListResponse, RunJobRequest, ResourceLimits };
64+
export type { RunJobRequest };
12365

12466
// Models
125-
export type {
126-
Provider,
127-
ProviderInfo,
128-
LanguageModel,
129-
ImageModel,
130-
TTSModel,
131-
ASRModel,
132-
VideoModel,
133-
ModelPack,
134-
};
135-
136-
// System
137-
export type { SystemStats, SecretResponse };
138-
139-
// Files & Workspace
140-
export type { CollectionResponse, CollectionList, CollectionCreate };
67+
export type { ProviderInfo, LanguageModel };
14168

14269
// WebSocket message types
14370
export type {
@@ -164,18 +91,3 @@ export interface NodeMetadata extends _NodeMetadata {
16491
};
16592
model_packs?: ModelPack[];
16693
}
167-
168-
export interface AssetWithPath extends Asset {
169-
folder_name: string;
170-
folder_path: string;
171-
folder_id: string;
172-
}
173-
174-
export interface AssetSearchResult {
175-
assets: AssetWithPath[];
176-
next_cursor?: string;
177-
total_count: number;
178-
is_global_search: boolean;
179-
}
180-
181-

mobile/src/types/chat.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -106,27 +106,6 @@ export interface ChatMessageRequest {
106106
media_generation?: MediaGenerationRequest;
107107
}
108108

109-
/**
110-
* State for the chat store
111-
*/
112-
export interface ChatState {
113-
// Connection state
114-
status: ChatStatus;
115-
statusMessage: string | null;
116-
error: string | null;
117-
118-
// Thread management
119-
threads: Record<string, Thread>;
120-
currentThreadId: string | null;
121-
122-
// Messages for current thread
123-
messageCache: Record<string, Message[]>;
124-
isLoadingMessages: boolean;
125-
126-
// Model selection (for future)
127-
selectedModel: LanguageModel | null;
128-
}
129-
130109
/**
131110
* WebSocket configuration
132111
*/

mobile/src/types/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export type {
2323
GenerationStoppedUpdate,
2424
ErrorUpdate,
2525
ChatMessageRequest,
26-
ChatState,
2726
WebSocketConfig,
2827
} from "./chat";
2928
// Export chat file handling types

web/src/components/menus/RemoteSettingsMenu.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,6 @@ export interface DisplayedGroup {
109109
label: string;
110110
}
111111

112-
/** Anchor id for a settings group heading (e.g. "vLLM" → "vllm"). */
113-
export const settingGroupSlug = (groupName: string): string =>
114-
groupName.toLowerCase().replace(/\s+/g, "-");
115-
116112
/**
117113
* Partitions visible registry groups into the fixed meta-section order. Shared
118114
* by the panel (rendering) and getDisplayedSettingGroups (sidebar) so the two

web/src/components/ui_primitives/testUtils.tsx

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

0 commit comments

Comments
 (0)