ref(dashboards): Use a render prop for heat map tooltip actions#118107
Open
gggritso wants to merge 4 commits into
Open
ref(dashboards): Use a render prop for heat map tooltip actions#118107gggritso wants to merge 4 commits into
gggritso wants to merge 4 commits into
Conversation
Replace HeatMapWidgetVisualization's makeExploreUrl callback with a renderTooltipActions render prop. The visualization now hands the caller the hovered cell's value-range query and time-narrowed selection and lets the caller render its own tooltip action rows, so it no longer needs to know about metrics or Explore URLs. Explore's metric panel builds the same "View connected spans" / "Add to filter" links via the render prop — behavior is unchanged. Split out of the heat map dashboard widget work, which needs this seam so the dashboards caller can build its own tooltip actions. Refs DAIN-1654 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Story previewsPreview the stories changed in this PR on the Vercel deployment: Preview deployment: https://sentry-li1dsqu5q.sentry.dev |
Replace updateLocalFilterQuery with a generic tooltipActionHandlers map (button id -> handler). Tooltip buttons carry data-tooltip-action / data-tooltip-action-value; the visualization dispatches a click to the matching handler. Navigation links keep using data-traces-link. Explore's 'Add to filter' registers under the map. Refs DAIN-1654
HeatMapTooltipContext exposes the hovered cell's raw bounds (valueMin, valueMax, timestampStart, timestampEnd) instead of a prebuilt value-range query + narrowed selection. The caller turns those into whatever it needs; the visualization no longer knows about metric query syntax or page filters for the tooltip. Refs DAIN-1654
This file contains hidden or 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
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.
Replace
HeatMapWidgetVisualization'smakeExploreUrlcallback prop with arenderTooltipActionsrender prop. Instead of building the cell tooltip's "View connected spans" / "Add to filter" links itself, the visualization now hands the caller the hovered cell's value-range query and time-narrowed selection and lets the caller render its own tooltip action rows. The visualization no longer needs to know about metrics or Explore URLs.This makes it a lot easier to adapt this to Dashboards, because now the visualization doesn't need any external information, but it can still do things like route to Explore URLs without having to know the specifics of what the query is, for example.
This is behavior-preserving for Explore: its metric panel (
metricsHeatMap.tsx) builds the same two links via the render prop, so the rendered tooltip is unchanged.Refs DAIN-1654