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

Instant filters for the orthogroup page #1144

Merged
merged 9 commits into from
Aug 2, 2024

Conversation

bobular
Copy link
Member

@bobular bobular commented Jul 19, 2024

Note that this targets orthogroup-tree-table, so can be merged without review.

Maybe we demo both or make a video with both?

@bobular bobular requested a review from dmfalke July 19, 2024 15:02
@dmfalke
Copy link
Member

dmfalke commented Jul 23, 2024

Sorry for the delay. I will take a look at this today or tomorrow

Copy link
Member

@dmfalke dmfalke left a comment

Choose a reason for hiding this comment

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

I think the name of the new prop should be consistent with what we use for the checkbox select component. I'm fine with both being instantUpdate.

Also, I don't think buttonDisplayContent needs to be tracked with React state. I know this was already in place, but would be good to remove all unnecessary state and effects.

Comment on lines 48 to 52
useEffect(() => {
if (instantUpdate) {
onChange(selected);
}
}, [onChange, selected, instantUpdate]);
Copy link
Member

Choose a reason for hiding this comment

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

This should be called in a callback used as the onChange prop of CheckboxList. We don't currently have one defined, so it will be a new callback.

@bobular
Copy link
Member Author

bobular commented Aug 2, 2024

Hi @dmfalke - thanks for the review.

I removed all but one effect thanks to your suggestion. While testing things were still working in EDA/Lineplot I found a new bug (already on qa and presumably prod) which I have a fix for too.

I don't think it's wise to get rid of the local state for buttonDisplayContent . The local state allows us to delay changing the button label until the drop-down is closed, which prevents it moving around as its contents change. I think this is OK.

@dmfalke
Copy link
Member

dmfalke commented Aug 2, 2024

I don't think it's wise to get rid of the local state for buttonDisplayContent . The local state allows us to delay changing the button label until the drop-down is closed, which prevents it moving around as its contents change. I think this is OK.

Makes sense. Thanks for checking!

@bobular bobular merged commit 969db0d into orthogroup-tree-table Aug 2, 2024
1 check passed
@bobular bobular deleted the ortho-instant-filters branch August 2, 2024 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants