Skip to content

feat: restore all open connections and tabs after quitting (#703) - #713

Merged
datlechin merged 2 commits into
mainfrom
feat/restore-tabs-on-relaunch
Apr 13, 2026
Merged

datlechin merged 2 commits into
mainfrom
feat/restore-tabs-on-relaunch

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • Save all open connection IDs at quit time and restore all connections on relaunch when "Reopen Last Session" is enabled
  • Support multi-connection restore (previously only the last-used connection was restored)
  • Add crash-recovery fallback: scan TabState directory for restorable connections if the saved list is missing
  • Hide Welcome window immediately during auto-reconnect to prevent visible flash
  • Deterministic restore order by using ConnectionStorage ordering instead of random Dictionary.keys

Closes #703

Changes

File Change
AppSettingsStorage.swift saveLastOpenConnectionIds / loadLastOpenConnectionIds for multi-connection ID persistence
TabDiskActor.swift connectionIdsWithSavedState() for crash-recovery disk scan
AppDelegate.swift Save all connections at quit; 3-tier restore: multi-connection → single legacy → disk scan
AppDelegate+WindowConfig.swift attemptAutoReconnectAll(connectionIds:) + closeWelcomeWindowEagerly()
AppSettingsStorageTests.swift 6 new tests for multi-connection ID save/load
TabDiskActorTests.swift 2 new tests for connectionIdsWithSavedState
TabPersistenceCoordinatorTests.swift 3 new tests for preview tab filtering

Test plan

  • Set startup to "Reopen Last Session", open 1 connection with multiple tabs, quit, relaunch → all tabs restored
  • Open 2+ connections with tabs, quit, relaunch → all connections and tabs restored
  • Delete a saved connection, relaunch → Welcome screen appears gracefully
  • Set startup to "Show Welcome Screen", quit, relaunch → Welcome screen shows, clicking a connection restores its tabs
  • Verify no Welcome window flash during auto-reconnect

@datlechin
datlechin merged commit c044aa2 into main Apr 13, 2026
1 check passed
@datlechin
datlechin deleted the feat/restore-tabs-on-relaunch branch April 13, 2026 02:28
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.

Restore open tabs after quitting the app

1 participant