mirror of
https://github.com/storytold/photocraft.git
synced 2026-10-14 19:26:51 -04:00
Headless::save recorded the saved revision only for .pcraft, so saving a document back to its own PSD or PSB wrote the file correctly and still left session.list reporting dirty: true. Automation clients that use the flag could not tell a saved document from unsaved work. The test is now "was this a layered document save" (PSD, PSB or .pcraft) rather than "was this .pcraft". A flat export (PNG, JPEG, ...) stays a copy: it leaves dirty and the document's path alone. The desktop app.save path already recorded the revision for every format, so this only affects the headless JSON-lines server and the MCP stdio server, which both route through Headless::save. Tests cover the reported sequence for both .psd and .psb -- create, reopen the saved file, edit, then doc.save with no path -- plus a control that a flat export is a copy. docs/control-protocol.md now states the outcome of doc.save for the dirty flag and the document path. Co-authored-by: Space Bunny Free <[email protected]>