From 183af193dcf46838506958a50daad61c6b29a23d Mon Sep 17 00:00:00 2001 From: haoyuren <13851610112@163.com> Date: Sun, 15 Mar 2026 04:00:12 -0500 Subject: Fix server compile: download PDF to .build dir, prevent artifact sync to Overleaf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The root cause of server compile failures was that output.pdf was being saved into the synced project directory, causing FileSyncBridge to upload it back to Overleaf as a project file. CLSI then failed because it found an existing output.pdf blocking its compilation output. Changes: - Save compile artifacts (PDF, synctex.gz) to .build/ subdirectory instead of the synced project root — .build is a dotfile dir ignored by chokidar - Add pdf/pdfxref/stderr/stdout/chktex to FileSyncBridge ignore patterns - Add rootResourcePath to compile request body (matches Overleaf web client) - Implement PDF download with fallback via direct build ID URL construction - Add server compile handler, compile dropdown menu, PDF save button - Fix resolved comment highlight flash on startup (null initial state) - Fix EPIPE crash on startup when stdout/stderr is closed - Fix synctex inverse search to use relative paths via OT doc join Co-Authored-By: Claude Opus 4.6 --- src/preload/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/preload/index.ts') diff --git a/src/preload/index.ts b/src/preload/index.ts index 2be6e0b..b2984b5 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -128,6 +128,10 @@ const api = { ipcRenderer.invoke('overleaf:socketCompile', mainTexRelPath) as Promise<{ success: boolean; log: string; pdfPath: string }>, + overleafServerCompile: (rootDocId?: string) => + ipcRenderer.invoke('overleaf:serverCompile', rootDocId) as Promise<{ + success: boolean; log: string; pdfPath: string + }>, overleafRenameEntity: (projectId: string, entityType: string, entityId: string, newName: string) => ipcRenderer.invoke('overleaf:renameEntity', projectId, entityType, entityId, newName) as Promise<{ success: boolean; message?: string }>, overleafDeleteEntity: (projectId: string, entityType: string, entityId: string) => @@ -201,7 +205,9 @@ const api = { // Shell openExternal: (url: string) => ipcRenderer.invoke('shell:openExternal', url), - showInFinder: (path: string) => ipcRenderer.invoke('shell:showInFinder', path) + showInFinder: (path: string) => ipcRenderer.invoke('shell:showInFinder', path), + savePdf: (sourcePath: string) => + ipcRenderer.invoke('shell:savePdf', sourcePath) as Promise<{ success: boolean; path?: string }> } contextBridge.exposeInMainWorld('api', api) -- cgit v1.2.3