feat: prefill save-as filename and remember folder#499
Conversation
|
Thank you for the PR. This is not a review yet which might take a bit more time. I'm not sure yet I'm happy with persisting the last used directory beyond the session. Perhaps I'd prefer a save as filename template config/parameter. Although maybe there can be both, as long as the behaviour is intuitive. Please don't do anything just yet, I have to think about this. 😄 If we do go with persisting this, I don't think |
RobertMueller2
left a comment
There was a problem hiding this comment.
I have made up my mind. Let's leave the dir remembering function in.
I'll add a followup issue for an explicit pattern later on, which can be implemented later.
|
Thanks, agreed on all points. I just used in my workflow both fixes so combined them in one PR but separating them will be definitely better. I'll update this PR to:
I'll push the fixes to this branch. |
|
Ok, thanks. I got three final remarks, I think.
|
|
I suppose for the last point one might argue that we don't have such checks elsewhere ;) |
Thanks, addressed these in the latest push. Changes:
|
Agreed, it is defensive, but cheap and reasonable for this tiny state file :) |
|
lgtm, thanks :) |
Closes #462.
This improves the Save As dialog by using the configured
output-filenameas the initial filename/path when available. This lets timestamp patterns such astest-%Y-%m-%d.pngprefill the file chooser name while still allowing the user to edit it before saving.It also remembers the last folder selected via Save As and reuses it as the initial folder next time, falling back to the
output-filenameparent directory when no remembered folder exists.Verification:
cargo fmt --allcargo test save_ascargo checkcargo clippy --all-targets --all-features -- -D warnings