Skip to content

Conversation

@narsaynorath
Copy link
Member

Converts the widget viewer modal to render with the new visualization timeseries widgets. I just prompted cursor for this and it passes all of the existing tests (minus where I had to update some mock values because we handle empty data differently) and I think the implementation is pretty minimal to get the widget viewer modal to work.

@narsaynorath narsaynorath requested a review from a team as a code owner January 5, 2026 22:20
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jan 5, 2026
Comment on lines +667 to +699
(() => {
const plottables = transformLegacySeriesToPlottables(
seriesData,
seriesResultsType,
widget
);

if (plottables.length === 0) {
return null;
}

return (
<TimeSeriesWidgetVisualization
plottables={plottables}
releases={releases}
showReleaseAs="bubble"
onZoom={(_event, chart) => {
onZoom(_event, chart);
setChartUnmodified(false);
}}
onLegendSelectionChange={selected => {
widgetLegendState.setWidgetSelectionState(selected, widget);
trackAnalytics('dashboards_views.widget_viewer.toggle_legend', {
organization,
widget_type: widget.widgetType ?? WidgetType.DISCOVER,
display_type: widget.displayType,
});
}}
legendSelection={widgetLegendState.getWidgetSelectionState(widget)}
pageFilters={modalSelection}
/>
);
})()
Copy link
Member Author

Choose a reason for hiding this comment

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

This IIFE is kind of gross, should I pull it out into an actual component? 😅

The widget viewer has this pattern of:
A: I have memoized data, I'll just render the chart without the querying components
B: I don't have data, so I'll render "higher" up the component tree to get the querying

@narsaynorath
Copy link
Member Author

Drafting this for now, I think there might be regressions in the confidence footers for spans widgets if I do this.

@narsaynorath narsaynorath marked this pull request as draft January 5, 2026 22:31
renderErrorMessage={errorMessage =>
errorMessage ? <div>{errorMessage}</div> : null
}
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Zoom in fresh data path causes data-axis mismatch

When using the fresh data path with VisualizationWidget, zooming causes a mismatch between the chart's x-axis and the displayed data. The VisualizationWidget doesn't pass pageFilters or onZoom to the inner TimeSeriesWidgetVisualization, so when the user zooms, the default behavior updates the URL with the new date range. However, VisualizationWidget continues to fetch data using modalSelection (which isn't updated by URL changes - only by the onZoom callback or browser back navigation). The result is that after zooming, TimeSeriesWidgetVisualization reads the new date range from usePageFilters() for its x-axis, but displays data that was fetched for the old date range.

Fix in Cursor Fix in Web

@getsantry
Copy link
Contributor

getsantry bot commented Jan 27, 2026

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry bot added the Stale label Jan 27, 2026
@github-actions github-actions bot locked and limited conversation to collaborators Feb 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant