Skip to content

Persistence

lukataylor-pixel edited this page May 3, 2026 · 2 revisions

Persistence

Where Soffit writes things on disk, and what survives a relaunch.

Layout snapshot

~/Library/Application Support/Soffit/layout.json

The whole pane tree. Tabs, active IDs, split orientations and ratios, plus per-panel state blobs. Written debounced 300ms after any change. Pretty-printed JSON with sorted keys for diff-friendliness.

What's in it:

{
  "workspaceRoot": "/Users/me/notes",
  "tree": {
    "kind": "split",
    "id": { "raw": "..." },
    "orientation": "horizontal",
    "ratio": 0.5,
    "first": {
      "kind": "leaf",
      "pane": {
        "id": { "raw": "..." },
        "tabs": [
          { "id": ..., "source": "file:///...", "title": "spec.md", "state": "<base64>" }
        ],
        "activeTabID": ...
      }
    },
    "second": { ... }
  }
}

Per-panel state is opaque to the layout layer — it's whatever the provider chose to encode.

Per-panel state

Provider Encodes
File (markdown) MarkdownPanelState — current mode (preview / edit / split)
Folder CanvasState — items, positions, sizes, sticky note text/colours, zoom, pan, mode
Chat (legacy) ChatState — message history
Terminal, Web, Mermaid Nothing persisted

Recent files

UserDefaults key soffit.recentFiles.v1

A flat array of standardised file URLs, MRU order, capped at 20. Auto-prunes deleted files when you expand the Recent sidebar section.

To clear: sidebar → Recent → expand → Clear at the bottom. To wipe via shell: defaults delete com.soffit.app soffit.recentFiles.v1.

Resource bundle

Inside Soffit.app/Contents/Resources/Soffit_Soffit.bundle/:

File Purpose
mermaid-shim.html The HTML page that renders .mmd files
mermaid.min.js Vendored mermaid renderer (run scripts/vendor-mermaid.sh to fetch — not committed)

What gets cleared on relaunch

Survives Doesn't
Pane tree, tabs, splits, ratios Terminal sessions (always fresh)
Markdown editor mode per panel Markdown undo history
Canvas item positions, sticky text, zoom, pan Folder grid sort scroll position
Recent files list Per-tab scroll position
Workspace root Hover/drag overlay state

Backup and migrate

To move a workspace to another Mac:

  1. Copy your folder.
  2. Copy ~/Library/Application Support/Soffit/layout.json.
  3. Open Soffit on the new Mac, point it at the copied folder. Layout restores.

To reset to a clean slate without uninstalling:

rm ~/Library/Application\ Support/Soffit/layout.json
defaults delete com.soffit.app soffit.recentFiles.v1

Then relaunch — Soffit will ask for a workspace folder again.

Clone this wiki locally