Skip to content
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

Merged

Conversation

colin-grant-work
Copy link
Contributor

@colin-grant-work colin-grant-work commented Jun 22, 2020

Signed-off-by: Colin Grant colin.grant@ericsson.com

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

  1. Build with this code and start Theia in a browser
  2. Open the File menu -> Open Workspace file dialog.
  3. At the bottom of the file dialog, select various filter options.
  4. Observe that none of them throw an error.

Review checklist

Reminder for reviewers

@akosyakov akosyakov added file dialog issues related to the file dialog filesystem issues related to the filesystem labels Jun 23, 2020
Copy link
Member

@vince-fugnitto vince-fugnitto left a 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:

  1. I was unable to reproduce the issue on master with the steps provided, is there something I might be missing (I used open workspace).
  2. I think that including all files is a bug we currently have, for example for open workspace only the two other filters should be applied, we cannot open any arbitrary file (all file) as a workspace anyways

@vince-fugnitto
Copy link
Member

@colin-grant-work just a few general comments:

I don't think the 2nd comment is necessarily part of this pull-request, the bug exists in master, we should not show all files for open workspace. I'll open a bug for it.

@colin-grant-work
Copy link
Contributor Author

@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.

@colin-grant-work
Copy link
Contributor Author

colin-grant-work commented Jun 23, 2020

@colin-grant-work just a few general comments:

  1. I was unable to reproduce the issue on master with the steps provided, is there something I might be missing (I used open workspace).

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.

@vince-fugnitto
Copy link
Member

@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.

I think the best thing would be to update the props to be able to include control the behavior since it's likely that only the open workspace and save workspace as dialog will need to be updated (so the prop can be on by default).

@colin-grant-work
Copy link
Contributor Author

@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 master even in the browser.

Copy link
Member

@vince-fugnitto vince-fugnitto left a 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.

Signed-off-by: Colin Grant <colin.grant@ericsson.com>
Copy link
Member

@vince-fugnitto vince-fugnitto left a 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).

@vince-fugnitto
Copy link
Member

I'll merge tomorrow if there no objections :)

@vince-fugnitto vince-fugnitto merged commit 4c2af31 into eclipse-theia:master Jun 24, 2020
@colin-grant-work colin-grant-work deleted the bugfix/all-files-filter branch April 29, 2021 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
file dialog issues related to the file dialog filesystem issues related to the filesystem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

All Files filter option throws error
3 participants