fix(dashboards): Merge URL filters with saved filters instead of replacing them#109590
Merged
DominikB2014 merged 3 commits intomasterfrom Mar 4, 2026
Conversation
…acing them When navigating to a dashboard via a linked dashboard URL, temporary filters in the URL were completely replacing the destination dashboard's permanent saved filters. Now URL filters are merged with saved filters: overlapping keys are replaced by the URL version, but non-overlapping permanent filters are preserved. Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
Author
|
@cursor review |
edwardgou-sentry
approved these changes
Feb 27, 2026
Contributor
edwardgou-sentry
left a comment
There was a problem hiding this comment.
Code looks fine to me, not sure if the cursor comment is true though?
When a dashboard has both saved filters and URL filters, the filter bar merges them but never propagated the merged state to the URL. This caused widgets to query with only raw URL filters while the filter bar displayed the full merged set. Adding a useEffect on mount syncs the merged filters to the URL so widgets see the same filters as the filter bar.
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
When a user clears all global filters, the URL contains an empty array. The !urlFilters guard didn't catch this since ![] is false in JS, causing saved filters to be incorrectly restored. Added explicit length check to respect the user's "clear all" action.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When navigating to a dashboard via a linked dashboard URL (e.g. by clicking a table cell that links to another dashboard), any temporary filters in the URL were completely replacing the destination dashboard's permanent saved global filters.
The fix merges URL filters with the saved filters: for each URL filter, if a saved filter exists with the same
tag.key + dataset, the URL version takes precedence. Saved filters that don't overlap with any URL filter are preserved as-is.Before: destination dashboard permanent filters
[A, B]+ URL temporary filter[C]→[C]After: destination dashboard permanent filters
[A, B]+ URL temporary filter[C]→[A, B, C]If a temporary filter overlaps with a permanent one (same key/dataset), the temporary filter still wins for that key — only non-overlapping permanent filters are kept.