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.

Per-panel state

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

User configuration

Path Used for
~/.soffit/snippets.json Custom text expansion triggers
~/.soffit/themes/*.json Custom Preview themes
~/.soffit/templates/daily.md Daily note seed (workspace-relative; this lives in the workspace, not your home)

The home .soffit/ dir is created on first launch with empty defaults. Edit any file in any text editor; Soffit watches and reloads.

UserDefaults

Key Purpose
soffit.recentFiles.v1 Last 20 opened files (MRU)
soffit.sidebarWidth Resizable sidebar width
soffit.spellCheck Spell-check toggle for markdown editor
soffit.themeName Currently selected Preview theme

Resource bundle

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

File Purpose
mermaid-shim.html + mermaid.min.js Mermaid rendering
math-shim.html + katex.min.{css,js} + marked.min.js + fonts/*.woff2 Math rendering
AppIcon.icns App icon

Vendor scripts (scripts/vendor-mermaid.sh, scripts/vendor-katex.sh) refresh these.

Workspace-side state

Inside your workspace folder:

Path Created by
attachments/ First image paste (⌘V of an image inserts here)
daily/ First daily-note open (⌘⇧D)
.soffit/templates/daily.md Optional, you create it; if present, daily-note creation seeds from it

These are normal files. Commit them to git, sync them via iCloud Drive, whatever you want.

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
Sketch strokes Per-tab scroll position
Recent files list Outline / backlinks panel state
Workspace root Hover / drag overlay state
Sidebar width, spell-check toggle, theme

Backup and migrate

To move a workspace to another Mac:

  1. Copy your folder.
  2. Copy ~/Library/Application Support/Soffit/layout.json.
  3. Optionally copy ~/.soffit/ for snippets and themes.
  4. Open Soffit on the new Mac, point it at the copied folder.

To reset to a clean slate without uninstalling:

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

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

Workspace index

Lives in memory only. Built on workspace open, refreshed on FSEvents. Holds:

  • File metadata: title, headings, tags, frontmatter, wiki-links, inline links, word count, modification date
  • Lowercase content for full-text search

Never written to disk. Cost: roughly 1.5× the total markdown file size in RAM. For a 5,000-file knowledge base of average-sized notes, expect ~50–100 MB of memory.

Clone this wiki locally