test(canvas): lock filter scope parity between filter bar and table click - #9976
Open
Tyagiquamar wants to merge 1 commit into
Open
Tyagiquamar wants to merge 1 commit into
Tyagiquamar wants to merge 1 commit into
Conversation
AdityaHegde
requested changes
Oct 1, 2026
| // Second metrics view declaring the same dimensions, mirroring a canvas with | ||
| // two metrics views such as `duckdb_commits_metrics` and `rill_commits_metrics` | ||
| // in https://github.com/rilldata/rill/issues/9845. | ||
| const PIVOT_MIRROR_METRICS_NAME = "mv2"; |
Collaborator
There was a problem hiding this comment.
nit: move these alongside PIVOT_METRICS_INIT in pivot-test-data.
| // for the dimension, fanned out to every metrics view that declares it. | ||
| // --------------------------------------------------------------------------- | ||
|
|
||
| describe("canvas filter scope parity", () => { |
Collaborator
There was a problem hiding this comment.
Lets not add a tests specifically for the issue.
- You can just add
PIVOT_MIRROR_METRICS_NAMEto the shared manager in the top levelbeforeAll. - Add assertions in table variant tests,
flat table: single-cell-per-row,nested table: multi-selectandnested table: cross-parent selection isolation. - Add a test in each where filter bar changes update pivot (maybe out of scope if this doesn't work)
| ); | ||
| }); | ||
|
|
||
| it("filter bar writes byte-identical params for the same selection", () => { |
Collaborator
There was a problem hiding this comment.
This is redundant to checking individual metrics views. Adding assertion in existing tests should be enough.
This branch has not been deployed
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.
Related to #9845.
Problem
#9845 reports that the same dimension filter reaches all metrics views when set from the filter bar (\.=...\ per view) but only one view when set by clicking a table, while the bar renders an identical single chip in both cases.
Root cause
On current \main\ both paths already converge on the shared \DimensionFilterManager\ plus \JoinerFilterManager.buildExpression\ fan-out (unified by #9746), so the divergent writes from the issue no longer reproduce. Nothing pins that behavior, though: the pivot click path (\createPivotClickToFilter\ -> \dimensionFilterAction) had no coverage asserting what URL params a click produces.
Fix
No behavior change. Adds a two-metrics-view harness (\mv1\ + \mv2\ sharing \country) to \pivot-click-to-filter.spec.ts\ with two regression tests:
Regression test
New \canvas filter scope parity\ describe block in \pivot-click-to-filter.spec.ts. Full file: 50/50 pass. \ExpressionFilterManager.spec.ts: 69/69 pass (unchanged).
Validation
px vitest run src/features/canvas/components/pivot/pivot-click-to-filter.spec.ts --pool threads --no-isolate: 50 passed.
px vitest run src/features/dashboards/filters/ExpressionFilterManager.spec.ts --pool threads --no-isolate: 69 passed.
px prettier --check\ on the spec file: clean.
px eslint\ on it: 0 errors (1 pre-existing warning on untouched code).