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

Add a shortcut to toggle the visibility of private components in the component browser #5582

Merged

Conversation

galin-enso
Copy link
Contributor

@galin-enso galin-enso commented Feb 7, 2023

Pull Request Description

Closes #4962

This PR adds the cmd+alt+p shortcut to toggle the visibility of components with a "PRIVATE" tag in the component browser. The default is to have these private components hidden.

unknown_2023.02.15-18.26.mp4

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 build and ./run ide watch.

galin-enso and others added 30 commits January 25, 2023 13:36
…0' of github.com:enso-org/enso into wip/galin-enso/exclude-private-methods-from-cb-184215360
@galin-enso
Copy link
Contributor Author

On the video, when you are switching modes, the icons on the left of the component browser are blinking - this should not happen. Do you know why it is so now? :)

The navigator buttons glitch should be fixed now.

app/gui/src/controller/ide.rs Outdated Show resolved Hide resolved
app/gui/src/controller/searcher.rs Outdated Show resolved Hide resolved
Comment on lines 358 to 360
searcher_input_on_visibility_toggle <-
model.view.searcher_input_changed.sample(&reloading_action_list_done);
eval searcher_input_on_visibility_toggle ((expr) model.input_changed(expr));
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to reset searcher input in controllers after a reload?

Copy link
Member

Choose a reason for hiding this comment

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

Yup, it looks strange and performance-hurting. Good catch @farmaazon!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After reloading the component list we need to update the filtering. Otherwise, all components will be shown after a toggle, irrespective of them matching the searcher input pattern.

I've refactored this to only call the update_filtering methods and not set a new searcher input, as indeed the searcher input does not change.

Comment on lines 358 to 360
searcher_input_on_visibility_toggle <-
model.view.searcher_input_changed.sample(&reloading_action_list_done);
eval searcher_input_on_visibility_toggle ((expr) model.input_changed(expr));
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to reset searcher input in controllers after a reload?

app/gui/view/src/project.rs Outdated Show resolved Hide resolved
app/gui/src/controller/searcher.rs Outdated Show resolved Hide resolved
app/gui/src/controller/ide/desktop.rs Outdated Show resolved Hide resolved
app/gui/src/controller/ide/desktop.rs Outdated Show resolved Hide resolved
app/gui/src/controller/searcher.rs Outdated Show resolved Hide resolved
Comment on lines 358 to 360
searcher_input_on_visibility_toggle <-
model.view.searcher_input_changed.sample(&reloading_action_list_done);
eval searcher_input_on_visibility_toggle ((expr) model.input_changed(expr));
Copy link
Member

Choose a reason for hiding this comment

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

Yup, it looks strange and performance-hurting. Good catch @farmaazon!

galin-enso and others added 3 commits February 20, 2023 13:04
…15360' of github.com:enso-org/enso into wip/galin-enso/toggle-cb-private-method-visibility-184215360
app/gui/src/controller/ide/desktop.rs Outdated Show resolved Hide resolved
app/gui/src/controller/ide/plain.rs Outdated Show resolved Hide resolved
app/gui/src/presenter/project.rs Outdated Show resolved Hide resolved
app/gui/src/presenter/searcher.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@farmaazon farmaazon left a comment

Choose a reason for hiding this comment

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

QA tried to break this PR, but hasn't succeeded.

Only one UX note: when turning on the debug mode, we see the popup confirming it. We could consider using it for "show private entries" mode as well.

However, I suspect this pop-up will be refactored as part of #5201 so let's do not do this right now.

@galin-enso galin-enso added the CI: Ready to merge This PR is eligible for automatic merge label Feb 20, 2023
@mergify mergify bot merged commit 4f11ad1 into develop Feb 20, 2023
@mergify mergify bot deleted the wip/galin-enso/toggle-cb-private-method-visibility-184215360 branch February 20, 2023 21:24
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
Status: 🟢 Accepted
Development

Successfully merging this pull request may close these issues.

Component Browser should not include PRIVATE entries
3 participants