Repository navigation
feat: add an "All" option to static list dashboard filters - #3847
karl-power wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: efb84d8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Duplicate code analysisNo new duplicate code introduced by this PR. jscpd compared this branch against |
PR Review
5 finding(s): 🔴 0 P0/P1 · 🟡 2 P2 · 🔵 3 P3 2 posted as inline comment(s) on the changed lines. 3 P3 folded at the bottom. 🔵 3 P3 — no action needed before merge
Priority comes from a separate grading pass over the finished review. P3 is folded here instead of posted inline. No finding blocks merge automatically; a maintainer decides. |
E2E Test Results✅ All tests passed • 494 passed • 1 skipped • 1134s
Tests ran across 4 shards in parallel. |
Deep ReviewScope: PR #3847 — "All" option for static-list dashboard filters, across 🟡 P2 — recommended
🔵 P3 nitpicks (1)
Prior review items confirmed resolved in this diff: the "SQL query All stays unexpanded" concern ( Reviewers (10): correctness, adversarial, api-contract, kieran-typescript, testing, maintainability, previous-comments, project-standards, agent-native, security. Testing gaps:
No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
|
P1 saved "all" blocking saves: fixed in 379678d. The internal API now drops saved "all" values whose filter no longer offers "All" instead of rejecting the save; the external API still rejects them. P1 "All" on SQL query filters: known gap, handled in the follow-up PR that adds "All" to SQL query filters. Until then it's only reachable through the internal API directly: the edit form shows the checkbox on static lists only, and the external API and MCP reject allowAll on SQL query filters. |
🔴 Tier 4 — CriticalTouches authentication, tenancy data models, the public API or shipped database config — or substantially changes the query rendering engine, background tasks, the OTel pipeline, image build, or release CI. Why this tier:
Review process: Deep review from a domain expert. Synchronous walkthrough may be required. Stats
|
ff28689 to
c9cd0d6
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c9cd0d6. Configure here.
| data.filters ?? [], | ||
| data.savedFilterValues ?? [], | ||
| ctx, | ||
| ); |
There was a problem hiding this comment.
Partial updates skip All-value checks
Medium Severity
validateDashboardSavedFilterValues only sees the request body's filters, and an omitted field is treated as an empty list. Names then look undeclared, so all: true is kept. External PUT and MCP save/patch can persist that default on a filter that does not set allowAll, which this change is meant to reject.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit c9cd0d6. Configure here.
- Static list filters get an `Include "All" option` setting; their dropdown then offers "All", ported from EE's source-filter dropdown - "All" is stored as `all: true`, survives changes to sibling filters, counts as a selection for required filters, and expands to every option for tiles - The internal and external dashboard APIs validate saved "all" values; the external API and MCP accept `allowAll` on static list filters and `all` on saved filter values, and MCP tile runs can simulate "All" - Document the `$__conditionalAll` behaviour for "All" in the SQL editor hint, the MCP prompt and the OpenAPI spec
c9cd0d6 to
efb84d8
Compare
| placeholder={value.length === 0 ? filter.name : undefined} | ||
| placeholder={hasSelection ? undefined : filter.name} | ||
| values={value} | ||
| enableAllOption={filterSupportsAllValue(filter)} |
There was a problem hiding this comment.
🟡 P2 — SQL query filters with allowAll now show an "All" option that gives tiles no values
Restrict filterSupportsAllValue (packages/common-utils/src/filters.ts:1143) to STATIC_LIST until SQL query filters can expand "All". The alternative is to reject allowAll on SQL_QUERY in the internal API's addFilterIssues. Today the internal POST/PATCH /dashboards (packages/api/src/routers/api/dashboards.ts:53) accepts allowAll on SQL_QUERY, because SqlQueryDashboardFilterSchema in types.ts:2571 allows it and only the external API omits it. The predicate returns true for such a filter, so this dropdown offers "All". But expandAllSelections in useDashboardFilters only gets static-list options, so the variable keeps values: []. The result is that $var renders NULL and $__filter becomes 1=1, which contradicts the hint text. MCP resolveDashboardVariables does the same: it accepts all: true for these filters and returns empty values.
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond
|
|
||
| <Combobox.Dropdown> | ||
| <Combobox.Options> | ||
| {showAllOption && ( |
There was a problem hiding this comment.
🟡 P2 — A real option named "All" looks the same as the synthetic "All" row and pill
Hide or rename the synthetic row, or reject an "All" option when allowAll is set. Consider a static list that already has an option literally called All, which is a common workaround before this feature. If it turns on allowAll, the dropdown shows two identical "All" rows, and the selected pill reads "All" in both cases. The user cannot tell "every option" apart from the single value 'All'.
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond


Summary
Static list dashboard filters can now offer an "All" choice in their dropdown, which selects every option. Stacked on #3830, which added the data model and macro behaviour.
Include "All" optioncheckbox in the static list filter settings setsallowAll. It's hidden for single-select filters.VirtualMultiSelect).{ type: 'variable', name, values: [], all: true }in thefilters=state. It survives changes to other filters (fixes the feat: add groundwork for an "All" option on dashboard filters #3830 review comment) and counts as a selection for required filters.$variableand$__filterexpand to the full list, and$__conditionalAllexpands to1=1, matching Grafana.allowAllon static list filters andallon saved filter values. SQL query filters still rejectallowAlluntil a follow-up expands their options.{ name, values: [], all: true }.$__conditionalAlldescription in the SQL editor hint, the MCP prompt and the OpenAPI spec now covers "All".How to test
On this branch, import this dashboard to ClickStack and follow the instructions:
Screenshots or video
References
Note
Medium Risk
Changes variable resolution, macros, and persisted filter state across UI and APIs; incorrect expansion could affect dashboard query results, though scope is limited to optional static-list multi-select filters with heavy test coverage.
Overview
Multi-select static list dashboard filters can now expose an "All" choice via a new
allowAllsetting (Include "All" option in the filter editor; hidden for single-select).Selecting All persists as
{ values: [], all: true }in dashboard filter state and saved defaults. VirtualMultiSelect anduseDashboardFilterscarry that selection through the UI and URL; required filters treat All as satisfied. Query variables expand to every declared option for$variableand$__filter, and$__conditionalAllbecomes1=1, aligned with Grafana-style behavior.OpenAPI, external API, and MCP accept
allowAlland savedall: true(with validation: noallowAllon single-select or SQL query filters yet). The internal dashboard API drops staleallvalues whenallowAllis removed so saves are not blocked; the external API rejects invalid combinations. MCP tile runs can simulate All viavariableValues: { all: true }.Reviewed by Cursor Bugbot for commit efb84d8. Bugbot is set up for automated code reviews on this repo. Configure here.