You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remember the last used folder per file dialog purpose, rather than one folder globally #10381
PR #10327 makes the desktop runtime remember the last directory a native file dialog visited, so that dialogs stop reopening in Downloads after the Electron 38 change removed the implicit behaviour. It keeps a single lastVisitedDirectory key in the runtime config store, written by both the open and the save handlers, which means Backup, Restore, ERD saves, the storage manager and everything else share one remembered folder: save an ERD somewhere and the next backup starts in the same place.
It would be nicer to remember a folder per purpose, so that backups keep returning to wherever backups go whilst ERD saves keep returning to wherever diagrams go, rather than each dialog inheriting whatever the previous one happened to touch.
Describe alternatives you've considered
Leaving it as one global folder, which is what #10327 does and what most people may well want, since it already fixes the reported problem and needs no per-caller changes.
The extension looks straightforward rather than a rework, because every native dialog funnels through FileManagerModule.showNative() in web/pgadmin/misc/file_manager/static/js/FileManagerModule.jsx: a context key could be passed through window.electronUI.showSaveDialog/showOpenDialog and the preload shims in runtime/src/js/pgadmin_preload.js, and the store keyed per context, falling back to the current global value whenever a context has nothing saved yet.
The part that needs the work is the callers. params currently carries only dialog_type, which is one of create_file, open_file, select_file or select_folder, and that describes the shape of the dialog rather than what it is for, so each call site would have to start passing a purpose of its own before there is anything to key on.
Hi @dpage, I'd like to pick this up. I'm going with your sketch: pass a purpose key from each caller through FileManagerModule.showNative() and the preload shims, keep a per-purpose map next to lastVisitedDirectory in the runtime config store, and fall back to the global folder when a purpose has nothing saved. I'm planning to have Restore share the backup key so it opens where backups were saved. Happy to split them if you'd rather keep them separate.
Activity
shuseng8 commentedon Nov 25, 2026
Hi @dpage, I'd like to pick this up. I'm going with your sketch: pass a purpose key from each caller through
FileManagerModule.showNative()and the preload shims, keep a per-purpose map next tolastVisitedDirectoryin the runtime config store, and fall back to the global folder when a purpose has nothing saved. I'm planning to have Restore share thebackupkey so it opens where backups were saved. Happy to split them if you'd rather keep them separate.Remember the last used folder per purpose in Desktop file dialogs. #1…
dpage commentedon Nov 27, 2026
Fixed in #10835.