mirror of
https://github.com/storytold/figcraft.git
synced 2026-10-20 02:08:21 +00:00
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.