From dcb7f2a39fc8db5378382b48829378fe35d0abdb Mon Sep 17 00:00:00 2001 From: hy Date: Thu, 29 Jan 2026 13:52:33 +0800 Subject: [PATCH] =?UTF-8?q?feat(main):=20=E5=A2=9E=E5=8A=A0F12=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E5=BC=80=E5=8F=91=E8=80=85=E5=B7=A5=E5=85=B7=E5=BF=AB?= =?UTF-8?q?=E6=8D=B7=E9=94=AE=E5=B9=B6=E8=B0=83=E6=95=B4=E7=AA=97=E5=8F=A3?= =?UTF-8?q?=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将主窗口宽度从900px调整为1200px以提供更好的布局空间 - 注册全局快捷键F12,用于快速打开/关闭右侧开发者工具面板 - 优化开发体验,便于调试和检查应用状态 --- src/main/index.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/index.ts b/src/main/index.ts index faef67f5..e737d3a1 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -6,11 +6,12 @@ import { registerHandlers } from './ipc/handlers' import { IngestionService } from './services/ingestion/FileLoader' import { EmbeddingService } from './services/vector/EmbeddingService' import { UnifiedStore } from './services/storage/UnifiedStore' +import { globalShortcut } from 'electron' function createWindow(): void { // Create the browser window. const mainWindow = new BrowserWindow({ - width: 900, + width: 1200, height: 670, show: false, autoHideMenuBar: true, @@ -37,6 +38,16 @@ function createWindow(): void { } else { mainWindow.loadFile(join(__dirname, '../renderer/index.html')) } + + globalShortcut.register('F12', () => { + const wc = mainWindow.webContents + + if (wc.isDevToolsOpened()) { + wc.closeDevTools() + } else { + wc.openDevTools({ mode: 'right' }) + } + }) } // This method will be called when Electron has finished