-
Notifications
You must be signed in to change notification settings - Fork 450
[WIP]: Fixing filter button in marker hover panel #5718
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
base: main
Are you sure you want to change the base?
[WIP]: Fixing filter button in marker hover panel #5718
Conversation
|
@canova would love a review when you get a chance. Thanks! |
canova
left a comment
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.
Sorry for the late review. It was pretty busy last week and I could only look at it today. And thanks for the PR!
It makes sense to have this prop and set it in these components. But I think the value of showFilterButton === undefined being interpreted as true is a bit unusual. I would prefer to have a readonly hideFilterButton?: boolean; prop, with its default showFilterButton === undefined meaning false. And then we need to invert the boolean values in the components.
Also, I think it would be good to have some an explicit hideFilterButton={true} here:
| <TooltipMarker |
With a comment on top of it, saying something like this: "Network Chart doesn't have sticky tooltips yet. But we should convert it to false once we implement sticky tooltips for the network chart."
Also I think it would make sense to have a test for this. Could you write a simple test inside src/test/components/Marker.test.tsx assigning true and false values and asserting if we have the button or not?
Thanks for the patience and for the contribution!
| > | ||
| ( | ||
| 1.58 kB | ||
| 1.59 kB |
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.
Interesting, the CI wants to revert these changes. I tried it locally and these test also fail locally in my machine. What does it do in your machine when you run yarn test? You might want to update the dependencies with yarn install and do a yarn test -u to update the snapshots.
0a97b77 to
a8f25cc
Compare
|
@canova No worries at all — and thank you so much for the detailed review, I really appreciate you taking the time to go through this so thoroughly! Your suggestions make a lot of sense. I updated the prop to use a hideFilterButton?: boolean with clearer defaults, add the explicit usage and comment in NetworkChartRow, and also add a small test to cover both true/false cases as suggested. |
Closes: #5704
Tooltip Filter Button Default Behavior
Changes
showFilterButton = trueinsrc/components/tooltip/Marker.tsx.showFilterButton={false}in:src/components/timeline/Markers.tsxsrc/components/timeline/TrackNetwork.tsxsrc/components/timeline/TrackCustomMarkerGraph.tsxsrc/components/marker-chart/Canvas.tsx.Tests
src/test/components/__snapshots__/TrackCustomMarker.test.tsx.snapsrc/test/components/__snapshots__/TrackNetwork.test.tsx.snapsrc/test/components/__snapshots__/MenuButtons.test.tsx.snap