Skip to content

Conversation

@DominikB2014
Copy link
Contributor

@DominikB2014 DominikB2014 commented Nov 21, 2025

When clicking view span samples on a table, we should also append the globalFilters when we end up in explore
image

There is existing logic to do so already here

// If widgetType is provided, concatenate global filters that apply
if (widgetType && combinedFilters) {
dashboardFilterConditions +=
combinedFilters
.filter(globalFilter => globalFilter.dataset === widgetType)
.map(globalFilter => globalFilter.value)
.join(' ') ?? '';
}

We just had to pass in the widgetType so the widget correctly filters out any non-applicable filters based on the dataset.

@DominikB2014 DominikB2014 requested a review from a team as a code owner November 21, 2025 21:45
@linear
Copy link

linear bot commented Nov 21, 2025

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 21, 2025
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.

Bug: Missing widgetType parameter in multi-query filter application

The applyDashboardFilters call in _getWidgetExploreUrlForMultipleQueries is missing the widget.widgetType parameter. This causes global filters to not be properly filtered by dataset when navigating from widgets with multiple queries, unlike the single-query path which was correctly updated. The function should pass widget.widgetType as the third argument to ensure consistent filter behavior across both code paths.

static/app/views/dashboards/utils/getWidgetExploreUrl.tsx#L364-L365

queries: widget.queries.map(query => ({
chartType: getChartType(widget.displayType),

Fix in Cursor Fix in Web


@DominikB2014
Copy link
Contributor Author

Bug: Missing widgetType parameter in multi-query filter application

The applyDashboardFilters call in _getWidgetExploreUrlForMultipleQueries is missing the widget.widgetType parameter. This causes global filters to not be properly filtered by dataset when navigating from widgets with multiple queries, unlike the single-query path which was correctly updated. The function should pass widget.widgetType as the third argument to ensure consistent filter behavior across both code paths.

static/app/views/dashboards/utils/getWidgetExploreUrl.tsx#L364-L365

queries: widget.queries.map(query => ({
chartType: getChartType(widget.displayType),

Fix in Cursor Fix in Web

I don't think this applies to table queries

@DominikB2014 DominikB2014 merged commit ea9b6a1 into master Nov 25, 2025
51 checks passed
@DominikB2014 DominikB2014 deleted the dominikbuszowiecki/browse-131-append-global-filters-when-clicking-view-samples branch November 25, 2025 14:20
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.

3 participants