Skip to content

feat(tracemetrics): Disable Save As for equations#113089

Merged
narsaynorath merged 2 commits intomasterfrom
nar/feat/tracemetrics-disable-save-as-for-equations
Apr 15, 2026
Merged

feat(tracemetrics): Disable Save As for equations#113089
narsaynorath merged 2 commits intomasterfrom
nar/feat/tracemetrics-disable-save-as-for-equations

Conversation

@narsaynorath
Copy link
Copy Markdown
Member

Adds a tooltip and disables the button for the equation. Also filters it out from "All Metrics"

Adds a tooltip and disables the button for the equation. Also filters it out
from "All Metrics"
@narsaynorath narsaynorath requested a review from a team as a code owner April 15, 2026 19:05
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 15, 2026
Comment thread static/app/views/explore/metrics/useSaveAsMetricItems.tsx
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 542cd44. Configure here.

const visualize = metricQuery.queryParams.visualizes[0]!;
return {
key: `add-to-dashboard-${index}`,
label: `${metricQuery.label ?? getVisualizeLabel(index, isVisualizeEquation(metricQuery.queryParams.visualizes[0]!))}: ${
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.

"All Metrics" silently no-ops when all queries are equations

Medium Severity

The "All Metrics" submenu option appears whenever metricQueries.length > 1, but the onAction handler filters out all equations before calling addToDashboard. If every query is an equation, the filter produces an empty array, and addToDashboard silently returns with no user feedback. The option remains visible and enabled despite being a no-op, which is inconsistent with the individual equation items being properly disabled with tooltips.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 542cd44. Configure here.

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.

Not an issue. You can't remove the last metric.

Comment thread static/app/views/explore/metrics/useSaveAsMetricItems.tsx Outdated
Thought it was necessary, double checked that it was not
@narsaynorath narsaynorath merged commit 6202a68 into master Apr 15, 2026
65 checks passed
@narsaynorath narsaynorath deleted the nar/feat/tracemetrics-disable-save-as-for-equations branch April 15, 2026 19:48
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