-
Notifications
You must be signed in to change notification settings - Fork 368
One page design for FileSavePicker.SuggestedSaveFilePath
#5538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
One page design for FileSavePicker.SuggestedSaveFilePath
#5538
Conversation
Why have a suggested file instead of folder? What if we want the initial file name to be blank, in case there is no good default name or we want to force the user to choose a name? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Per @benstevens48's question, if SuggestedSaveFile
only points at a folder instead of a file in a folder, will that have the effect of setting the start folder with no default filename? Or is it required to include a suggested filename?
Thanks @codendone for reviewing this design! First, The SuggestedSaveFile of UWP FileSavePicker doesn't accept a StorageFolder object - the compiler would show this error
In the scope of our new APIs, I would strongly recommend the logic of
The input would be largely depends on API consumer, but above logic is concrete - The method itself doesn't decide if the input path is a file path or folder path. This is to reduce the complexity and avoid more undefined behaviors (e.g. should For the questioned scenario, we can add another method in future, to set the suggested folder without file name, e.g. introducing a |
I agree with that design.
This relates to the question "if SuggestedSaveFile only points at a folder instead of a file in a folder, will that have the effect of setting the start folder with no default filename? Or is it required to include a suggested filename?". From the implementation, I believe the current design is if But, as you said, what happens if Splitting out a separate |
Thanks @codendone for raising this point! I also discussed this topic with @yeelam-gordon yesterday, and we concluded the current design could be more beneficial. It's great to know that we have reached consensus on the first case:
The question is the second case:
While it might seem counter-intuitive at first, this behavior is based on a very strict logic. It makes the API's behavior 100% predictable and gives developers clearer control over the code.
|
FileSavePicker.SuggestedSaveFile
FileSavePicker.SuggestedSaveFilePath
…inahK-2SO/spec__FileSavePicker_SuggestedSaveFile
30a0bec
to
a8f42d0
Compare
@jonwis, thank you for reviewing the PR. As we have agreed to use the string attribute SuggestedSaveFilePath
, I am marking your comments as resolved.
/azp run |
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
One page design for
FileSavePicker.SuggestedSaveFilePath
Code implementation: #5547