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

Refactor preference UI + add 'Commonly Used' section #9439

Conversation

colin-grant-work
Copy link
Contributor

@colin-grant-work colin-grant-work commented May 5, 2021

What it does

Fixes: #9138 by adding a 'Commonly Used' section.
Fixes: #9438

Easily visible changes:
  • Cleans up left-hand-tree:
BeforeAfter
  • Adds 'Commonly Used' section:

image

  • Removes headlines and shows full ID path when filtering
BeforeAfter
- Makes the 'Modified in...' messages clickable - clicking on one will set the search bar to the id of the preference and switch to the named scope.
Less visible changes
  • All React code in the PreferencesEditorWidget replaced with DOM methods.
  • Renderers now @injectable() and able to take advantage of and be instantiated by dependency injection.
  • Various changes to interfaces to make better use of Theia built-ins.
  • Addition of PreferenceTreeLabelProvider to allow for dynamic headline generation.
  • A few changes in other packages
    • Added a DEFAULT_SCROLL_OPTIONS constant to widget.ts. In all cases in which a widget uses scroll options in the framework, they use the same settings, but I haven't converted those to references to DEFAULT_SCROLL_OPTIONS.
    • Added a static .deepEqual() method to the PreferenceProvider class for use in PreferenceProviders and the node renderers in the preferences package.
    • Added a default type JSONValue to the generic on the PreferenceInspection type, since it always will be a JSONValue.

How to test

  1. Use the preferences UI in its various use cases:
  • Set preferences
    • In particular, use string and number inputs, and ensure that there are no jerky interactions with incoming preference change events.
  • Change scopes - make sure the values update and the headlines correctly reflect other modified scopes.
  • Search for particular values - make sure the display is correct and reasonably fast
  • Search and change scopes - make sure that everything that should happen in both scenarios happens when both are active together.
  • Click on a 'Modified in...' message and see that both scope and searchbar are updated.

Review checklist

Reminder for reviewers

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

@colin-grant-work colin-grant-work force-pushed the feature/commonly-used-preferences branch 2 times, most recently from 0c9cd65 to 82b4442 Compare May 5, 2021 20:00
@colin-grant-work colin-grant-work marked this pull request as ready for review May 6, 2021 15:12
@kenneth-marut-work
Copy link
Contributor

I've done a highlevel functionality test and for the most part things seem to be working as expected. The tree format looks much cleaner as well 🌳. Though I've noticed a couple of functionality issues/regressions that I've listed below:

Scrolling in the editor widget results seems to 'skip over' some tree nodes (more than master), this is more obvious when scrolling by dragging the scrollbar
inconsistent-scroll-selection

When expanding filtered results, previously expanded nodes collapse (this is a regression). Also I believe the nodes should be expanded by default (non regression)
collapsing-when-filtering

When selecting a preference that is shared between scopes, changing the scope resets the tree view (this seems to be a regression)
loosing-place-between-scopes

Clicking on the "Features" node in a folder scope shows subheadings with empty contents
image

@colin-grant-work colin-grant-work force-pushed the feature/commonly-used-preferences branch from fb8bac1 to 76e1cb1 Compare May 12, 2021 23:24
this.lastSearchedLiteral = newSearchTerm;
this.lastSearchedFuzzy = newSearchTerm.replace(/\s/g, '');
this._isFiltered = newSearchTerm.length > 2;
this.updateFilteredRows(PreferenceFilterChangeSource.Search);
if (!wasFiltered && this.isFiltered) {
this.expandAll();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes node expansion the default when searching. At the moment, it only occurs when you switch modes unfiltered -> filtered, but it could be applied on every change of the filter, if that's preferable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That feels much nicer. I think having the expansion applied on every change of the filter would be a good addition, seems that VSCode does it that way as well

@colin-grant-work
Copy link
Contributor Author

@kenneth-marut-work, thanks for taking a look. I've addressed the issues you identified, I believe.

@colin-grant-work colin-grant-work added the preferences issues related to preferences label May 26, 2021
@kenneth-marut-work
Copy link
Contributor

kenneth-marut-work commented May 26, 2021

This looks good to me 👌

@colin-grant-work colin-grant-work force-pushed the feature/commonly-used-preferences branch 4 times, most recently from 1875312 to f35c308 Compare May 28, 2021 14:46
@vince-fugnitto vince-fugnitto self-requested a review June 10, 2021 11:55
Signed-off-by: Colin Grant <colin.grant@ericsson.com>
@colin-grant-work colin-grant-work force-pushed the feature/commonly-used-preferences branch from f35c308 to ea5d25a Compare June 10, 2021 14:33
Copy link
Member

@paul-marechal paul-marechal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments, looks great!

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 confirmed the functionality of the changeset 👍

  • the preferences-tree is categorized better, and more organized
  • scrolling, expanding, and collapsing the preferences-tree is responsive and quick
  • scrolling the preferences-editor correctly updates the preferences-tree
  • switching scopes works correctly and is quick
  • clicking the modified in link works correctly
  • support for single and multi-root workspaces works correctly
  • setting preferences works correctly (string, number, enum values)
  • edit in settings.json links work correctly
  • searching for preferences shows the whole path

Signed-off-by: Colin Grant <colin.grant@ericsson.com>
dna2github pushed a commit to dna2fork/theia that referenced this pull request Aug 25, 2021
)

refactor preference ui + add commonly used section
westbury pushed a commit to ARMmbed/theia that referenced this pull request Nov 9, 2021
)

refactor preference ui + add commonly used section
@colin-grant-work colin-grant-work deleted the feature/commonly-used-preferences branch April 14, 2022 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preferences issues related to preferences
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The Preferences UI could use some work "Commonly Used" section in the Preferences
4 participants