Skip to content

[Proposal]: PRs for persistent scratchpads, session restoration, and macOS Spaces support #7

Description

@jeanmonet

Problem and redacted use case

I've opened two PRs that extend current capabilities in a very simple but useful way:

  • be able to, on the fly, create new documents that act as persisted scratchpad until they are actually saved to some location (ie similar to how you would use notepad++)
  • restore opened state upon app relaunch to relevant MacOS Spaces (windows): i often have multiple windows in multiple "workspaces" (MacOS Spaces) that i slide through. When you re-open Margin, the relevant windows will be opened in the relevant Spaces (without shifting your view from current Space, which sometimes happens with other apps and is annoying).

Please consider these, so i don't have to re-base on every new release :)

More details:


PR #5 — Persistent scratchpads and window sessions

PR #5: Add persistent scratchpads and multi-window session restoration

The goal is for users to be able to write immediately without first choosing a file and without worrying about losing work or manually rebuilding their workspace after restarting the app.

This adds durable untitled Markdown scratchpads, similar to the unsaved-document experience in editors such as Notepad++:

  • ⌘T opens a new scratchpad tab.
  • ⌘N opens a new scratchpad window.
  • Scratchpads are automatically and atomically saved, even before they have a filename.
  • ⌘⇧S promotes a scratchpad to a normal Markdown file.
  • Multiple windows and native tabs are restored after quitting and reopening Margin.
  • Selected tabs, window positions, editor state, and physical-display placement are preserved.
  • Existing session data is migrated safely.

PR #6 — Restore windows to their macOS Spaces

PR #6: Restore windows to their macOS Spaces without switching Spaces

This builds on PR #5 and extends session restoration to macOS Spaces on macOS 26:

  • Each restored window returns to its previous macOS Space.
  • Launching Margin does not pull the user into another Space.
  • If no restored Margin window belongs to the current Space, Margin can present a temporary empty window there while keeping the other restored windows in their proper Spaces.
  • Ordinary Space changes remain passive: Margin does not create hidden windows, activate itself, steal focus, schedule delayed callbacks, or perform background persistence work.
  • The private WindowServer integration is isolated, restricted to the tested macOS version, and fails closed when unavailable.

Tested, incl perf tested - all green on my side. Used it for a few days, all good. Implemented with GPT 5.6 Sol (xhigh).

Proposed behavior

please see above

Alternatives considered

please see above

Relevant product constraints (optional)

No response

Checklist

  • I searched for an existing issue.
  • I removed personal, private, inappropriate, confidential, proprietary, identifying, credential, path, prompt, trace, and holdout information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions