Save the active comp and open comp tabs in project files

Project files now record activeComp and openComps next to savedBy, and
file.open restores them, so a project reopens on the comp it was saved
on (desktop app, CLI and MCP all open through file.open). Older files
and ids that no longer name a comp fall back to the first comp; older
versions ignore the new keys.

Fixes #748

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Fabio LussiandClaude Opus 5.5 committed 2026-10-11 17:27:01 +02:00
1 parent 9a7d3e7699
commit b0c0c61aa0
7 files changed
+141 -4

No files matched your search

+4 -1
View File
@@ -95,7 +95,10 @@ XML). Saving goes through `Project::to_file_json`, which checks that the text re
anything is written (JSON can't hold NaN or infinity), and files are written atomically. Opening
a file that a newer EffectCraft saved shows a warning: fields this version doesn't know are
dropped if it saves the project. Save, Save As, Save a Copy and Increment and Save keep the
file's format (`.ecprojx` stays XML).
file's format (`.ecprojx` stays XML). Next to `savedBy` the file records the active comp and the
open comp tabs (`activeComp`, `openComps`), which opening restores; they are editor state, not
part of `Project`, so older files (and ids that no longer name a comp) open on the first comp and
older versions ignore them.
`schema` changes when a saved value changes meaning; a project from an older schema is converted
when it is opened (`effectcraft_engine::upgrade_effects`, which also refreshes effect instances