Skip to content

Commit 88ddac3

Browse files
committed
fix: consolidate ErrorBoundary, add error logging, add lint scripts
- Removed duplicate src/ErrorBoundary.tsx, consolidated to components/ErrorBoundary.tsx - Replaced silent .catch(() => {}) with console.error logging in App.tsx - Added lint and typecheck scripts to package.json
1 parent 5a8fdbf commit 88ddac3

5 files changed

Lines changed: 93 additions & 44 deletions

File tree

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"scripts": {
77
"dev": "vite",
88
"build": "tsc -b && vite build",
9-
"preview": "vite preview"
9+
"preview": "vite preview",
10+
"lint": "tsc --noEmit",
11+
"typecheck": "tsc --noEmit"
1012
},
1113
"dependencies": {
1214
"@tailwindcss/typography": "^0.5.19",

src/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function WorkspaceLayout({ loggedIn, onLogout }: { loggedIn: boolean; onLogout:
5454
// Load workspaces
5555
useEffect(() => {
5656
if (loggedIn) {
57-
api<Workspace[]>("/v1/workspaces").then(setWorkspaces).catch(() => {});
57+
api<Workspace[]>("/v1/workspaces").then(setWorkspaces).catch((e) => console.error("Failed to load workspaces:", e));
5858
}
5959
}, [loggedIn]);
6060

@@ -67,7 +67,7 @@ function WorkspaceLayout({ loggedIn, onLogout }: { loggedIn: boolean; onLogout:
6767
setChannel(null);
6868
setMessages([]);
6969
setActiveThread(null);
70-
api<Channel[]>(`/v1/workspaces/${ws.id}/channels`).then(setChannels).catch(() => {});
70+
api<Channel[]>(`/v1/workspaces/${ws.id}/channels`).then(setChannels).catch((e) => console.error("Failed to load channels:", e));
7171
}
7272
}, [workspaceId, workspaces]);
7373

@@ -78,7 +78,7 @@ function WorkspaceLayout({ loggedIn, onLogout }: { loggedIn: boolean; onLogout:
7878
if (ch && ch.id !== channel?.id) {
7979
setChannel(ch);
8080
setActiveThread(null);
81-
api<Message[]>(`/v1/channels/${ch.id}/messages?limit=50`).then((m) => setMessages(m || [])).catch(() => {});
81+
api<Message[]>(`/v1/channels/${ch.id}/messages?limit=50`).then((m) => setMessages(m || [])).catch((e) => console.error("Failed to load messages:", e));
8282
}
8383
}, [channelId, channels]);
8484

src/ErrorBoundary.tsx

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

src/main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { StrictMode } from "react";
22
import { createRoot } from "react-dom/client";
33
import { BrowserRouter } from "react-router-dom";
44
import App from "./App";
5-
import { ErrorBoundary } from "./ErrorBoundary";
5+
import { ErrorBoundary } from "./components/ErrorBoundary";
66
import "./index.css";
77

88
createRoot(document.getElementById("root")!).render(

src/types/index.ts

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export interface Channel {
3838
topic?: string;
3939
is_private: boolean;
4040
is_archived?: boolean;
41+
room_version: number;
4142
created_at: number;
4243
updated_at: number;
4344
}
@@ -109,6 +110,12 @@ export interface Notification {
109110
channel_id?: string;
110111
message_id?: string;
111112
is_read: boolean;
113+
source_type?: string;
114+
priority?: string;
115+
ack_required?: boolean;
116+
acked_at?: number;
117+
expires_at?: number;
118+
payload?: string;
112119
created_at: number;
113120
}
114121

@@ -218,3 +225,82 @@ export interface SSOProvider {
218225
enabled: boolean;
219226
created_at: number;
220227
}
228+
229+
// --- Agent-native feature types ---
230+
231+
export type HeldDraftStatus = "held" | "sent" | "expired" | "cancelled";
232+
export type ReviewStatus = "pending" | "in_review" | "approved" | "changes_required" | "cancelled";
233+
234+
export interface HeldDraft {
235+
id: string;
236+
agent_id: string;
237+
channel_id: string;
238+
content: string;
239+
thread_id?: string;
240+
room_version: number;
241+
status: HeldDraftStatus;
242+
created_at: number;
243+
updated_at: number;
244+
expires_at?: number;
245+
}
246+
247+
export interface AgentWorkspaceItem {
248+
id: string;
249+
agent_id: string;
250+
workspace_id: string;
251+
name: string;
252+
description?: string;
253+
content?: string;
254+
mime_type: string;
255+
size: number;
256+
file_id?: string;
257+
namespace: string;
258+
tags?: string[];
259+
created_at: number;
260+
updated_at: number;
261+
}
262+
263+
export interface ReviewRequest {
264+
id: string;
265+
workspace_id: string;
266+
channel_id: string;
267+
requester_id: string;
268+
reviewer_id: string;
269+
subject: string;
270+
content: string;
271+
thread_id?: string;
272+
status: ReviewStatus;
273+
review_comment?: string;
274+
created_at: number;
275+
updated_at: number;
276+
reviewed_at?: number;
277+
}
278+
279+
export interface TemplateRole {
280+
name: string;
281+
system_prompt: string;
282+
capabilities: string[];
283+
runtime?: string;
284+
description?: string;
285+
}
286+
287+
export interface TemplateChannel {
288+
name: string;
289+
topic?: string;
290+
members: string[];
291+
is_private?: boolean;
292+
}
293+
294+
export interface TeamTemplate {
295+
id: string;
296+
workspace_id?: string;
297+
name: string;
298+
description?: string;
299+
category?: string;
300+
roles: TemplateRole[];
301+
channels?: TemplateChannel[];
302+
is_builtin: boolean;
303+
created_by?: string;
304+
created_at: number;
305+
updated_at: number;
306+
}

0 commit comments

Comments
 (0)