diff --git a/apps/server/src/schema.sql b/apps/server/src/schema.sql index 66ca449..ef62af4 100644 --- a/apps/server/src/schema.sql +++ b/apps/server/src/schema.sql @@ -56,4 +56,4 @@ CREATE TABLE IF NOT EXISTS session_panes ( created_at TIMESTAMPTZ NOT NULL DEFAULT clock_timestamp(), UNIQUE (session_id, position) ); -CREATE INDEX IF NOT EXISTS session_panes_session_idx ON session_panes (session_id); +CREATE INDEX IF NOT EXISTS idx_session_panes_session ON session_panes (session_id); diff --git a/apps/server/src/types/api.ts b/apps/server/src/types/api.ts index 73068db..6ce6d80 100644 --- a/apps/server/src/types/api.ts +++ b/apps/server/src/types/api.ts @@ -91,15 +91,18 @@ export type ChatPaneState = Record; export type PaneState = ChatPaneState | FileBrowserPaneState; -export interface Pane { +interface PaneBase { id: string; session_id: string; position: number; - kind: PaneKind; - state: PaneState; created_at: string; } +export type Pane = PaneBase & ( + | { kind: 'chat'; state: ChatPaneState } + | { kind: 'file_browser'; state: FileBrowserPaneState } +); + export interface PaneCreateRequest { kind: PaneKind; position?: number; // optional; if omitted, append at end