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 "hide/show other trees" to tree context-menu #6102

Merged
merged 7 commits into from
Mar 10, 2022
Merged

Conversation

hotzenklotz
Copy link
Member

@hotzenklotz hotzenklotz commented Mar 9, 2022

There already is a functionality in webknossos to "Hide all inactive trees", i.e. toggle the visibility of all other trees but the currently selected one. This feature is bound to keyboard hotkey 2.
In this PR, I exposed this functionality through the right-click context menu for each tree/group.

URL of deployed dev instance (used for testing):

  • https://___.webknossos.xyz

Steps to test:

  • Create a skeleton annotation with a few trees and groups.
  • Right-click on a tree/group and select "Hide/Show all other trees"
  • The selected tree/group should now:
    • be selected (blue background behind name)
    • the visibility of all tree/groups should be toggled
  • Right-click again to undo

Issues:

  • no issue

(Please delete unneeded items, merge only when none are left open)

Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

Works mostly well 👍 I think, it's worth an entry in the changelog.

Some observations which are not blocking in my opinion, though:

  • the context menu does not close when using the new item. it's a bit weird, but in line with most of the other items, since the actions are often used in succession (e.g., shuffle the tree color until it's good). so, it can probably stay as is. however, for the context menu on the group item, the behavior is different (it will close directly after using the entry).
  • when using this action on a tree which is invisible, it will be turned visible, but all the other trees won't turn invisible. maybe acceptable, since one can just click again. can be reproduced with this state of trees:

image

@hotzenklotz
Copy link
Member Author

@philippotto Updated the changeling :-)

the context menu does not close when using the new item. it's a bit weird, but in line with most of the other items, since the actions are often used in succession (e.g., shuffle the tree color until it's good). so, it can probably stay as is. however, for the context menu on the group item, the behavior is different (it will close directly after using the entry).

Good catch. I fixed this. Now the context menu closes after clicking on the "Hide/Show" menu entry.

when using this action on a tree which is invisible, it will be turned visible, but all the other trees won't turn invisible. maybe acceptable, since one can just click again. can be reproduced with this state of trees:

Yes, this is odd. But since I am relying on an existing functionality I will not changes that as part of this PR.

@hotzenklotz hotzenklotz enabled auto-merge (squash) March 10, 2022 14:49
Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

Good stuff!

CHANGELOG.unreleased.md Outdated Show resolved Hide resolved
@hotzenklotz hotzenklotz merged commit d874658 into master Mar 10, 2022
@hotzenklotz hotzenklotz deleted the hide_tree_menu branch March 10, 2022 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants