Skip to content

fix: per metrics view filter params override the legacy singular f param - #9987

Merged
nishantmonu51 merged 2 commits into
mainfrom
nishant/fix-legacy-filter-param-conflict
Oct 5, 2026
Merged

nishantmonu51 merged 2 commits into
mainfrom
nishant/fix-legacy-filter-param-conflict

Conversation

@nishantmonu51

Copy link
Copy Markdown
Collaborator
  • The unified filter bar (refac: unified expression filter component across explore, canvas, alerts and reports #9746) merges every filter param in the URL. When the legacy singular f param and a per metrics view f.<mv> param filter the same dimension with different values, the merge flags the filter as advanced and ANDs both conditions, so the canvas shows a read only Advanced (BETA) BD_Lead IN ('A') AND BD_Lead IN ('B') pill and every component reports zero.
  • normalizeParams now keeps a metrics view's own f.<mv> param and only fills in the singular f for metrics views that lack one, and setUrlParams merges the normalized params. This matches the pre-refactor canvas behaviour, which read f.<mv> and fell back to f only when it was absent.
  • Adds a test that failed before the fix.

Steps to reproduce

  1. Embed a canvas dashboard with two metrics views and pass f=<dim> IN ('A') on the iframe URL.
  2. In the dashboard, change the filter to B. The URL now carries f.<mv1> and f.<mv2>.
  3. Re-apply the host's f=<dim> IN ('A') to the URL alongside them, for example by restoring saved state onto the original iframe URL.
  4. Before: a single Advanced (BETA) pill with <dim> IN ('B') AND <dim> IN ('A') per metrics view, and all components show zero. After: a single <dim> chip set to B.

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

…param

The unified filter bar merged the legacy singular `f` param with the per
metrics view `f.<mv>` params. A dimension filtered with different values
in the two forms was flagged as an advanced filter and both conditions
were ANDed, which matches nothing. Embedded canvas dashboards hit this
when the host passes `f=` and the viewer has since edited the filter.

A metrics view that has its own param now keeps it; the singular param
only seeds the metrics views without one, matching the pre-refactor
behaviour.
Comment thread web-common/src/features/dashboards/filters/ExpressionFilterManager.svelte.ts Outdated
@nishantmonu51
nishantmonu51 merged commit 2bb7c34 into main Oct 5, 2026
10 checks passed
@nishantmonu51
nishantmonu51 deleted the nishant/fix-legacy-filter-param-conflict branch October 5, 2026 14:24
nishantmonu51 added a commit that referenced this pull request Oct 6, 2026
…param (#9987)

* fix: per metrics view filter params override the legacy singular `f` param

The unified filter bar merged the legacy singular `f` param with the per
metrics view `f.<mv>` params. A dimension filtered with different values
in the two forms was flagged as an advanced filter and both conditions
were ANDed, which matches nothing. Embedded canvas dashboards hit this
when the host passes `f=` and the viewer has since edited the filter.

A metrics view that has its own param now keeps it; the singular param
only seeds the metrics views without one, matching the pre-refactor
behaviour.

* Normalize params in the tracker instead of the manager
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants