Skip to content

Persist and restore app state across quit/relaunch (session restore) #1673

Closed

Description

@datlechin

Summary

Remember the app's last state when it quits, and restore that state on next launch, the same way TablePlus does.

Motivation

Today, quitting the app loses the working context. Users have to manually reopen connections, tabs, and re-establish where they left off. TablePlus restores the previous session automatically, which keeps work uninterrupted across restarts.

Expected behavior

On quit, persist the session state. On next launch, restore it so the user picks up where they left off:

  • Open windows and their tabs (editor tabs, table/data tabs, create-table tabs)
  • Active connection(s) and selected database/schema
  • Per-tab content: editor query text, scroll/cursor position
  • Applied filters, sorting, and pagination state on data tabs
  • Selected/active tab per window and window layout where practical

Notes

  • Native macOS state restoration (NSWindow restoration / NSWindowRestoration) should be considered alongside the existing TabPersistenceService / TabStateStorage so we reuse what's already there rather than build a parallel path.
  • Respect existing truncation limits (queries > 500KB are already truncated in tab persistence).
  • Should behave gracefully when a previously-open connection is no longer reachable on relaunch.

Reference: TablePlus session restore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions