-
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
Added Preferences UI widget #7105
Added Preferences UI widget #7105
Conversation
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 your contribution @NicholasStenbeck! 👍
There are unfortunately some build errors at the moment (CI is currently failing) which prevents the project from successfully verifying the functionality of the changes.
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.
Like @vince-fugnitto said, CI is red, and I wasn't able to build NicholasStenbeck:preferences-ui
locally either. Not sure what went wrong.
packages/preferences/src/browser/UI/settings-ui-plus-editor.tsx
Outdated
Show resolved
Hide resolved
packages/preferences/src/browser/UI/settings-ui-plus-editor.tsx
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
Please make a PR as minimal as possible and avoid touching unrelated code, all new code should be aligned with our coding guidelines: https://github.com/eclipse-theia/theia/wiki/Coding-Guidelines Please ping when it is done, i.e. look at naming, styling, theming, check keyboard support, align it as much as possible with existing code based with minimal breaking changes then it would easy to accept it. |
@danieltomasku @NicholasStenbeck if you won’t have time to work on it, please let us know that someone can finish it up. |
Important thing that we should use trees in the implementation if vscode does it, to avoid getting in the same maintenance troubles as we get with scm, i.e. trees will be improved to catch up with vscode and then if some feature is enabled for preference tree in vscode, it should be enabled the same way for Theia. |
115d3e1
to
897152c
Compare
@akosyakov Thanks for the input! I've addressed some issues in the code for an update. Could you elaborate on the comment about using trees? As far as I know, we use pretty much the same method of populating the preferences widget as the current one. I didn't write that part of the package, but @SammyGP might have a better grasp of it. |
I'm not sure how vscode does it behind the curtains but the way we implemented the tree we could make some minor changes to make it more visually aligned with how vscode does it. The way its decoupled from the text view it should be safe to add features to the tree without to much trouble. |
This comment has been minimized.
This comment has been minimized.
packages/preferences/src/browser/ui/settings-ui-plus-widget.tsx
Outdated
Show resolved
Hide resolved
packages/preferences/src/browser/ui/settings-ui-plus-widget.tsx
Outdated
Show resolved
Hide resolved
packages/preferences/src/browser/ui/settings-ui-plus-navbar.tsx
Outdated
Show resolved
Hide resolved
packages/preferences/src/browser/ui/settings-ui-plus-fuzzy-search.ts
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
897152c
to
38b9446
Compare
I have pushed an update trying to address most issues mentioned by @akosyakov. I am planning on looking into removing the unnecessary files under preferences/ and adding a way to open a JSON-file with settings in the code editor from the preferences UI. |
It would be good to have follow-up issues for all points. Regarding context menu, |
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.
Thanks for reverting irrelevant changes ❤️
Please have a look at comments below and #7105 (comment). Only core extension can style global elements, other extension must not.
--theia-settingsSticky-height: 100px; | ||
} | ||
|
||
html, |
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.
please get rid of styles to global element like html and body
packages/preferences/src/browser/views/components/preference-boolean-input.tsx
Outdated
Show resolved
Hide resolved
packages/preferences/src/browser/views/components/preference-string-input.tsx
Outdated
Show resolved
Hide resolved
packages/preferences/src/browser/views/components/single-preference-wrapper.tsx
Outdated
Show resolved
Hide resolved
packages/preferences/src/browser/views/preference-tree-widget.tsx
Outdated
Show resolved
Hide resolved
Many thanks for your comments. We will work to address them. |
Co-authored-by: Nicholas Stenbeck <nicholas.stenbeck@ericsson.com> Co-authored-by: Colin Grant <colin.grant@ericsson.com> Co-authored-by: Kenneth Marut<kenneth.marut@ericsson.com> Signed-off-by: Nicholas Stenbeck <nicholas.stenbeck@ericsson.com> Signed-off-by: Colin Grant <colin.grant@ericsson.com> Signed-off-by: Kenneth Marut <kenneth.marut@ericsson.com>
cf5f150
to
fa9e42c
Compare
We've just pushed another update that has addressed your comments:
The context menu generation for the gear-icon and folder-tab has been refactored to use
Done
We have removed all mentions of
We've extracted all arrow functions into class members where possible. We have used the React hook useCallback in functional components to prevent redeclaration of functions during rerenders.
In Additionally we have looked at the |
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.
It works nicely for me.
I've noticed that the widget state is not preserved on reload like the search input. But It can be fixed as a follow-up issue. It could be also good idea to check whether this widget is not leaking by closing it, opening other widgets, triggering GC, taking a snapshot and checking whether everything related to preference UI is garbage collected.
(options: PreferenceFilterOptions, newScope?: Preference.SelectedScopeDetails) => this.updateUnderlyingData(options, newScope), | ||
200 | ||
); | ||
protected handleSearchChange = debounce((term: string) => this.updateDisplay(term), 100); |
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.
unused?
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.
Yes, this ended up going unused. Instead, the search event fire is debounced. Shall we remove it now before this gets merged?
}] | ||
}] as [string, TreeDecoration.Data]; | ||
})); | ||
if (preferences) { |
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.
what is a guard for? preferences
are always defined
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.
@NicholasStenbeck, I think you introduced this check. Can you shed some light here?
@vince-fugnitto @lmcbout Would you have a look or we wait till tomorrow and merge? |
I can have a look at the moment, we can merge tomorrow anyways and fix any issues/improvements we might encounter during the month. |
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.
The changes look great, it's a very nice improvement over the previous implementation!
I've opened some follow-up issues that we can tackle once the pull-request is merged :)
@vince-fugnitto please merge |
Signed-off-by: Nicholas Stenbeck nicholas.stenbeck@ericsson.com
What it does
This package adds a UI view to Preferences. It is a work in progress and is meant as a reference to get community approval, so that we can continue work in this direction. All feedback is welcome.
Addresses #6985.
Features
How to test
Review checklist
Reminder for reviewers