This feature #3319, demands the Workspace and the Query tool panel to be saved before exiting the application and on restart it will show earlier opened panels.
We are already saving the Browser layout, Query tool layout and the Object explorer tree state but to save the contents of panels we will initially start with the Query tool. The below implementation will be done,
Store the query tool panels and the list of connections present in each query tool panel and the active connection
Store the query that is written in the editor
Store the contents of scratch pad
The main reason that this has never been worked on is that there is no way to restore the state of a connection to what it was and be sure we've got it right. How do you propose to handle that? I assume in a similar way to the warnings we give if a connection has to be re-established?
We will use debouncing to store the workspace data and all other data related to panels in the pgAdmin 4's configured database file. Through debouncing we will be able to call the API at certain intervals of user interaction, and it will update the stored data related to workspace and all other panels.