Repository navigation
refac: unified expression filter component across explore, canvas, alerts and reports - #9746
Conversation
fb87403 to
0e9eb72
Compare
21c97f9 to
cc9c8e9
Compare
|
Reviewed the diff against 1.
|
18171de to
6bebff4
Compare
|
Thanks @nishantmonu51 . Fixed all except 1 & 4.
|
Resolves conflicts with the unified expression filter refactor (#9746): adopts the new `where` construction and runes-mode components while keeping the ephemeral measure request mapping, and points the URL-state spec at the moved test helpers. Claude-Session: https://claude.ai/code/session_01NW6ETnqzwL5jdoVCKQPHNf
Since #9746 migrated DimensionTable.svelte to runes, the column width $effect assigned estimateColumnSize and then read it back through estimateColumnSize[0] = manualDimensionColumnWidth. In Svelte 5 an effect that reads a source it just wrote registers it as a dependency and reschedules itself, so the first manual resize looped until effect_update_depth_exceeded. Compute the widths as a $derived instead.
Since #9746 migrated DimensionTable.svelte to runes, the column width $effect assigned estimateColumnSize and then read it back through estimateColumnSize[0] = manualDimensionColumnWidth. In Svelte 5 an effect that reads a source it just wrote registers it as a dependency and reschedules itself, so the first manual resize looped until effect_update_depth_exceeded. Compute the widths as a $derived instead.
…filters (#9951) `getDimensionFilterWithSearch` returned undefined when the where filter was undefined, which is now the case for a dashboard with no active filters since the unified expression filter refactor (#9746). The search text was dropped and the dimension table query ran without a where clause. Treat an undefined filter as an empty AND so the search clause is still added.
…filters (#9951) `getDimensionFilterWithSearch` returned undefined when the where filter was undefined, which is now the case for a dashboard with no active filters since the unified expression filter refactor (#9746). The search text was dropped and the dimension table query ran without a where clause. Treat an undefined filter as an empty AND so the search clause is still added.
Conflicts: - FlatTable.svelte, NestedTable.svelte: main moved the row markup into a pivotRow snippet (totals row pinning, rilldata#9915). Took main's snippet and applied the PIVOT_TOTALS_ROW_ID check there, and updated the comment that described the totals row as tanstack row "0". - pivot-click-to-filter.spec.ts: main rewrote the setup for the unified filter manager (rilldata#9746). Took main's version and switched its row ids from positional to value-based again.
Conflicts: - FlatTable.svelte, NestedTable.svelte: main moved the row markup into a pivotRow snippet (totals row pinning, rilldata#9915). Took main's snippet and applied the PIVOT_TOTALS_ROW_ID check there, and updated the comment that described the totals row as tanstack row "0". - pivot-click-to-filter.spec.ts: main rewrote the setup for the unified filter manager (rilldata#9746). Took main's version and switched its row ids from positional to value-based again.
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: