Skip to content

feat: enable durable startup, workspace and multi-window recovery (5/5) - #5922

Merged
Jocs merged 137 commits into
developfrom
feat/startup-10-multi-window
Oct 28, 2026
Merged

Jocs merged 137 commits into
developfrom
feat/startup-10-multi-window

Conversation

@Jocs

@Jocs Jocs commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Closes #519
Closes #2345
Closes #5412

Refs #3439, #5394, #5685, #2395, #3207, #1609, #528, #5581, #5596, #732, #3500, #645, #386, #3577, #3084, #3533, #2521, #3717, #2134, #1920, #1192, #2467, #2268, #3049, #2421, #3818, #143, #2672.

Summary

  • Restore startup windows, workspace files, layouts and document views from one validated session manifest. Explicit targets take priority, and window, editor and layout restoration settings act independently.
  • Persist unsaved bodies before their metadata references. Unify Save, Save As, autosave and close handling. Batch tab closes, window closes and quit share revision checks and cancel if a checkpoint arrives during recovery writes, metadata writes or cleanup; canceled view restores retain the user’s current outline folds. Preserve exact Save As paths and explicit CLI options.
  • Remove legacy recovery/bootstrap/save/close paths, EditorBufferStore, electron-window-state and layout localStorage. Clean completed recovery records and empty window directories; keep damaged storage read-only so it cannot block normal editing or be overwritten.

Type of change

  • Bug fix (non-breaking, fixes an issue)
  • New feature (non-breaking, adds functionality)
  • Breaking change (causes existing functionality to change)
  • Documentation update

Test plan

  • New tests added (or explain why not needed)
  • Manually tested on: macOS — isolated user-data profiles with native settings/folder/save dialogs, tab and multi-window save/discard/cancel, title-bar close, crash/cold restart, rendering/source selections and scrolling, outline/tree folds, workspace switching, actual BOM/CRLF Save As, autosave/external reload, native resize/maximize/fullscreen/minimize. Physical monitor removal and Windows/Linux manual acceptance are not claimed.

Validation on final head 9bd20f23:

  • The 83-case acceptance reference is fully accounted for: 72 complete native manual cases pass, 1 partly manual case has real Electron minimum-width coverage, 1 actual-app capacity case uses CLI/fixture assistance, 8 engineering timing/boundary cases pass, and physical monitor removal is not applicable in this environment. These are separate categories, not 83 claimed UI-manual passes.
  • Actual application checks include ten complete launch/edit/save-or-discard/quit cycles with zero remaining recovery-body records per cycle; 105 ordinary files plus drafts in two windows survive a crash/restart without session truncation; twelve legacy snapshots neither create extra windows nor change their original bytes. Capacity model checks exercise production defaults (50 workspaces / 100 recent files / 2000 fold keys), leaving all 55 input window models intact; this does not claim 55 native windows.
  • Final-head U1–U5 engineering unit subset: 157 passes across 8 files. Final-head real Electron recovery/preview/rename subset: 42 passes; collapsed-root creation/rename subset: 7 passes. Overlapping suites are not added together. Lint has 0 errors (169 existing warnings); typecheck and build:unpack pass.
  • Manual findings fixed and retested: missing workspace trees after renderer reload, close prompts without document identities, independent source/render scrolling across mode handoffs, macOS native maximize overwriting normal bounds, and creation inputs hidden under collapsed project roots. Each regression was reproduced before its fix. UI tests wait for the actual resized viewport; geometry/scroll assertions remain intact.
  • All 21 final-head PR checks pass. Desktop unit CI on Linux: 1643 passes and 5 skips (147 files pass, 2 files skipped). The preceding local macOS full unit run had 1641 passes across 148 files; the final-head U1–U5 subset is recorded above. Complete desktop Electron CI: 599 passes, 6 platform skips, 0 failures (605 tests) (run). Skips are not counted as passes.

Notes for reviewers [optional]


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

Jocs added 23 commits October 27, 2026 22:41
…ation

# Conflicts:
#	packages/desktop/src/renderer/src/components/editorWithTabs/sourceCode.vue
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Build artifacts for PR #5922:

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

Artifact Size Link
marktext-macos-x64 332.6 MB Download
marktext-macos-arm64 321.0 MB Download
marktext-linux-x64 729.8 MB Download
marktext-linux-arm64 572.0 MB Download
marktext-windows-arm64 327.5 MB Download
marktext-windows-x64 335.6 MB Download

Jocs added 27 commits October 28, 2026 13:16
# Conflicts:
#	packages/desktop/src/renderer/src/services/documentViewState.ts
#	packages/desktop/src/renderer/src/store/editor.ts
#	packages/desktop/test/unit/specs/window-recovery-layout.spec.ts
@Jocs
Jocs merged commit 14843ad into develop Oct 28, 2026
21 checks passed
@Jocs Jocs mentioned this pull request Oct 29, 2026
7 of 11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant