Skip to content

ref(dashboards): Use VisualizationWidget in fullscreen widget viewer#110765

Merged
DominikB2014 merged 2 commits intomasterfrom
dominikbuszowiecki/dain-1258-use-timeserieswidgetvisualization-in-widget-viewer
Mar 16, 2026
Merged

ref(dashboards): Use VisualizationWidget in fullscreen widget viewer#110765
DominikB2014 merged 2 commits intomasterfrom
dominikbuszowiecki/dain-1258-use-timeserieswidgetvisualization-in-widget-viewer

Conversation

@DominikB2014
Copy link
Contributor

Use VisualizationWidget (backed by TimeSeriesWidgetVisualization) in
the fullscreen data widget viewer modal for time series widgets (LINE,
AREA, BAR), aligning it with the dashboard card rendering path.

Previously the modal always used WidgetCardChartContainer which renders
via the older ECharts chart components in chart.tsx. This is a step
toward eventually removing the time series rendering code from
WidgetCardChartContainer/chart.tsx.

To support this, VisualizationWidget gains three new props that are
forwarded to TimeSeriesWidgetVisualization:

  • onZoom — zoom callback for the modal's custom zoom-to-selection behavior
  • legendSelection — controlled legend selection state
  • onLegendSelectionChange — legend toggle callback

Non-time-series widgets (TABLE, BIG_NUMBER, TEXT, etc.) still fall back
to WidgetCardChartContainer.

Refs DAIN-1258

Add onZoom, legendSelection, and onLegendSelectionChange props to
VisualizationWidget and forward them to TimeSeriesWidgetVisualization.

Update the data widget viewer modal to render VisualizationWidget for
time series widgets instead of always using WidgetCardChartContainer.
This aligns the fullscreen view with the dashboard card rendering path,
using the newer TimeSeriesWidgetVisualization for LINE, AREA, and BAR
display types.

Non-time-series widgets (TABLE, BIG_NUMBER, etc.) still fall back to
WidgetCardChartContainer.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@linear-code
Copy link

linear-code bot commented Mar 16, 2026

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 16, 2026
@DominikB2014
Copy link
Contributor Author

@sentry review

@DominikB2014
Copy link
Contributor Author

@cursor review

@DominikB2014 DominikB2014 marked this pull request as ready for review March 16, 2026 19:17
@DominikB2014 DominikB2014 requested a review from a team as a code owner March 16, 2026 19:17
Copy link
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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

… in modal

WidgetLegendSelectionState encodes series names with a widget ID delimiter
that TimeSeriesWidgetVisualization does not understand, causing legend
toggling to update the URL instead of hiding series. Let the widget
manage its own local legend state instead.

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
Copy link
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 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Legend state props not passed to VisualizationWidget
    • The fullscreen modal now passes both legend selection state and a legend-selection callback into VisualizationWidget, preserving legend toggles and existing analytics tracking.

Create PR

Or push these changes by commenting:

@cursor push 05fd143b26
Preview (05fd143b26)
diff --git a/static/app/components/modals/dataWidgetViewerModal.tsx b/static/app/components/modals/dataWidgetViewerModal.tsx
--- a/static/app/components/modals/dataWidgetViewerModal.tsx
+++ b/static/app/components/modals/dataWidgetViewerModal.tsx
@@ -631,6 +631,10 @@
                 widget={primaryWidget}
                 tableItemLimit={widget.limit}
                 onZoom={onZoom}
+                legendSelection={widgetLegendState.getWidgetSelectionState(widget)}
+                onLegendSelectionChange={nextLegendSelection =>
+                  onLegendSelectChanged({selected: nextLegendSelection})
+                }
                 showConfidenceWarning={
                   widget.widgetType === WidgetType.SPANS ||
                   widget.widgetType === WidgetType.TRACEMETRICS ||

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

@DominikB2014 DominikB2014 merged commit 275139e into master Mar 16, 2026
63 checks passed
@DominikB2014 DominikB2014 deleted the dominikbuszowiecki/dain-1258-use-timeserieswidgetvisualization-in-widget-viewer branch March 16, 2026 20:01
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