Novolis Docs
novolis-apps / sketch-studio/documents.md

Documents and settings

dotnetavaloniadesktopnovolis

← Documentation index · Sketch JSON · Getting started

Document actions

ActionShortcutBehavior
NewCtrl+NBlank SketchDocument; keeps current grid UI props
OpenCtrl+O.sketchjson via Avalonia StorageProvider
Recent—Flyout of up to 8 paths from settings
SaveCtrl+SWrites current path, or Save As if untitled
Save AsCtrl+Shift+SNew path; appends .sketchjson if missing

Before New / Open / Recent / close, if the document is dirty, a ChoiceDialog offers Save / Don't Save / Cancel.

Dirty tracking

  • DocumentChanged from SketchControl sets dirty (unless suppressed during load)
  • Title: Sketch Studio — {name}* when dirty, else without *
  • Untitled name is Untitled until first Save As

Load path

Successful Open / Save / Save As call SketchStudioSettings.RememberDocument, updating:

  • lastDocumentPath
  • recentPaths (MRU, max 8, case-insensitive path compare)

On window Opened, if lastDocumentPath exists on disk, the file is loaded with dirty suppressed (not re-shuffled through Remember unless you save again).

Settings file

%LocalAppData%\Novolis\Sketch Studio\settings.json

Example:

{
  "lastDocumentPath": "C:\\Users\\…\\sketches\\deck.sketchjson",
  "recentPaths": [
    "C:\\Users\\…\\sketches\\deck.sketchjson",
    "C:\\Users\\…\\sketches\\wire.sketchjson"
  ]
}

Corrupt or missing settings start empty; the folder is created on first save.

What is stored in the sketch file

Grid size / visibility / snap and all elements — see Sketch JSON. Not in the sketch file: selection, undo stacks, active tool, MRU, window size.

Serialization step on Save

Before write, the host copies control grid props onto doc.Grid, then SketchJson.Serialize. That keeps toolbar grid state consistent with the file even if the document object was stale.

Related