Repository navigation
P0 mac: Export PDF works with unsaved edits (and says why when it can't); autosave saves every edited file - #776
Merged
Conversation
…ntry Owner report: "the autosave isn't working." Autosave was scoped to the entry document while it is active: - scheduleAutosave/performAutosave guarded activePath == entryPath, so project members (chapters opened from the sidebar) never autosaved; - performAutosave re-checked activePath when the timer fired, so switching tabs within the 2 s debounce silently dropped the entry's pending save; - an edit in any other document cancelled the pending work item before the guard returned, dropping the entry's save as well. The shared timer now saves every dirty document when it fires, each through its existing conflict-checked save (saveTex's write for the entry via new saveEntryTex, controllerSave when the controller routes the file, project.saveDocument/saveDocumentNow for members). No panels; a document with an outstanding conflict is skipped; untitled buffers are never touched. flushPendingAutosave now runs only a scheduled save, so tests go through the same schedule path typing does. Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
…ncident Autosave saves every dirty, file-backed document through the conflict-checked save path; switching tabs or editing another document no longer drops a pending save. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent (Commander) Co-authored-by: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
…res alert Export of a document with unsaved edits failed: after the first full frame, every edit's preview arrives as a display_list_delta that the app reconstructs in memory, but exportListURL() handed the raw delta line to flashtex-pdf-exact, which refuses it (`type "display_list_delta" is not display_list`). The refusal only reached the status line, so the export looked silent. - exportListURL(): a frame whose live line is a delta is re-rendered whole from the current buffers through the render pipeline, like a windowed frame. - exportPDFRefusal(): refuses delta frames with a clear reason when no render pipeline is available. - exportPDF(): every refusal/failure (including the previously silent guard) sets the status line and shows an alert. - ExportUnsavedBufferTests: real flashtex-render + flashtex-pdf-exact, saved export, unsaved entry and member edits, asserts the delta shape and the unsaved text in the PDF. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Co-authored-by: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
…ncident Export PDF with unsaved edits: a preview frame rebuilt from a display_list_delta is re-rendered as a whole document from the current buffers instead of handing the raw delta line to flashtex-pdf-exact (which refused it). Export failures now raise an alert as well as the status line. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent (Commander) Co-authored-by: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
P0: Export PDF fails silently with unsaved edits, and autosave doesn't save
The owner reported: "if the file is unsaved, it doesn't export … Export works fine if (all) files are saved, otherwise the export fails silently. Also, the autosave isn't working."
Export: root cause (reproduced by a failing test first)
flashtex-render, and the app requestsdisplay-list-v2-delta. After an edit, the preview frame is rebuilt from adisplay_list_delta.exportListURL()treated every unwindowed frame as a complete list. It wrote the raw delta line to a file and handed it toflashtex-pdf-exact, which refused it witherror: type "display_list_delta" is not display_list.guard … else { return }inexportPDF()returned with no message at all.Fix:
.appbundlesflashtex-rendernext to the executable, andlocateRenderPipelinefinds it there.Autosave: root causes
Fix: any edit re-arms one shared timer. When it fires, every dirty, file-backed document is saved through the same conflict-checked path ⌘S uses. It never opens a panel. A file changed on disk is still refused.
Verification (combined tree
81960ff4)swift build --build-tests: clean.ExportUnsavedBufferTests(fails before the fix with the exit-1 delta refusal) and 3 newAutosaveTests(2 fail before the fix). All pass after.flashtex-pdf-exactandflashtex-render, covering Autosave, Export, ExportSession, PrintController, PDFExport, DisplayListDelta, ProjectDocuments, DocumentKinds and EditorPreferences: 111 tests, 0 failures./tmp/ftgate.lock, with preview-controller and compiler binaries set so the helper-route tests run: results to follow in a comment.Attribution
faf0a997).1d5bc616).🤖 Generated with Claude Code
https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz