Skip to content

feat: integrate durable single-window startup recovery (9/10) - #5921

Closed
Jocs wants to merge 17 commits into
developfrom
feat/startup-09-integration
Closed

Jocs wants to merge 17 commits into
developfrom
feat/startup-09-integration

Conversation

@Jocs

@Jocs Jocs commented Oct 27, 2026

Copy link
Copy Markdown
Member

Summary

Connect the main-process document/checkpoint owner to actual editor windows, sandboxed IPC, preferences UI, native save/rename, file watchers and final close decisions. Renderer text and view changes checkpoint through one writer; startup uses the session manifest instead of scanning legacy window buffers. Corrupt state remains untouched and persistence failures keep the window editable and prevent an unsafe close.

Save As writes the captured text while newer typing remains dirty. Read-only transitions invalidate pending writes; external reloads become known disk baselines and deleted files retain their text. Preview replacement, renderer reload, file tree folds, all layout fields and native geometry use the managed window context.

Test plan

  • 1620 desktop unit tests, including duplicate document identity, malformed named recovery, relocation and external disk lifecycle regressions.
  • 12 real Electron tests: draft restart, save/close cleanup, renderer reload, corrupt metadata and retained legacy snapshots, failed replacement retry, Save As with newer typing, cancel/discard, layout/geometry/source selection restart, tree/opened-files folds, dirty rename, pending save read-only guard and external reload/deletion.
  • 6 existing preview-tab regressions against the new host.
  • pnpm run build:unpack, pnpm run lint, pnpm run typecheck.

Notes for reviewers

Depends on #5918, #5917, #5915, #5919 and #5920 (and their prerequisites). All target develop; this branch includes prerequisites. Review the integration after foundation merge commit 6e82bb6a (including the canonical-root regression backported to #5920).

The new host is enabled with MARKTEXT_SESSION_RECOVERY=1 for independent development and tests. This part deliberately limits startup to one window. Part 10 adds workspace recents, multi-window behavior and default activation. No old configuration/snapshot/localStorage migration, Hot Exit, history, orphan management UI or expiry cleanup is introduced. Design/progress documents remain on the desktop.

Refs #5596, #732, #3500, #519, #2345, #143, #2672, #3717, #2134, #1920, #1192, #2467. Issue closure is reserved for final default-enabled integration.


By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@github-actions

Copy link
Copy Markdown
Contributor

Build artifacts for PR #5921:

Run: https://github.com/marktext/marktext/actions/runs/40554097667

Artifact Size Link
marktext-macos-x64 332.5 MB Download
marktext-linux-x64 729.6 MB Download
marktext-windows-x64 335.5 MB Download
marktext-linux-arm64 571.9 MB Download
marktext-windows-arm64 327.4 MB Download
marktext-macos-arm64 320.9 MB Download

@Jocs

Jocs commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

Consolidated into #5922. All commits and tests are retained there; this duplicate review thread is closed without merging into develop.

@Jocs Jocs closed this 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