Skip to content

fix(native): persist covered-window edits and save before Quit - #29

Draft
gustavonline wants to merge 2 commits into
feat/codex-sidebar-canvasfrom
port/upstream-6689318-eventloop
Draft

gustavonline wants to merge 2 commits into
feat/codex-sidebar-canvasfrom
port/upstream-6689318-eventloop

Conversation

@gustavonline

@gustavonline gustavonline commented Oct 28, 2026 •

Copy link
Copy Markdown

Native edits can arrive while a window is covered and no frame is rendered. The old timer path only checked an existing deadline, so it could miss starting autosave. Menu Quit also trusted that debounce instead of flushing a project immediately, and window Close ignored save failure.

Poll autosave on every event-loop turn, preserving this fork's Session::autosave_due_ui guard and Theme draft/undo semantics. Use a shared exit boundary so Quit and Close flush projects and keep the app open when saving fails. The event-loop portion selectively ports upstream 66893186714a0bb5f16f1e5b9d93e69b5b37a86d; the exit fix is separate native work. No upstream rename, updater, signing or analytics code is imported.

Validation: a timed test uses the real App/Session, adds an edit without rendering a frame, verifies the debounce boundary, saves/reopens the project, then checks immediate-exit persistence before the next timer. Passed locally. The prior event-loop revision passed native/wasm CI. The integrated desktop candidate also persisted an actual MCP edit with its native window minimized. Exact final-head CI remains separate.

Draft against Factory's active branch for bounded adoption. This does not accept or close PR #9's wider requirements.

Selectively port michaelshimeles/sketch commit 6689318. Retain autosave_due_ui, Theme draft semantics, save handling and this fork's UI. Add a timed no-frame save/reopen regression. No rename, updater, signing or analytics changes.
Menu Quit previously trusted the autosave debounce, and window Close ignored save failure. Use one prepare_exit boundary for both. Extend the real Session save/reopen regression to cover an immediate Quit before the next timer. This is an additional native fix, not part of the upstream6689318 port.
@gustavonline gustavonline changed the title fix(native): start guarded autosave while the window is covered fix(native): persist covered-window edits and save before Quit Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant