mirror of
https://github.com/storytold/figcraft.git
synced 2026-10-26 19:36:46 -06:00
M12: session restore: windows and tabs come back as they were left
The interface keeps a saved session with the preferences, written whenever it changes (at once, then at most once a second; nothing while idle): each window's place, size, maximized or full-screen state and screen, its panels, its tabs in order with the one in front, and per tab the saved file or your online file (server and id, never a token), the page and the view. At the next start the windows and tabs open again (`session.restore`): a window off every screen moves onto one, files that are gone are skipped with one message, online files are joined again as their owner and take their place when they arrive, and a file or invite link from the command line opens in front. Unsaved documents stay the recovery copies' job. A mark written before restoring and cleared once the windows have settled keeps a crash while restoring from repeating: the next run starts without it and the home screen offers Restore last session. Preferences ▸ Reopen windows and tabs from last time (`pref.restoreSession`) and `--fresh` start without it. `window.list` reports each window's rectangle and state; `ui.inspect` reports the kept session. The saved-state reader takes junk, cut-off, huge and wrongly typed input without failing; tests cover the round trip, order and front tab, missing files, an online file through a scripted link, off-screen rectangles, the crash guard, the preference, a command-line file and several windows.
This commit is contained in:
@@ -133,6 +133,12 @@ live sessions (`collab.*`: without a key on a server open to the public, with `c
|
||||
`collab.manageFile` for the owner token and `collab.report`) and use plugin directories
|
||||
(`plugin.directory.*`); the one-shot `run` can't (no network link).
|
||||
|
||||
The desktop app's own command line is `figcraft [--control PORT] [--fresh] [files…]
|
||||
[figcraft://join?…]`: files and an invite link open in front of the windows and tabs from last
|
||||
time, which open again by themselves (Preferences ▸ Reopen windows and tabs from last time);
|
||||
`--fresh` starts without them once, leaving the preference as it is (`session.restore` still
|
||||
brings them back in that run).
|
||||
|
||||
### `plugin publish <folder> --server ws://host:port/[?key=KEY]`
|
||||
|
||||
Publishes a plugin folder (`figcraft-plugin.json`, the module its `main` names, an optional `assets/`
|
||||
|
||||
Reference in New Issue
Block a user