diff options
| author | haoyuren <13851610112@163.com> | 2026-03-15 04:27:43 -0500 |
|---|---|---|
| committer | haoyuren <13851610112@163.com> | 2026-03-15 04:27:43 -0500 |
| commit | d1ee677591bd5e6e8b1726b2281621adf6131332 (patch) | |
| tree | 609785e6022fe41f8809ab172003928165a1bb72 /src/preload/index.ts | |
| parent | 6aea514b38a8b36882d39aec30fd12e997f82611 (diff) | |
v0.3.0: Fix sync exclusions, add editor zoom, cached PDF loadingv0.3.0
- Exclude CLAUDE.md from sync (move to .claude/ dotfile dir, clean up root copy)
- Add Ctrl+wheel font zoom for editor (capture phase, disable Electron built-in zoom)
- Load cached PDF on project connect (avoid recompile to see last PDF)
- Add synctex debug logging for PDF↔source navigation troubleshooting
- Fix .claude/ dir creation order (mkdir before write)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'src/preload/index.ts')
| -rw-r--r-- | src/preload/index.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/preload/index.ts b/src/preload/index.ts index b2984b5..649c3aa 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -1,9 +1,15 @@ // Copyright (c) 2026 Yuren Hao // Licensed under AGPL-3.0 - see LICENSE file -import { contextBridge, ipcRenderer, webUtils } from 'electron' +import { contextBridge, ipcRenderer, webUtils, webFrame } from 'electron' import { createHash } from 'crypto' +// Prevent Electron's built-in Ctrl+wheel zoom so editor can handle font scaling +webFrame.setVisualZoomLevelLimits(1, 1) +window.addEventListener('wheel', (e) => { + if (e.ctrlKey || e.metaKey) e.preventDefault() +}, { passive: false }) + const api = { // File system readFile: (path: string) => ipcRenderer.invoke('fs:readFile', path), @@ -66,6 +72,8 @@ const api = { pathDocMap?: Record<string, string> fileRefs?: Array<{ id: string; path: string }> rootFolderId?: string + syncDir?: string + cachedPdfPath?: string message?: string }>, otDisconnect: () => ipcRenderer.invoke('ot:disconnect'), |
