Fix dimension filter chip exclude rerender#9624
Open
nishantmonu51 wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a stale dimension filter chip UI state when an existing chip is rerendered with only its include/exclude operator changed (e.g., IN ↔ NIN), ensuring the chip label and styling stay in sync with updated filter props.
Changes:
- Updates the closed-state resync condition to also trigger when
isInclude(exclude mode) changes, not only when the filter mode changes. - Adds a regression test that rerenders a dimension filter from exclude → include and asserts the chip label and
excludeclass update accordingly.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| web-common/src/features/dashboards/filters/dimension-filters/DimensionFilter.svelte | Extends the closed-state resync condition to include include/exclude operator changes so the chip UI doesn’t get stuck. |
| web-common/src/features/dashboards/filters/dimension-filters/DimensionFilter.spec.ts | Adds a regression test covering rerender behavior when only isInclude flips. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6928498 to
e0fd1c1
Compare
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.
Fixes a stale dimension filter chip state when an existing chip is rerendered with only its include/exclude operator changed, such as applying embed
setStatewithIN->NINorNIN->IN.The chip component was caching
curExcludeModelocally and only resyncing closed state when the filter mode changed. SinceINandNINare bothSelectmode, the data query and URL state updated but the chip label/class could stay stuck on the initial operator.Added a regression test that rerenders the same dimension filter chip from exclude to include and verifies the label and
excludeclass update.Checklist:
Tested with:
npm run test -w web-common -- src/features/dashboards/filters/dimension-filters/DimensionFilter.spec.ts