docs: a filter on another semantic view can source a facet (CUB-4903) - #11966
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
|
Claude finished @mngr's task in 2m 9s —— View job Review complete — 0 high, 1 medium, 2 low, all posted inlineDetails
Findings
Checks that came back clean
Not verifiable hereThe behavioural claims are checked against Merge gating is as the description states: this documents behaviour that ships with the enterprise PR, so it should not land first. Review threadsThe listing returned 0 unresolved threads on this PR, so none of mine to resolve and none re-affirmed. All three findings posted as new inline comments. |
|
Claude finished @mngr's task in 2m 8s —— View job Docs review: no blockers — 0 high, 0 medium, 2 low (both posted inline), 1 nit notedFull review
Findings1. The lead sentence says a sibling on another semantic view "narrows it once you [match it to a dimension of this one]", but line 107 scopes the default All to "every sibling on its own semantic view". A cross-view source has to be explicitly picked and matched; a reader who leaves the picker at All and reads only line 96 will expect the match to be enough. 2. "Nothing is stored until you Save, and clearing a match or unchecking the source drops it from the dashboard" — the second clause reads as an immediate drop. Per the PR's own evidence the key only leaves the config on save ("Unchecking and saving removes the key"), and Cancel puts the picker back at All. 3. Checked and clean
Review threadsThe listing returned 0 of my own threads (0 threads on the PR at all), so none to resolve and none re-affirmed. Findings 1 and 2 were posted as new inline threads; finding 3 was skipped as below the inline bar, not as a duplicate. Note on merge orderThe PR body flags the dependency on cubedevinc/cubejs-enterprise#15310 — this page describes a cross-view source as selectable, which is false until that ships. Nothing here changes that; it stays a merge-order constraint for a human. |
|
Claude finished @mngr's task in 2m 41s —— View job Docs-only change, technically sound — 1 medium posted inline, 2 low noted, no correctness or security surfaceReview details
ScopeOne file, Checks that came back clean:
FindingsMedium — Low, not posted inline (you've stated only medium and high are fixed here, and these are exactly the editorial churn you called out):
Review threadsThe unresolved-thread listing for this PR came back empty (single page, Merge gateUnchanged by this review: this page still must not merge before cubedevinc/cubejs-enterprise#15310, or the cross-view source it documents is greyed out in the shipped product. |
|
|
||
| A filter on one semantic view can narrow a faceted filter on another, once you say which dimension of the faceted filter's own view the source stands for. Pick it in the source picker like any other sibling and a row appears under the picker: **Based on** names the source's own view and dimension, and the picker beneath it — **Matching dimension for "*the source's title*"** — takes a dimension of *this* filter's view. The value list is scoped through that dimension, so the query behind it never names the source's view. The match is part of the dashboard, so it applies on a published dashboard and in an embed too, including when the source's value arrives in a [URL parameter](#sharing-the-current-selection). | ||
|
|
||
| The match is pre-selected for you when the answer is unambiguous: a dimension of this view the model declares as the same underlying column, then one the dashboard already maps that control to for a chart, then one matching by name and type. Several equally good candidates count as no answer, as does one of a different data type, and the row then opens unmatched. Only the dimensions the scope can use are selectable: one of the same data type as the source's dimension, whose type can express the source's condition. |
There was a problem hiding this comment.
"whose type can express the source's condition" is a property of the source, not of the candidate, so it never rules a candidate in or out — and where it fails, the picker has nothing to offer at all and the Warning's advice cannot be followed.
The two clauses aren't independent. The first pins the candidate to the same data type as the source's dimension; given that, "whose type can express the source's condition" is just "the source's own dimension type can express its condition" — the same for every candidate. So either all dimensions of this view of that type are selectable or none are, and a reader who reads it as a per-candidate test will look for a candidate that passes both.
The "none are" branch is the gap. Per your own note on this PR, a cross-view source that is still unmatched is gated on isFacetOperatorExpressible(condition) — any member type can express it — while a match is gated on isFacetingAvailable(condition, matched member's data type), and the matched type is forced equal to the source's. A source whose condition some type can express but its own cannot is therefore selectable and unmatchable: the row opens, the member picker greys everything, and the new <Warning> tells the reader to "match it, or uncheck it" when only the second is possible. The page already establishes the reachable shape of such a filter — a condition its dimension type has no operator menu entry for, arriving by hand-written URL parameter, exactly as custom does two paragraphs up.
Two ways out, whichever matches the branch:
- If that state is reachable, say the picker can come back empty and that unchecking is then the only move — otherwise the Warning reads as offering a choice the UI does not.
- If
isFacetOperatorExpressibleandisFacetingAvailable(condition, own type)can never disagree for a filter the product can produce, then the second clause is genuinely vacuous and costs the sentence its readability for nothing; drop it and let the data-type rule stand alone.
| The match is pre-selected for you when the answer is unambiguous: a dimension of this view the model declares as the same underlying column, then one the dashboard already maps that control to for a chart, then one matching by name and type. Several equally good candidates count as no answer, as does one of a different data type, and the row then opens unmatched. Only the dimensions the scope can use are selectable: one of the same data type as the source's dimension, whose type can express the source's condition. | |
| The match is pre-selected for you when the answer is unambiguous: a dimension of this view the model declares as the same underlying column, then one the dashboard already maps that control to for a chart, then one matching by name and type. Several equally good candidates count as no answer, as does one of a different data type, and the row then opens unmatched. Only dimensions of the same data type as the source's dimension are selectable, and only where that type can express the source's condition at all — a condition it cannot, which only a [URL parameter](#sharing-the-current-selection) can set, leaves the picker with nothing to offer and unchecking the source as the only move. |
This page depends on cubedevinc/cubejs-enterprise#15310 (CUB-4903) and must not merge before it — until that PR ships, a filter on another semantic view is still greyed out in the facet source picker.
The condition list this page points at is master's and is rewritten by #11936 (CUB-4769), which documents the widening that #15310's own base, cubedevinc/cubejs-enterprise#15177, ships. Either docs PR may merge first — they touch different sentences of the same section — but while #11936 is unmerged that list still reads as the pre-#15177 one, on both sides of a view boundary alike.
What changed
docs/explore-analyze/dashboards/widgets/controls.mdx, Faceted filters:isCrossViewBindingUsable), so a source can only ever be matched onto its own builder column and carries exactly the conditions its own member type supports.#### Sources on another semantic view: the Based on row and the Matching dimension picker, the pre-selection ranks and when they decline to answer, which dimensions are selectable, Save/Cancel and withdrawal, and a<Warning>for the picked-but-unmatched source that narrows nothing.No new page, so
docs.jsonis unchanged; this adds no widget, container or control type, so the Product Taxonomy indocs-mintlify/CLAUDE.mdis unchanged too.Verified against the code and the running product
Code (feature branch
mentor/cub-4903-cross-view-filter-faceting):isFacetSourceSelectable/isFacetOperatorExpressibleinfacet-scope-utils.ts.useFacetScope'stoFilterreturnsnullwithout a mapping, andfacetSourceScopeStatecalls it'unbound', not an error.<this view>.<matched member>—generateCubeFilter'smemberPathargument — so the values query never names the source's view.suggestFacetSourceMemberinfacet-source-binding.ts.facetDimensionMappingsin local state and writes it only in its save effect, asundefinedwhen empty.handleToggleFacet,handleSemanticViewChange,handleFacetSourceSelectionChange).useFacetBindingContext(widget.config?.facetDimensionMappings, …)inmodules/embed/pages/PublishedDashboard/Widgets/FilterWidget.tsx.Running product (staging-mngr-2,
pw__sharedfixture; full log in the issue's evidence ashandoff-r2-walk.log):Customer signup(another view) selectable,Custom SQL rulegreyed with the tooltip "This filter's condition cannot narrow a value list".Based on Customers Created at / Matching dimension for "Customer signup" / Created at; in the member picker onlyCreated atis selectable,Status,City,AgeandStateare greyed.facetDimensionMappings = undefined, and with the source set to an empty window the value list still lists all 4 statuses.2016-01-01→2016-03-31leaves 2 of 4, and the values query's filter leaves areorders.created_atonly — it never namescustomers.Created at. Cancel leaves the picker back at All with 0 binding rows.?f_customers.created_at={"type":"between","value":["2016-01-01","2016-03-31"]}narrows the faceted filter to the same 2 values.Feature PR: https://github.com/cubedevinc/cubejs-enterprise/pull/15310
Linear: https://linear.app/cube-d3/issue/CUB-4903/cross-view-filter-faceting