refactor: change open recipe in new window to pass recipe id (#7392)

This commit is contained in:
Zane
2026-02-23 07:24:00 -08:00
committed by GitHub
parent 33af64406b
commit ffed9dfc4f
12 changed files with 162 additions and 198 deletions
+12 -25
View File
@@ -89,6 +89,15 @@ interface UpdaterEvent {
data?: unknown;
}
export interface CreateChatWindowOptions {
query?: string;
dir?: string;
version?: string;
resumeSessionId?: string;
viewType?: string;
recipeId?: string;
}
// Define the API types in a single place
type ElectronAPI = {
platform: string;
@@ -96,14 +105,7 @@ type ElectronAPI = {
getConfig: () => Record<string, unknown>;
hideWindow: () => void;
directoryChooser: () => Promise<Electron.OpenDialogReturnValue>;
createChatWindow: (
query?: string,
dir?: string,
version?: string,
resumeSessionId?: string,
viewType?: string,
recipeDeeplink?: string
) => void;
createChatWindow: (options?: CreateChatWindowOptions) => void;
logInfo: (txt: string) => void;
showNotification: (data: NotificationData) => void;
showMessageBox: (options: MessageBoxOptions) => Promise<MessageBoxResponse>;
@@ -188,23 +190,8 @@ const electronAPI: ElectronAPI = {
},
hideWindow: () => ipcRenderer.send('hide-window'),
directoryChooser: () => ipcRenderer.invoke('directory-chooser'),
createChatWindow: (
query?: string,
dir?: string,
version?: string,
resumeSessionId?: string,
viewType?: string,
recipeDeeplink?: string
) =>
ipcRenderer.send(
'create-chat-window',
query,
dir,
version,
resumeSessionId,
viewType,
recipeDeeplink
),
createChatWindow: (options?: CreateChatWindowOptions) =>
ipcRenderer.send('create-chat-window', options || {}),
logInfo: (txt: string) => ipcRenderer.send('logInfo', txt),
showNotification: (data: NotificationData) => ipcRenderer.send('notify', data),
showMessageBox: (options: MessageBoxOptions) => ipcRenderer.invoke('show-message-box', options),