mirror of
https://github.com/storytold/figcraft.git
synced 2026-11-29 01:34:37 +01:00
The desktop app started in a new, empty file on every launch, and with a control port open (FIGCRAFT_CONTROL_PORT set for an attached agent) even the Start on the Home screen preference was overridden, so the files you worked in had to be found and opened again each time. Quitting now keeps the paths of the open tabs' files, in tab order, and the one in front (Prefs::open_files, Prefs::front_file); the next start opens them again and brings that one forward, as Figma's desktop app reopens its tabs. Files without a path (new, imported, joined live) and branch tabs are left out. A file named on the command line stays in front, a recovered copy keeps its one tab (file.open switches to an open path), a file gone since is skipped, and one that won't open is reported like a file named on the command line. With nothing to reopen the window starts on the Home screen; only with a control port open does it still start in a new file (#874: control callers expect a document). Start on the Home screen now means Home instead of the reopened files. The list is written at quit only, with the other preferences. Keeping it on every tab change would cover a crash too, but a crash already brings back the unsaved files through recovery copies, and the list from the last quit is a fair fallback for the rest.