Wire General Assist and screen capture through Electron IPC

This commit is contained in:
CREDO23 2026-04-24 19:14:37 +02:00
parent 7097f542fb
commit b0810b4d47
7 changed files with 40 additions and 49 deletions

View file

@ -1,5 +1,6 @@
import { app, BrowserWindow, shell, session } from 'electron';
import path from 'path';
import { trackEvent } from './analytics';
import { showErrorDialog } from './errors';
import { getServerPort } from './server';
import { setActiveSearchSpaceId } from './active-search-space';
@ -93,3 +94,15 @@ export function createMainWindow(initialPath = '/dashboard'): BrowserWindow {
return mainWindow;
}
export function showMainWindow(source: 'tray_click' | 'tray_menu' | 'shortcut' = 'tray_click'): void {
const existing = getMainWindow();
const reopened = !existing || existing.isDestroyed();
if (reopened) {
createMainWindow('/dashboard');
} else {
existing.show();
existing.focus();
}
trackEvent('desktop_main_window_shown', { source, reopened });
}