-
Notifications
You must be signed in to change notification settings - Fork 162
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
Improve interaction between selected node modal and strain filters #1749
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nextstrain-bot
temporarily deployed
to
auspice-james-selected--faurlc
February 5, 2024 03:52
Inactive
Lifting this from tree state to redux state paves the way to fix inconsistent behaviour as well as allowing the information to be displayed in a modal outside of the Tree component in the future. We no longer update the (tip circle) radius within `clearSelectedNode` as testing (Firefox v121, Chrome v121) shows the `onTipLeave` function is enough to achieve the desired radius update.
With the previous commit creating "selectedNode" as part of redux state, the tree state variable "selectedNode" is only used for hover events, so rename it to convey this.
Clicking a tip brings up a modal and activates the corresponding strain filter. Inactivating or removing this filter now also clears the modal. Closes #1243
Clicking on a tip activates a modal and activates the corresponding strain filter. Previously clearing the modal would always inactivate the filter. In the absence of any filtering this behaviour is not bad, but when already filtering to a set of strains then it's counter-intuitive because we inactivate a filter that was active. The new behaviour restores the filtering state of the strain before the modal was opened. Specifically, * If the tip was already filtered, opening and closing the modal doesn't change the filters. * If the tip was filtered but inactive, opening the modal activates it and closing the modal returns it to the inactive state. * If the tip wasn't filtered (active or inactive) then opening the modal makes it an active filter and closing the modal removes the filter entirely. Closes #1701
jameshadfield
force-pushed
the
james/selected-strain
branch
from
February 6, 2024 01:04
cedd2ac
to
4dcc7d6
Compare
nextstrain-bot
temporarily deployed
to
auspice-james-selected--faurlc
February 6, 2024 01:04
Inactive
Merging after discussion with @trvrb |
jameshadfield
added a commit
that referenced
this pull request
Feb 20, 2024
With the changes in the previous commit we no longer need the `isTerminal` argument, as we use the (more accurate) `isBranch` property. This removes the console errors "trying to remove values from an un-initialised filter!" when shift-clicking on a branch then removing the info modal. The bug was introduced by #1749.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I think the first four commits are reasonably straight forward in terms of code + UI, but the final commit represents my best attempt to fix the situation described in #1701 while still maintaining the expected behaviour when we click on tips without having any strain-filters enabled.
Closes #1701
Closes #1243