Skip to content

Keep closed windows closed; startup option to not restore the layout - #25

Merged
DavidSagan merged 1 commit into
mainfrom
remember-window-state
Nov 8, 2026
Merged

DavidSagan merged 1 commit into
mainfrom
remember-window-state

Conversation

@DavidSagan

Copy link
Copy Markdown
Member

Fixes closed windows reopening in the next session, and adds a startup option to skip restoring the last layout.

Bug: closed plot windows came back

  • Closing every plot window saved an empty plots/templates list.
  • On the next start, _add_default_plots(saved) treated the empty list as "nothing saved", because of templates or DEFAULT_TEMPLATES. So the default beta and orbit plots were created again.
  • Now an empty saved list is respected. The defaults are used only when nothing has been saved at all.
  • Closed section windows (Lattice, Data, …) were already handled correctly; this is now covered by a test.

New: "Restore window layout from last session"

  • A new checkbox next to the Start/Quit buttons in the startup window, on by default.
  • Unchecked, the GUI starts with the default layout: Main and Lattice windows plus the beta and orbit plots, tiled.
  • The choice is remembered, and it also applies when tao-gui is started with Tao arguments on the command line.
  • The layout is still saved when the GUI quits, so ticking the box again brings back the last layout.

Tests

  • test_closed_windows_stay_closed_next_session runs three sessions with the real save and restore:
    1. Close all plots and the Lattice window, open Data, then quit.
    2. Next session: only Main and Data are open, and there are no plots.
    3. With the option off: the defaults are back.
  • test_startup_restore_layout_checkbox checks the checkbox default and that the choice persists.
  • 64 passed and 1 skipped, both locally and in the conda-forge environment that CI uses.

🤖 Generated with Claude Code

…p option

An empty saved plot list was treated as "nothing saved", so closed plot
windows came back as the defaults. The startup window gets a "Restore
window layout from last session" checkbox.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DavidSagan
DavidSagan merged commit 9fc6b81 into main Nov 8, 2026
2 checks passed
@DavidSagan
DavidSagan deleted the remember-window-state branch November 8, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant