I'm not sure that this is the proper place to post this, but it's as close as I can come, so here it is. Sorry if I'm out of line.
Anyway, the project I'm working on, Question Bank Creator, uses a file dialog to access the file system. The way the program is currently set up is to open the dialog to the last directory used and let the user navigate wherever he/she wishes. Sometimes that works and sometimes it doesn't and it's something I need to spend some time fixing. However, before I do that I need to decide if using default directories for whatever type of file is being saved would be a better way to go. (In this case there are three basic types of file: question banks, variables, and lists. So, if I decide to use default directories, then when a user is saving a variable, the dialog would automatically open to the default variable directory.) Both methods have their pros and cons. The real question is what do users prefer? Is there a general consensus for which method is best. I'd love to hear your thoughts.
BTW, I'd love to have you visit my repository, just keep in mind that it isn't even in usable format yet. Lots and lots and lots of work still to be done.
Personally, when using an app, I like to be able to configure the default directory and use the home directory if no one is configures. This is the approach I'll suggest: let the user optionally define default directories for different kind of files, and use the home directory if no one is configured.
Most recent makes sense within a session, but not necessarily between sessions.
But more important is to not store such state in config files, but in state files. This makes a difference to those of us who manage out config files in git and don't want to see tons of irrelevant changes. On Linux and Unix you should follow XDG Base Directory Specification. Mac and Windows have similar standards. There are crates for this: Directories — Rust filesystem library // Lib.rs in particular is pretty good.
I've seen it be a config option to pick whether it remembers, but it's pretty unusual. Another is that you can configure what the default directory is, that one I find a lot more useful than remembering the last directory I used.
I would say if you have a "project" concept, then I would recommend a "recent projects" list and a per-project last used path, but really questions like this can only really be answered by having people use it and seeing what annoys them: this is basically user experience design, it's own whole field.
Thanks, all, for your input. That has helped me think this issue through. Taking your input into account, here is what I've come up with:
I'm a big believer in user choice whenever possible, so the plan is to eventually include a user-editable config file that will be loaded at program startup. The config file will include the user's choices for directories where their work will be stored and, hopefully, allow for all the above-discussed suggestions to be user-determined. I'm not ready to set up a config file yet. The program needs much, much more development before that should happen. In the meantime I'm going to make sure my 'last used directory' is actually implemented right and, at the same time, default, when necessary, to the default directories currently contained in global constants.
I would suggest using a crate like rfd to use the system file picker rather than trying to re-implement your own file picker. This way it follows platform conventions with regards to using the latest directory vs a default directory and other things and in addition it works inside sandboxes like flatpak or the macOS app sandbox.