Skip to content

feat(heatmaps): disable heat maps selection for equations#117334

Merged
nikkikapadia merged 2 commits into
masterfrom
nikki/fix/remove-heat-maps-for-equations
Jun 12, 2026
Merged

feat(heatmaps): disable heat maps selection for equations#117334
nikkikapadia merged 2 commits into
masterfrom
nikki/fix/remove-heat-maps-for-equations

Conversation

@nikkikapadia

Copy link
Copy Markdown
Member

contributes to DAIN-1682

right now we don't have proper heat maps support for equations. It might get added later idk but we're disabling the option for now. Also let me know if it's cleaner to just not have the Heap Map option instead of disabling it.

image

@linear-code

linear-code Bot commented Jun 10, 2026

Copy link
Copy Markdown

DAIN-1682

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jun 10, 2026
@nikkikapadia nikkikapadia marked this pull request as ready for review June 11, 2026 18:01
@nikkikapadia nikkikapadia requested a review from a team as a code owner June 11, 2026 18:01
Comment on lines 254 to 260
)}
value={visualize.chartType}
menuTitle="Type"
options={getMetricsChartTypeOptions(organization)}
options={getMetricsChartTypeOptions(organization, isVisualizeEquation(visualize))}
onChange={option => handleChartTypeChange(option.value)}
/>
<CompactSelect

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: An equation with chartType: HEATMAP loaded from a URL will attempt to render an unsupported heatmap component, causing an error.
Severity: MEDIUM

Suggested Fix

Add a validation check when loading a VisualizeEquation. If the chartType is HEATMAP, reset it to a default supported chart type. Alternatively, add a guard in the rendering logic within MetricPanel to prevent MetricsHeatMap from being rendered if the metric is an equation, falling back to a supported chart like MetricsGraph.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: static/app/views/explore/metrics/metricPanel/index.tsx#L254-L260

Potential issue: The pull request disables the heatmap chart type option in the UI for
metric equations. However, it does not prevent an equation from being loaded with
`chartType: HEATMAP` if this state is persisted in the URL. When such a URL is loaded,
the `MetricPanel` component will attempt to render a `MetricsHeatMap` for the equation.
This is an unsupported state, which will cause the `heatmapApiOptions` to be enabled and
trigger an API request with an equation expression, leading to an error. The application
should validate the chart type for equations upon loading to prevent this state.

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it's probably fine for now. Not a huge issue since the api errors out but let's see how many people run into this issue

@nikkikapadia nikkikapadia requested a review from gggritso June 11, 2026 19:16
@nikkikapadia nikkikapadia merged commit 938b0fd into master Jun 12, 2026
77 of 79 checks passed
@nikkikapadia nikkikapadia deleted the nikki/fix/remove-heat-maps-for-equations branch June 12, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants