Introduce required/mandatory filters#9493
Open
nishantmonu51 wants to merge 3 commits into
Open
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
AdityaHegde
requested changes
May 25, 2026
Collaborator
AdityaHegde
left a comment
There was a problem hiding this comment.
Is a UI toggle for required filter a future thing? We have one for pin in the filter dropdown.
| r.CanvasSpec.Rows = rows | ||
| r.CanvasSpec.SecurityRules = rules | ||
| r.CanvasSpec.PinnedFilters = tmp.Filters.Pinned | ||
| r.CanvasSpec.RequiredFilters = tmp.Filters.Required |
Collaborator
There was a problem hiding this comment.
We should have validation for this to ensure it is defined in metrics view's measure/dimensions. Since there is no no-code way to set it a validation will help with issues.
| {#if missingRequired} | ||
| This filter is required. Select a value to load the dashboard. | ||
| {:else} | ||
| Click to edit the the filters in this dimension |
Collaborator
There was a problem hiding this comment.
nit: remove doubled the
| ); | ||
| // Required filters are implicitly pinned at runtime; persist them only under | ||
| // `filters.required` to avoid duplicating them in `filters.pinned`. | ||
| const genericPinnedKeys = Array.from(pinnedFilters) |
Collaborator
There was a problem hiding this comment.
We should do this dedupe render time instead. When we add a toggle for required switching it on and off will removed the pinned filter.
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.
There is no way to mark a filter as mandatory: a canvas always renders, even if a critical filter (e.g.
region,customer_id) has been left empty. Mandatory/Required ensures that a user always filters on one or more dimension values.This PR adds support for declaring required filters on canvas dashboards, alongside the existing
pinnedfilters.filters.requiredYAML field on canvas dashboardsdefaults.filtersor the user), the canvas body is replaced with an inline panel listing the missing filters; the filter row stays interactive so the user can set values.runtime/ai/instructions/data/resources/canvas.mdupdated so the analyst and developer agents know about the new field.Checklist: