Skip to content

fix: advanced filters could not be cleared from the filter bar - #9989

Merged
nishantmonu51 merged 1 commit into
mainfrom
nishant/fix-clear-advanced-filter
Oct 7, 2026
Merged

nishantmonu51 merged 1 commit into
mainfrom
nishant/fix-clear-advanced-filter

Conversation

@nishantmonu51

Copy link
Copy Markdown
Collaborator

A filter the chips cannot represent (a top level OR, an operator without a chip mode, or the same dimension filtered twice) left the filter bar with only the read-only "Advanced (BETA)" pill and no way to remove it. Regression from #9746, where the "Clear filters" button moved inside the chip branch.

  • ExpressionFilters.svelte: "Clear filters" renders for an advanced filter too. It is gated on isComplexFilter rather than on the pill, since a param the chips cannot show may parse to no pill at all. The Add filter button stays hidden while the pill is shown.
  • AdvancedFilter.svelte: migrated to runes and given an optional onRemove, rendered as a remove button next to the pill. The filter bar and the canvas inspector pass expressionFilterManager.clear(); read-only surfaces leave it unset.
  • ExpressionFilterManager.clear() resets isComplexFilter. The navigation after a clear does not parse the params again, so without this the bar stayed empty with no Add filter button.
  • VerticalExpressionFilters.svelte (canvas inspector) gates its Clear button on the flag as well, since a pure OR has no top-level chip managers.
  • New filter_advanced_remove message in both locales.
  • Tests: a manager unit test, a shared "Advanced filters" group run by the explore, canvas and standalone component specs (their test wrappers now supply the Tooltip.Provider the pill needs), and a Playwright test that clears the filter from a shared URL and reloads.

The sessionStorage restore for an empty explore URL is unchanged: the cleared state is what gets persisted now, so a reload stays clean.

Steps to reproduce

  1. Open an explore with a filter the chips cannot show, e.g. /explore/AdBids_metrics_explore?f=publisher IN ('Facebook') OR domain IN ('google.com').
  2. Before: only the "Advanced (BETA)" pill renders, with no remove control and no "Clear filters" button. Removing the query string and reloading brings the filter back from sessionStorage.
  3. After: the pill has a remove button and "Clear filters" sits next to it. Either one empties the bar, the Add filter button returns, and a reload keeps the filter cleared.

Closes ENG-1136

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!

A filter the chips cannot show (a top level OR, an operator without a chip mode,
or the same dimension filtered twice) rendered only the read only "Advanced (BETA)"
pill. The unified filter bar kept the Clear filters button inside the chip branch,
the pill had no remove control, and `ExpressionFilterManager.clear()` never reset
`isComplexFilter`. The explore session store then restored the filter on every
reload of an empty url, so the only way out was clearing sessionStorage by hand.

The pill gets a remove button, Clear filters renders for advanced filters in the
filter bar and the canvas inspector, and clearing resets the complex flag.
@nishantmonu51
nishantmonu51 requested a review from k-anshul October 6, 2026 17:42

@k-anshul k-anshul left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did an experience pass and LGTM from the experience POV.

@nishantmonu51
nishantmonu51 merged commit 35a7efc into main Oct 7, 2026
16 checks passed
@nishantmonu51
nishantmonu51 deleted the nishant/fix-clear-advanced-filter branch October 7, 2026 07:20
nishantmonu51 added a commit that referenced this pull request Oct 7, 2026
A filter the chips cannot show (a top level OR, an operator without a chip mode,
or the same dimension filtered twice) rendered only the read only "Advanced (BETA)"
pill. The unified filter bar kept the Clear filters button inside the chip branch,
the pill had no remove control, and `ExpressionFilterManager.clear()` never reset
`isComplexFilter`. The explore session store then restored the filter on every
reload of an empty url, so the only way out was clearing sessionStorage by hand.

The pill gets a remove button, Clear filters renders for advanced filters in the
filter bar and the canvas inspector, and clearing resets the complex flag.
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