Skip to content

refactor: define startup recovery state contracts (1/10) - #5913

Closed
Jocs wants to merge 2 commits into
developfrom
feat/startup-01-contracts
Closed

Jocs wants to merge 2 commits into
developfrom
feat/startup-01-contracts

Conversation

@Jocs

@Jocs Jocs commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Refs #732, #645, #519, #2345. Part 1 of the 10-PR startup recovery plan.

Summary

Startup restoration currently discovers every legacy window buffer instead of a bounded session and mixes global preferences with per-window layout. Define the shared contracts for preferences, session/window membership, independent document instances, workspace reopening templates, and latest-content recovery, without activating a new startup path.

Add fresh per-window defaults and canonical resource/workspace identities. Workspace root order is preserved for display but does not affect identity; symlink aliases deduplicate, missing children resolve through existing parents, and an empty path cannot accidentally select the working directory.

This foundation does not close the linked feature requests; the corresponding integrated restart behavior must pass first. Design, dependency, and issue-coverage documents are maintained outside the repository as requested.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Internal refactor

Test plan

  • TDD: missing-module and empty-path cases failed before implementation.
  • Seven focused identity/default/contract fixture tests pass.
  • All 1,458 desktop unit tests pass on macOS. The local checkout shares dependencies with another worktree, so a temporary, uncommitted Vitest configuration adds that dependency directory to Vite's filesystem allow list; all other test options and assertions are unchanged.
  • pnpm run lint (existing warnings, no errors).
  • pnpm run typecheck.

Notes for reviewers

Base: develop; no prerequisite PRs. No existing startup/close behavior or user files are changed. Contracts and storage ports live in shared/types/applicationState.ts; Node filesystem identity resolution stays in main/applicationState/identity.ts.

The independent module PRs will depend on these contracts and remain locally testable before the final integration. Historical references include #3500 (draft recovery), #3577 (workspace startup), #3717 (layout), #2421 (sidebar state), and #2672 (reading position). These remain regression references; no adjacent performance, titlebar, Hot Exit, or cloud-reload claim is made.


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 #5913:

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

Artifact Size Link
marktext-linux-x64 729.5 MB Download
marktext-windows-x64 335.4 MB Download
marktext-windows-arm64 327.3 MB Download
marktext-macos-x64 332.4 MB Download
marktext-macos-arm64 320.8 MB Download
marktext-linux-arm64 571.7 MB Download

@Jocs

Jocs commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

Consolidated into #5918. 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