refac: unified expression filter component across explore, canvas, alerts and reports - #9746
Open
AdityaHegde wants to merge 34 commits into
Open
refac: unified expression filter component across explore, canvas, alerts and reports#9746AdityaHegde wants to merge 34 commits into
AdityaHegde wants to merge 34 commits into
Conversation
AdityaHegde
force-pushed
the
refac/unified-filter-component
branch
from
August 10, 2026 14:20
fb87403 to
0e9eb72
Compare
AdityaHegde
force-pushed
the
refac/unified-filter-component
branch
from
August 11, 2026 12:57
21c97f9 to
cc9c8e9
Compare
AdityaHegde
marked this pull request as ready for review
August 19, 2026 06:18
Contributor
There was a problem hiding this comment.
Pull request overview
Unifies filter state, UI, persistence, exports, alerts, reports, and canvas interactions around ExpressionFilterManager.
Changes:
- Introduces shared dimension/measure filter managers and providers.
- Migrates explore, canvas, alerts, reports, bookmarks, and public URLs.
- Updates serialization, query construction, tests, and read-only filter displays.
Reviewed changes
Copilot reviewed 149 out of 163 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
web-local/tests/explores/explores.spec.ts |
Adjusts explore E2E timing. |
web-local/tests/canvas/filters.spec.ts |
Cleans canvas filter test. |
web-common/src/lib/test/mock-animations.ts |
Mocks Web Animations. |
web-common/src/lib/svelte-query/reactive-queries.svelte.ts |
Adds reactive multi-query helper. |
web-common/src/lib/i18n/messages/es.json |
Adds required-filter copy. |
web-common/src/lib/i18n/messages/en.json |
Adds required-filter copy. |
web-common/src/lib/arrayUtils.ts |
Generalizes collection helpers. |
web-common/src/features/scheduled-reports/utils.ts |
Migrates report filters. |
web-common/src/features/scheduled-reports/ScheduledReportDialog.svelte |
Uses unified filter manager. |
web-common/src/features/scheduled-reports/BaseScheduledReportForm.svelte |
Passes unified filter context. |
web-common/src/features/metrics-views/providers/test/RuntimeContextHarness.svelte |
Adds provider test harness. |
web-common/src/features/metrics-views/providers/test/metrics-views-test-utils.svelte.ts |
Adds provider test utilities. |
web-common/src/features/metrics-views/providers/MetricsViewsProvider.spec.ts |
Tests metrics-view aggregation. |
web-common/src/features/exports/pdf/CanvasPdfExportHeader.svelte |
Uses unified read-only filters. |
web-common/src/features/exports/export-filters.ts |
Exports unified expressions. |
web-common/src/features/exports/export-filters.spec.ts |
Updates export tests. |
web-common/src/features/explores/explore-link/explore-state-transformer.ts |
Keeps filters collapsed. |
web-common/src/features/explore-mappers/get-dashboard-from-aggregation-request.ts |
Maps measure filters to subqueries. |
web-common/src/features/dashboards/workspace/Dashboard.svelte |
Connects dashboard to filter manager. |
web-common/src/features/dashboards/url-state/test/url-state-test-utils.ts |
Adds filter-manager URL helpers. |
web-common/src/features/dashboards/url-state/convertURLSearchParamsToExploreState.spec.ts |
Updates URL-state tests. |
web-common/src/features/dashboards/url-state/convertPresetToExploreState.ts |
Preserves unified expressions. |
web-common/src/features/dashboards/url-state/convert-partial-explore-state-to-url-params.ts |
Serializes unified expressions. |
web-common/src/features/dashboards/time-series/totals-data-store.ts |
Queries with unified filters. |
web-common/src/features/dashboards/time-series/timeseries-data-store.ts |
Queries with unified filters. |
web-common/src/features/dashboards/time-series/ScreenshotContainer.svelte |
Uses read-only expression filters. |
web-common/src/features/dashboards/time-series/multiple-dimension-queries.ts |
Preserves measure subqueries. |
web-common/src/features/dashboards/time-dimension-details/TDDHeader.svelte |
Migrates filter actions. |
web-common/src/features/dashboards/time-dimension-details/tdd-export.ts |
Exports unified filters. |
web-common/src/features/dashboards/time-controls/time-control-store.ts |
Adds dimension-only expressions. |
web-common/src/features/dashboards/time-controls/time-control-store.spec.ts |
Cleans test managers. |
web-common/src/features/dashboards/stores/test-data/helpers.ts |
Initializes managers in context. |
web-common/src/features/dashboards/stores/filter-utils.ts |
Adds expression utilities. |
web-common/src/features/dashboards/stores/dashboard-stores.ts |
Mirrors managed filters into state. |
web-common/src/features/dashboards/stores/correct-explore-state.spec.ts |
Removes legacy filter assertions. |
web-common/src/features/dashboards/stores/AdvancedMeasureCorrector.ts |
Delegates filter correction. |
web-common/src/features/dashboards/stores/AdvancedMeasureCorrector.spec.ts |
Updates correction tests. |
web-common/src/features/dashboards/state-managers/StateManagersProvider.svelte |
Cleans up state managers. |
web-common/src/features/dashboards/state-managers/state-managers.ts |
Adds expression filter manager. |
web-common/src/features/dashboards/state-managers/selectors/measures.ts |
Extracts measure filtering helper. |
web-common/src/features/dashboards/state-managers/selectors/measure-filters.ts |
Retires legacy selectors. |
web-common/src/features/dashboards/state-managers/selectors/dashboard-queries.ts |
Reads measures from expressions. |
web-common/src/features/dashboards/state-managers/most-recent-explore-state.spec.ts |
Updates persisted-state tests. |
web-common/src/features/dashboards/state-managers/loaders/test/PageMockForExploreTests.ts |
Mocks form actions. |
web-common/src/features/dashboards/state-managers/loaders/test/DashboardStateManagerTest.svelte |
Adds manager provider context. |
web-common/src/features/dashboards/state-managers/loaders/explore-web-view-store.spec.ts |
Updates web-view tests. |
web-common/src/features/dashboards/state-managers/loaders/DashboardStateSync.ts |
Synchronizes managed filters. |
web-common/src/features/dashboards/state-managers/loaders/DashboardStateManager.svelte |
Supplies filter manager to sync. |
web-common/src/features/dashboards/state-managers/loaders/DashboardStateManager.spec.ts |
Updates imports. |
web-common/src/features/dashboards/state-managers/actions/measure-filters.ts |
Retires legacy actions. |
web-common/src/features/dashboards/state-managers/actions/filters.ts |
Retires legacy actions. |
web-common/src/features/dashboards/selectors.ts |
Handles unified subquery filters. |
web-common/src/features/dashboards/rows-viewer/RowsViewerAccordion.svelte |
Uses unified expressions. |
web-common/src/features/dashboards/providers/YAMLConfigProvider.svelte.ts |
Provides YAML filter configuration. |
web-common/src/features/dashboards/providers/DashboardConfigProvider.svelte.ts |
Builds dashboard-specific providers. |
web-common/src/features/dashboards/proto-state/toProto.ts |
Serializes filter subqueries. |
web-common/src/features/dashboards/proto-state/sparse-proto.spec.ts |
Updates proto tests. |
web-common/src/features/dashboards/proto-state/fromProto.ts |
Restores unified subqueries. |
web-common/src/features/dashboards/pivot/pivot-export.ts |
Exports unified filters. |
web-common/src/features/dashboards/pivot/pivot-data-config.ts |
Configures unified pivot filters. |
web-common/src/features/dashboards/leaderboard/LeaderboardDisplay.svelte |
Migrates leaderboard actions. |
web-common/src/features/dashboards/leaderboard/Leaderboard.svelte |
Queries unified expressions. |
web-common/src/features/dashboards/filters/ExpressionFilterManager.svelte.ts |
Centralizes expression filter state. |
web-common/src/features/dashboards/filters/VerticalExpressionFilters.svelte |
Adds vertical filter editor. |
web-common/src/features/dashboards/filters/utils.ts |
Detects missing required filters. |
web-common/src/features/dashboards/filters/test/render-filter-component.ts |
Removes legacy test helper. |
web-common/src/features/dashboards/filters/test/ExpressionFiltersTest.svelte |
Adds unified filter harness. |
web-common/src/features/dashboards/filters/ReadonlyExpressionFilters.svelte |
Adds shared read-only filters. |
web-common/src/features/dashboards/filters/MissingRequiredFiltersMessage.svelte |
Displays required-filter warnings. |
web-common/src/features/dashboards/filters/measure-filters/ReadonlyMeasureFilter.svelte |
Adds read-only measure chip. |
web-common/src/features/dashboards/filters/measure-filters/MeasureFilterReadOnlyChip.svelte |
Removes legacy measure chip. |
web-common/src/features/dashboards/filters/measure-filters/MeasureFilterManager.svelte.ts |
Encapsulates measure filter state. |
web-common/src/features/dashboards/filters/measure-filters/MeasureFilterForm.svelte |
Removes duplicate popover ID. |
web-common/src/features/dashboards/filters/measure-filters/measure-filter-utils.ts |
Removes split/merge utilities. |
web-common/src/features/dashboards/filters/FilterChipsReadOnly.svelte |
Removes legacy read-only filters. |
web-common/src/features/dashboards/filters/FilterButton.svelte |
Removes legacy add button. |
web-common/src/features/dashboards/filters/filter-events.ts |
Defines filter events. |
web-common/src/features/dashboards/filters/ExploreFilterChipsReadOnly.svelte |
Removes explore-specific chips. |
web-common/src/features/dashboards/filters/dimension-filters/ReadonlyDimensionFilter.svelte |
Adds read-only dimension chip. |
web-common/src/features/dashboards/filters/dimension-filters/DimensionFilterReadOnlyChip.svelte |
Removes legacy dimension chip. |
web-common/src/features/dashboards/filters/dimension-filters/DimensionFilterFooter.svelte |
Simplifies exclude callback. |
web-common/src/features/dashboards/filters/dimension-filters/dimension-filter-values.ts |
Queries unified filters. |
web-common/src/features/dashboards/filters/CanvasFilterChipsReadOnly.svelte |
Removes canvas-specific chips. |
web-common/src/features/dashboards/filters/AddExpressionFilterButton.svelte |
Uses shared filter metadata. |
web-common/src/features/dashboards/dimension-table/DimensionHeader.svelte |
Migrates dimension actions. |
web-common/src/features/dashboards/dimension-table/DimensionDisplay.svelte |
Migrates selection and queries. |
web-common/src/features/dashboards/dimension-table/dimension-table-utils.ts |
Preserves measure subqueries. |
web-common/src/features/dashboards/dimension-table/dimension-table-export.ts |
Exports unified filters. |
web-common/src/features/dashboards/dimension-search/GlobalDimensionSearchResults.svelte |
Migrates search selection. |
web-common/src/features/dashboards/dashboard-fetch-mocks.ts |
Mocks resource listings. |
web-common/src/features/dashboards/big-number/MeasuresContainer.svelte |
Receives unified filters. |
web-common/src/features/dashboards/aggregation-request-utils.ts |
Removes legacy filter builder. |
web-common/src/features/canvas/LocalFiltersHeader.svelte |
Displays unified local filters. |
web-common/src/features/canvas/inspector/filters/FiltersMapper.svelte |
Passes local filter managers. |
web-common/src/features/canvas/inspector/DefaultFilterDisplay.svelte |
Displays managed defaults. |
web-common/src/features/canvas/filters/canvas-filter-expressions.ts |
Extracts managed canvas filters. |
web-common/src/features/canvas/components/SaveDefaultsButton.svelte |
Compares default URL state. |
web-common/src/features/canvas/components/pivot/pivot-test-data.ts |
Adds pivot test metadata. |
web-common/src/features/canvas/components/pivot/pivot-click-to-filter.ts |
Migrates pivot interactions. |
web-common/src/features/canvas/components/pivot/CanvasPivotRenderer.svelte |
Connects pivot filter manager. |
web-common/src/features/canvas/components/markdown/util.ts |
Supplies unified template filters. |
web-common/src/features/canvas/components/kpi-grid/KPIGrid.svelte |
Guards unavailable filter state. |
web-common/src/features/canvas/components/charts/variants/ComboChart.ts |
Preserves unified link filters. |
web-common/src/features/canvas/components/charts/custom-chart/index.ts |
Creates local expression filters. |
web-common/src/features/canvas/components/charts/BaseChart.ts |
Preserves unified chart filters. |
web-common/src/features/canvas/chat-context.ts |
Supplies canvas filters to chat. |
web-common/src/features/canvas/CanvasBuilder.svelte |
Initializes canvas width. |
web-common/src/features/alerts/form-utils.ts |
Builds alert queries from expressions. |
web-common/src/features/alerts/data-tab/DataPreview.svelte |
Uses managed alert filters. |
web-common/src/features/alerts/data-tab/AlertDialogDataTab.svelte |
Passes unified filter context. |
web-common/src/features/alerts/criteria-tab/AlertPreview.svelte |
Uses managed criteria filters. |
web-common/src/features/alerts/criteria-tab/AlertDialogCriteriaTab.svelte |
Migrates criteria filter type. |
web-common/src/features/alerts/create-alert-utils.ts |
Initializes alert filter manager. |
web-common/src/features/alerts/AlertPreviewTable.svelte |
Updates sizing call. |
web-common/src/features/alerts/AlertForm.svelte |
Manages filter lifecycle. |
web-common/src/features/alerts/alert-preview-data.ts |
Queries alert expressions. |
web-common/src/components/virtualized-table/sections/TableCells.svelte |
Guards stale virtual items. |
web-common/src/components/virtualized-table/sections/ColumnHeaders.svelte |
Guards stale headers. |
web-admin/tests/bookmarks.spec.ts |
Re-enables bookmark E2E tests. |
web-admin/src/features/public-urls/ExploreFiltersSection.svelte |
Removes explore-specific section. |
web-admin/src/features/public-urls/CanvasFiltersSection.svelte |
Removes canvas-specific section. |
web-admin/src/features/public-urls/canvas-form-utils.ts |
Removes legacy canvas utilities. |
web-admin/src/features/projects/header/ProjectHeader.svelte |
Simplifies bookmark props. |
web-admin/src/features/dashboards/share/ShareDashboardPopover.svelte |
Keys public URL forms by resource. |
web-admin/src/features/dashboards/listing/DashboardsTable.svelte |
Uses default deduplication. |
web-admin/src/features/bookmarks/ExploreBookmarks.svelte |
Removes metrics-view prop. |
web-admin/src/features/bookmarks/CanvasBookmarks.svelte |
Removes metrics-view lookup. |
web-admin/src/features/bookmarks/Bookmarks.svelte |
Keys dialogs by resource. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
We have 3 different filter implementation across explore, canvas, alerts and reports with action code like toggling dimension value duplicated. This PR unifies expression filters components.
The goal of this refactor was also to ensure the state matches UI controls 1-1. Earlier we have
V1Expressionthat doesnt map 1-1, especially withSelectvsIn-Listmodes.ExpressionFilter.svelteacts as the unified filter component that takes aExpressionFilterManager.ExpressionFilterManagercontainsMetricsViewFilterManagerper configured metrics views. It also has the full list ofDimensionFilterManager/MeasureFilterManageracross metrics views, deduped by name. Takes all the filters fromMetricsViewFilterManagerand creates a sorted list for default filters bar, required first, followed by pinned, followed by dimension and finally measure filters.JoinerFilterManageris a wrapper per joiner. For existing filter bar it is always anANDjoiner. Future PR will support more advanced editing likeORfilter and nestedAND/OR. Ensures pinned/required filters have an entry. Also handles adding new dimension/measure filter.DimensionFilterManagerencapsulates all actions for a dimension filter. This code was spread out in different places. Along withDimensionFilter.svelteit handles everything for a dimension filter.MeasureFilterManagerencapsulates all actions for a measure filter. Along withMeasureFilter.svelteit handles everything for a measure filter.MetricsViewsProvider. All dimension and measure selectors are come from here.YAMLConfigProviderthat provide config that is yaml only and not maintained as a state while rendering dashboard. Currently this has required/pinned filters.DashboardConfigProviderfor quickly buildingExploreDashboardConfigProviderorCanvasDashboardConfigProvider.For explore,
ExpressionFilterManagertoStateManagers.ExpressionFilter.sveltepassing it theExpressionFilterManagerfromStateManagers.ExpressionFilterManagerdirectly.For canvas,
ExpressionFilterManagertoCanvasEntity.ExpressionFilterManager.timeAndFilterStorebut uses data from parent'sExpressionFilterManagerfor expression related fields.There will be a follow up to move time controls as well.
Checklist: