Skip to content

Conversation

@KaranPradhan266
Copy link
Contributor

Closes: #5704

Tooltip Filter Button Default Behavior

Changes

  • The tooltip filter button now defaults to visible by setting showFilterButton = true in
    src/components/tooltip/Marker.tsx.
  • Timeline tooltips explicitly opt out of the filter button by passing
    showFilterButton={false} in:
    • src/components/timeline/Markers.tsx
    • src/components/timeline/TrackNetwork.tsx
    • src/components/timeline/TrackCustomMarkerGraph.tsx
  • Marker charts continue to display the filter button via the existing prop in
    src/components/marker-chart/Canvas.tsx.

Tests

  • Updated Jest snapshots to reflect the new tooltip behavior and minor download-size text changes:
    • src/test/components/__snapshots__/TrackCustomMarker.test.tsx.snap
    • src/test/components/__snapshots__/TrackNetwork.test.tsx.snap
    • src/test/components/__snapshots__/MenuButtons.test.tsx.snap

@KaranPradhan266
Copy link
Contributor Author

@canova would love a review when you get a chance. Thanks!

@canova canova self-requested a review December 23, 2025 13:25
Copy link
Member

@canova canova left a 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:


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
Copy link
Member

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.

@KaranPradhan266 KaranPradhan266 force-pushed the bug/fixing-filter-button-in-marker-hover-panel branch from 0a97b77 to a8f25cc Compare December 25, 2025 23:38
@KaranPradhan266
Copy link
Contributor Author

@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.

@codecov
Copy link

codecov bot commented Jan 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.64%. Comparing base (1a808fe) to head (179c38b).
⚠️ Report is 37 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5718   +/-   ##
=======================================
  Coverage   85.64%   85.64%           
=======================================
  Files         313      313           
  Lines       31013    31016    +3     
  Branches     8535     8538    +3     
=======================================
+ Hits        26562    26565    +3     
  Misses       4021     4021           
  Partials      430      430           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@canova canova left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, looks great to me!

I'll remove the WIP from the title and land it.

Comment on lines +167 to +169
beforeEach(() => {
(compress as any).mockResolvedValue(new Uint8Array(FIXED_GZIP_BYTES));
});
Copy link
Member

Choose a reason for hiding this comment

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

Good idea, thanks!

@canova canova changed the title [WIP]: Fixing filter button in marker hover panel Fixing filter button in marker hover panel Jan 7, 2026
@canova canova enabled auto-merge (squash) January 7, 2026 13:37
@canova canova merged commit b651afc into firefox-devtools:main Jan 7, 2026
19 checks passed
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.

Filter button in the marker hover panel isn't useful when hovering over the marker when displayed in a track

2 participants