From 939cedd1f5cbaceb00c9899ae07d1ea3e375f8a3 Mon Sep 17 00:00:00 2001 From: KaranPradhan266 Date: Sat, 13 Dec 2025 14:06:47 -0800 Subject: [PATCH 1/2] [WIP]: Fixing filter button in marker hover panel --- src/components/marker-chart/Canvas.tsx | 1 + src/components/timeline/Markers.tsx | 1 + .../timeline/TrackCustomMarkerGraph.tsx | 1 + src/components/timeline/TrackNetwork.tsx | 1 + src/components/tooltip/Marker.tsx | 38 +++++++++++-------- .../__snapshots__/MenuButtons.test.tsx.snap | 6 +-- .../TrackCustomMarker.test.tsx.snap | 6 --- .../__snapshots__/TrackNetwork.test.tsx.snap | 6 --- 8 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/components/marker-chart/Canvas.tsx b/src/components/marker-chart/Canvas.tsx index ec6544ad32..abdbb60f24 100644 --- a/src/components/marker-chart/Canvas.tsx +++ b/src/components/marker-chart/Canvas.tsx @@ -915,6 +915,7 @@ class MarkerChartCanvasImpl extends React.PureComponent { marker={marker} threadsKey={this.props.threadsKey} restrictHeightWidth={true} + showFilterButton={true} onStackFrameClick={this._onStackFrameClick} /> ); diff --git a/src/components/timeline/Markers.tsx b/src/components/timeline/Markers.tsx index f75f72db74..8dade17a3f 100644 --- a/src/components/timeline/Markers.tsx +++ b/src/components/timeline/Markers.tsx @@ -497,6 +497,7 @@ class TimelineMarkers extends React.PureComponent { marker={hoveredMarker} threadsKey={threadsKey} restrictHeightWidth={true} + showFilterButton={false} /> ) : null} diff --git a/src/components/timeline/TrackCustomMarkerGraph.tsx b/src/components/timeline/TrackCustomMarkerGraph.tsx index db5d254e00..66392abac5 100644 --- a/src/components/timeline/TrackCustomMarkerGraph.tsx +++ b/src/components/timeline/TrackCustomMarkerGraph.tsx @@ -471,6 +471,7 @@ class TrackCustomMarkerGraphImpl extends React.PureComponent { marker={marker} threadsKey={threadIndex} restrictHeightWidth={true} + showFilterButton={false} /> ); diff --git a/src/components/timeline/TrackNetwork.tsx b/src/components/timeline/TrackNetwork.tsx index 04f6ffb664..a591d79266 100644 --- a/src/components/timeline/TrackNetwork.tsx +++ b/src/components/timeline/TrackNetwork.tsx @@ -409,6 +409,7 @@ class Network extends PureComponent { marker={hoveredMarker} threadsKey={threadIndex} restrictHeightWidth={true} + showFilterButton={false} /> ) : null} diff --git a/src/components/tooltip/Marker.tsx b/src/components/tooltip/Marker.tsx index 6e4f824bb1..ab81602c4c 100644 --- a/src/components/tooltip/Marker.tsx +++ b/src/components/tooltip/Marker.tsx @@ -83,6 +83,7 @@ type OwnProps = { readonly marker: Marker; readonly threadsKey: ThreadsKey; readonly className?: string; + readonly showFilterButton?: boolean; // In tooltips it can be awkward for really long and tall things to force // the layout to be huge. This option when set to true will restrict the // height of things like stacks, and the width of long things like URLs. @@ -519,8 +520,13 @@ class MarkerTooltipContents extends React.PureComponent { * a short list of rendering strategies, in the order they appear. */ override render() { - const { className, markerIndex, getMarkerLabel, getMarkerSearchTerm } = - this.props; + const { + className, + markerIndex, + getMarkerLabel, + getMarkerSearchTerm, + showFilterButton = true, + } = this.props; const markerLabel = getMarkerLabel(markerIndex); const searchTerm = getMarkerSearchTerm(markerIndex); return ( @@ -530,19 +536,21 @@ class MarkerTooltipContents extends React.PureComponent { {this._maybeRenderMarkerDuration()}
{markerLabel} - -
diff --git a/src/test/components/__snapshots__/MenuButtons.test.tsx.snap b/src/test/components/__snapshots__/MenuButtons.test.tsx.snap index 944baae3a4..1a03b0ef76 100644 --- a/src/test/components/__snapshots__/MenuButtons.test.tsx.snap +++ b/src/test/components/__snapshots__/MenuButtons.test.tsx.snap @@ -2187,7 +2187,7 @@ exports[`app/MenuButtons matches the snapshot for the menu buttons and class="menuButtonsDownloadSize" > ( - 1.58 kB + 1.59 kB ) @@ -2305,7 +2305,7 @@ exports[`app/MenuButtons matches the snapshot for the opened panel for class="menuButtonsDownloadSize" > ( - 1.56 kB + 1.57 kB ) @@ -2418,7 +2418,7 @@ exports[`app/MenuButtons matches the snapshot for the opened panel for class="menuButtonsDownloadSize" > ( - 1.58 kB + 1.59 kB ) diff --git a/src/test/components/__snapshots__/TrackCustomMarker.test.tsx.snap b/src/test/components/__snapshots__/TrackCustomMarker.test.tsx.snap index ab6fc687f2..3234f9c988 100644 --- a/src/test/components/__snapshots__/TrackCustomMarker.test.tsx.snap +++ b/src/test/components/__snapshots__/TrackCustomMarker.test.tsx.snap @@ -30,12 +30,6 @@ exports[`TrackCustomMarker has a tooltip that matches the snapshot 1`] = ` > Marker -