-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Ensure 'All Files' key present in File Dialog Filters #8073
Ensure 'All Files' key present in File Dialog Filters #8073
Conversation
packages/filesystem/src/browser/file-dialog/file-dialog-tree-filters-renderer.tsx
Show resolved
Hide resolved
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.
@colin-grant-work just a few general comments:
- I was unable to reproduce the issue on
master
with the steps provided, is there something I might be missing (I usedopen workspace
). - I think that including
all files
is a bug we currently have, for example foropen workspace
only the two other filters should be applied, we cannot open any arbitrary file (all file) as a workspace anyways
I don't think the 2nd comment is necessarily part of this pull-request, the bug exists in |
@vince-fugnitto, do you think it's a problem in general to include a default 'All Files' option? If you think that it shouldn't be included by default in any filtered file dialog, it can easily be removed as part of this PR - it makes it even simpler :) - but if you think it should be included in some file dialogues but not that particular one, then it's a bit more complicated. |
Re: reproduction, it may only occur in the browser. Electron seems to use the native file dialogues at least some of the time, and I don't see the error in that case, but I see it consistently in the browser, which uses the Theia renderer. I've updated the reproduction steps here and in the issue to reflect that. |
I think the best thing would be to update the |
@vince-fugnitto, yes, it seems like changing that behavior of the file dialogue would go beyond just fixing the present error. Let me know if you're still unable to reproduce the error on |
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.
I verified that the changes work correctly for different types of dialogs (namely open workspace
and save workspace as
have the correct filters applied), and no error was thrown. I also verified the behavior on electron as a sanity check. I have a small suggestion.
packages/filesystem/src/browser/file-dialog/file-dialog-tree-filters-renderer.tsx
Show resolved
Hide resolved
Signed-off-by: Colin Grant <[email protected]>
a6ced80
to
f8b67c8
Compare
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.
Thank you for the changes @colin-grant-work!
I verified them again and they work very well (no more errors thrown).
I'll merge tomorrow if there no objections :) |
Signed-off-by: Colin Grant [email protected]
What it does
Fixes #8072 by ensuring that a properly formatted 'All Files' key will be present in the filter object. Formerly, 'All Files' was added to an array containing the keys of the filter object, but there was no guarantee that the filter object itself would have an entry corresponding to that value.
How to test
Review checklist
Reminder for reviewers