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
Add an id to chooseFileSystemEntries for tracking last directory #85
Comments
Interesting ID. I definitely want to explore more around default locations to start a file picker in, and this does seem like a useful API addition in that regard. |
For reference this is basically equivalent to FileOpenPicker.SettingsIdentifier in the Windows UWP platform (which is also used on FileSavePicker and FolderPicker). |
That can have unintended consequences #71 (that still persist). When |
Are they expected to operate independently? The user doesn't care which API is used behind the scenes, and the user would ordinarily expect their last used settings to be remembered. |
Yes. File API is not Native File System API. Neither specification states that the previously selected directory will be "remembered" nor does the specification state how to expressly not "remember" the previously selected folder.
How do you know that? Did you run a study and have empirical evidence to support that claim? Or are you basing the claim on your own pure speculation? Not in this case. The expectation is the exact opposite based on the fact the behaviour is not specified. In this case expect the exact opposite as neither specification states that will occur and further causes |
I haven't done a study or collected empirical evidence, but I have been designing, developing, publishing and maintaining consumer software for about 10 years, and users regularly bring up this type of thing. Hopefully that counts as more than just speculation. I mean, don't you prefer to have software remember where you left things? For example if you always choose a non-default directory, isn't it preferable that the last directory you used is remembered rather than making you navigate to it every time? It's a straightforward bit of UX, and hopefully we don't have to go to the trouble of a full usability study for something like this. (I certainly haven't seen that this is a requirement of the other bits and pieces of spec work I've been involved in). I don't see the harm in simply leaving the default directory unspecified, other than as proposed here, where the last directory for a given id is remembered (probably per-origin too). |
Individual experience is a fact to that person. That does not mean individuals outside the range of your experience have the same expectation.
No. At any given time could be running several unrelated tests of various APIs, workarounds for implementations and specifications, proof-of-concepts, et al. No API should leak data into another API without being explicitly and clearly specified that is the intended output. Instead of being observable as a bug. Have no objection to specifying a directory to open. The browser already "remembers" the directory being opened from a different API. What do have concern about is the opposite requirement: do not "remember" any directory. The two should be specified together, to prevent the issue described that persists. Unless you can point to such language there is no reason why any developer should expect File API |
@AshleyScirra To reproduce the issue am describing run this code https://github.com/guest271314/native-messaging-mkvmerge before clicking "Connect" and "Send" click
then use the URLs embedded in What will occur is the the file system chooser will open the directory the .webm file was selected from, the user then needs to navigate within file manager GUI to the "host" directory, which ultimately results in an exception citing the erroneous message "user activation" being thrown and permission set to |
I think you're conflating two issues:
AFAICT number 2 is the same as issue #89. It can be worked around - you need to get another user gesture. In our PWA we use |
For the record, here's a blog post about |
#261 has a proposal for an API for this, feedback welcome. |
It looks like the proposed |
Yes, that is my proposal at least. |
…related options. (#261) * Add initial explainer for suggestedName, startIn and related options. This describes a proposal for #85, #144, #94 amd #80. Co-authored-by: a-sully <77407429+a-sully@users.noreply.github.com> Co-authored-by: Thomas Steiner <tomac@google.com> SHA: 282dcba Reason: push, by @mkruisselbrink Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This adds the options as described in https://github.com/WICG/file-system-access/blob/main/SuggestedNameAndDir.md. Fixes #85, fixes #144, fixes #94 and fixes #80 Co-authored-by: Austin Sullivan <asully@chromium.org>
…er methods. (#287) This adds the options as described in https://github.com/WICG/file-system-access/blob/main/SuggestedNameAndDir.md. Fixes #85, fixes #144, fixes #94 and fixes #80 Co-authored-by: Austin Sullivan <asully@chromium.org> SHA: 3309115 Reason: push, by @mkruisselbrink Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Often applications will use
chooseFileSystemEntries
for two distinct purposes, such as opening a document, and exporting content in a different format. Typically the user will open a document from one folder (e.g. 'Documents'), and export to another (e.g. the desktop). Similarly they may open different types of content from different locations, or save different types of content to different locations.To improve the user experience, it's useful if
chooseFileSystemEntries
remembers the last folder the user was in. This means if they tend to open files from the same folder (e.g. 'Documents'), the file picker tends to default to the right place.However if
chooseFileSystemEntries
is used for distinct purposes, the browser has no good way of remembering the right folder. For example if an application provides options for 'Save document as...' and 'Export as PDF...', these will both use 'save as' dialogs, with little to distinguish them from the call tochooseFileSystemEntries
. Therefore the browser cannot remember their state separately. The end result is if the user alternates between "save as" and "export", it defaults to the wrong directory, forcing the user to navigate back to the folder they want every time.An easy way to solve this is just to add an arbitrary string "id" to
ChooseFileSystemEntriesOptions
, e.g.:Now the browser can always remember the right default location for each distinct use of
chooseFileSystemEntries
. It could also use the ID to save other state associated with the window.The text was updated successfully, but these errors were encountered: