diff options
| author | bndw <ben@bdw.to> | 2026-02-28 19:34:02 -0800 |
|---|---|---|
| committer | bndw <ben@bdw.to> | 2026-02-28 19:34:02 -0800 |
| commit | 283013c09d4855529e846951a1e090f0f16030a8 (patch) | |
| tree | e78c84c85b07806770faee99af7280d0a83eadc8 /src/main | |
| parent | 9a636af9090b122db2e55737fca3e78550aab9df (diff) | |
feat: auto session naming
Diffstat (limited to 'src/main')
| -rw-r--r-- | src/main/index.ts | 4 | ||||
| -rw-r--r-- | src/main/ipc/handlers.ts | 6 | ||||
| -rw-r--r-- | src/main/preload.ts | 2 |
3 files changed, 10 insertions, 2 deletions
diff --git a/src/main/index.ts b/src/main/index.ts index f0b23f7..a7bed00 100644 --- a/src/main/index.ts +++ b/src/main/index.ts | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | import { app, BrowserWindow } from "electron"; | 1 | import { app, BrowserWindow, Menu } from "electron"; |
| 2 | import path from "node:path"; | 2 | import path from "node:path"; |
| 3 | import { getDb, closeDb } from "./db"; | 3 | import { getDb, closeDb } from "./db"; |
| 4 | import { registerIpcHandlers } from "./ipc/handlers"; | 4 | import { registerIpcHandlers } from "./ipc/handlers"; |
| @@ -41,6 +41,8 @@ function createWindow() { | |||
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | app.whenReady().then(() => { | 43 | app.whenReady().then(() => { |
| 44 | Menu.setApplicationMenu(null); | ||
| 45 | |||
| 44 | // Initialize database | 46 | // Initialize database |
| 45 | getDb(); | 47 | getDb(); |
| 46 | 48 | ||
diff --git a/src/main/ipc/handlers.ts b/src/main/ipc/handlers.ts index d9beaf0..145c6e2 100644 --- a/src/main/ipc/handlers.ts +++ b/src/main/ipc/handlers.ts | |||
| @@ -31,7 +31,11 @@ export function registerIpcHandlers(mainWindow: BrowserWindow): void { | |||
| 31 | } | 31 | } |
| 32 | sessions.deleteSession(id); | 32 | sessions.deleteSession(id); |
| 33 | }); | 33 | }); |
| 34 | 34 | ||
| 35 | ipcMain.handle("sessions:rename", (_, id: string, name: string) => { | ||
| 36 | sessions.updateSession(id, { name }); | ||
| 37 | }); | ||
| 38 | |||
| 35 | ipcMain.handle("sessions:get", (_, id: string) => sessions.getSession(id)); | 39 | ipcMain.handle("sessions:get", (_, id: string) => sessions.getSession(id)); |
| 36 | 40 | ||
| 37 | // Messages | 41 | // Messages |
diff --git a/src/main/preload.ts b/src/main/preload.ts index 2c228dd..f377639 100644 --- a/src/main/preload.ts +++ b/src/main/preload.ts | |||
| @@ -15,6 +15,7 @@ export interface ClaudeFlowAPI { | |||
| 15 | createSession: (projectId: string, name: string) => Promise<Session>; | 15 | createSession: (projectId: string, name: string) => Promise<Session>; |
| 16 | deleteSession: (id: string) => Promise<void>; | 16 | deleteSession: (id: string) => Promise<void>; |
| 17 | getSession: (id: string) => Promise<Session | undefined>; | 17 | getSession: (id: string) => Promise<Session | undefined>; |
| 18 | renameSession: (id: string, name: string) => Promise<void>; | ||
| 18 | 19 | ||
| 19 | // Messages | 20 | // Messages |
| 20 | listMessages: (sessionId: string) => Promise<Message[]>; | 21 | listMessages: (sessionId: string) => Promise<Message[]>; |
| @@ -70,6 +71,7 @@ const api: ClaudeFlowAPI = { | |||
| 70 | ipcRenderer.invoke("sessions:create", projectId, name), | 71 | ipcRenderer.invoke("sessions:create", projectId, name), |
| 71 | deleteSession: (id) => ipcRenderer.invoke("sessions:delete", id), | 72 | deleteSession: (id) => ipcRenderer.invoke("sessions:delete", id), |
| 72 | getSession: (id) => ipcRenderer.invoke("sessions:get", id), | 73 | getSession: (id) => ipcRenderer.invoke("sessions:get", id), |
| 74 | renameSession: (id, name) => ipcRenderer.invoke("sessions:rename", id, name), | ||
| 73 | 75 | ||
| 74 | // Messages | 76 | // Messages |
| 75 | listMessages: (sessionId) => ipcRenderer.invoke("messages:list", sessionId), | 77 | listMessages: (sessionId) => ipcRenderer.invoke("messages:list", sessionId), |
