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

Virtual Component Groups filtered by completion IDs #3570

Merged
merged 63 commits into from
Jul 22, 2022

Conversation

akavel
Copy link
Contributor

@akavel akavel commented Jul 7, 2022

Pull Request Description

Filter the Virtual Component Groups (a.k.a. "Favorites Data Science Tools") in the component::List (a.k.a. Hierarchical Action List) to only contain components with IDs listed in the Engine's response to a search/completion request.

This completes the "Virtual Component Groups filtered by input type" task (linked below) because the Engine's response to a search/completion request contains IDs of components filtered by input node type and this type.

https://www.pivotaltracker.com/story/show/182661634

Visuals

See below for a video showing the list of Favorites filtered by the type of the input node. Please note that the video also displays a few known issues that are present in the existing code and not introduced by this PR:

  • "Opening the Component Browser 2nd or later time flashes its last contents from the previous time" - reported as issue 15 in PR 3530.
  • The text of all the entries in the Component Browser does not show immediately, but the entries appear one by one instead (this is related to the performance of the current implementation of Component Browser and Text Area).
Screen.Recording.2022-07-14.at.16.01.32.mov

A screenshot showing the default, unfiltered list of Favorites when no input node is selected:

Screenshot 2022-07-14 at 15 58 26

Important Notes

Checklist

Please include the following checklist in your PR:

  • The documentation has been updated if necessary.
  • All code conforms to the
    Scala,
    Java,
    and
    Rust
    style guides.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed: Enso GUI was tested when built using BOTH
      ./run ide dist and ./run ide watch.

[ci no changelog needed]

@akavel akavel changed the title Virtual Component Groups filtered by input type Virtual Component Groups filtered by completion IDs Jul 7, 2022
@akavel akavel marked this pull request as ready for review July 11, 2022 09:12
Comment on lines 69 to 71
/// IDs passed as arguments to the [`extend`] method and present in
/// [`model::SuggestionDatabase`].
ids_passed_to_extend: HashSet<component::Id>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Add info why we collect such IDs.

Comment on lines 171 to 177
/// Build the list, sorting all group lists and groups' contents appropriately. Filter the
/// [`component::List::favorites`] (only components with IDs passed to [`extend`] are
/// retained), do not sort them.
///
/// If a component group in favorites is empty after the filtering, the empty group is
/// retained. This allows layoing out the favorites in [Component
/// Browser](crate::controller::Searcher) in the same columns regardless of filtering.
Copy link
Contributor

Choose a reason for hiding this comment

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

The information that only those favorites will be kept which have IDs among those passed to extend shall be added to the set_favorites method.

And I miss a description why the builder behaves this way. There should be a "usage scenario" in the docs of the builder::List struct: that we create a list, set favorites structure, extend with IDs matching return/self type and get list with properly filtered groups.

@akavel akavel requested a review from wdanilo July 20, 2022 14:44
Copy link
Contributor

@vitvakatu vitvakatu left a comment

Choose a reason for hiding this comment

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

QA Acceptance passed

@vitvakatu vitvakatu added the CI: Ready to merge This PR is eligible for automatic merge label Jul 21, 2022
@mergify mergify bot merged commit 5b4aac0 into develop Jul 22, 2022
@mergify mergify bot deleted the wip/akavel/filter-favs-by-this-182661634 branch July 22, 2022 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants