-
Notifications
You must be signed in to change notification settings - Fork 24
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
Enhance tree search functionallity #3878
Enhance tree search functionallity #3878
Conversation
…ance-tree-search-functionallity
@@ -337,21 +346,37 @@ class TreesTabView extends React.PureComponent<Props, State> { | |||
} | |||
}; | |||
|
|||
getAllSubtreeIdsOfGroup = (groupId: number): Array<number> => { |
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.
I just found out that this method is never used so I removed it
@daniel-wer This PR is ready for your review 🙂 |
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.
Awesome, this already feels like a big improvement and the code looks good too!
Some observations, things to do:
- Investigate performance in tracings with many trees (1000+).
- Ideally the shortcut would be disabled if the tree tab is not visible. Do you have an idea how to accomplish that?
- Should the search results be in the "correct" order (same as in the tree tab)? I'm thinking yes, after testing this, but it may be hard to accomplish.
frontend/javascripts/oxalis/view/right-menu/advanced_search_popover.js
Outdated
Show resolved
Hide resolved
frontend/javascripts/oxalis/view/right-menu/advanced_search_popover.js
Outdated
Show resolved
Hide resolved
frontend/javascripts/oxalis/view/right-menu/advanced_search_popover.js
Outdated
Show resolved
Hide resolved
frontend/javascripts/oxalis/view/right-menu/advanced_search_popover.js
Outdated
Show resolved
Hide resolved
frontend/javascripts/oxalis/view/right-menu/advanced_search_popover.js
Outdated
Show resolved
Hide resolved
frontend/javascripts/oxalis/view/right-menu/advanced_search_popover.js
Outdated
Show resolved
Hide resolved
frontend/javascripts/oxalis/view/right-menu/advanced_search_popover.js
Outdated
Show resolved
Hide resolved
frontend/javascripts/oxalis/view/right-menu/advanced_search_popover.js
Outdated
Show resolved
Hide resolved
#3900) * add domVisibilityObserver to conditionally render tree search shortcut * add feature check
const { data, searchKey, provideShortcut, children } = this.props; | ||
const { searchQuery, isVisible } = this.state; | ||
let { currentPosition } = this.state; | ||
currentPosition = currentPosition == null ? -1 : currentPosition; |
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.
const { searchQuery, isVisible } = this.state; | ||
let { currentPosition } = this.state; | ||
currentPosition = currentPosition == null ? -1 : currentPosition; | ||
this.availableOptions = this.getAvailableOptionsFrom(data, searchQuery, searchKey); |
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.
A react render method should be pure and should not have side effects. Easy to fix as the memoization allows us to simply call this.getAvailableOptionsFrom everywhere we need the availableOptions, so we don't need the instance variable :)
I fixed those last two comments (and some very minor stuff) by myself, hope that's alright :) |
@MichaelBuessemeyer I just pushed a commit implementing the sorting of the groups and trees for the advanced search popover. I think the solution is not too complex and works nicely, please have a look and tell me what you think :) |
Thanks for doing that @daniel-wer 👍
I check this version and it works alright. But the behavior is kinda weird: Please check this change for bugs :) |
Looks and works awesome! 👍 |
…bleminds/webknossos into enhance-tree-search-functionallity
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.
I just did a last test, worked perfectly :)
Really good work on this PR! Ready to merge imo 👍
…ture-highlight * 'master' of github.com:scalableminds/webknossos: Hide unreported datasets (#3883) Update puppeteer and refresh screenshots (#3914) only show team names of own organization (#3928) Enable merger mode in skeleton and hybrid tracings (#3619) allow uploading nml for public dataset of different orga (#3929) Always make wheel listeners not passive to allow preventDefault (#3939) Enhance tree search functionallity (#3878) add webknossos-connect to setup (#3913) Update README.md (#3923) Add shortcut to maximize golden layout panes (#3927) Perform bucket picking in web workers and other performance optimizations (#3902) remove alt text for abstract brain loading image (#3930) updated documentation front page (#3917)
This PR changes the search functionality in the trees tab view. It changes the search to a browser-like search where you can cycle through the found results via buttons or via pressing enter. The searched options are the name of the trees and the tree groups and the search should be case insensitive.
URL of deployed dev instance (used for testing):
Steps to test:
Issues:
[ ] Updated migration guide if applicable[ ] Updated documentation if applicable[ ] Adapted wk-connect if datastore API changes[ ] Needs datastore update after deployment