fix(dashboard): pre-filter time grain for display controls#40000
fix(dashboard): pre-filter time grain for display controls#40000massucattoj wants to merge 5 commits into
Conversation
Code Review Agent Run #ed04e2Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
|
The flagged issue is correct: applying To resolve, modify the condition in No other comments found in the PR. superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #40000 +/- ##
==========================================
+ Coverage 64.20% 64.22% +0.02%
==========================================
Files 2592 2592
Lines 139232 139227 -5
Branches 32327 32326 -1
==========================================
+ Hits 89389 89416 +27
+ Misses 48308 48276 -32
Partials 1535 1535
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Would love to see the bot comments addressed, and perhaps a test, so we can merge this :D |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Code Review Agent Run #995125
Actionable Suggestions - 1
-
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx - 1
- Orphaned config with no consumer · Line 84-119
Review Details
-
Files reviewed - 4 · Commit Range:
91e6027..cfb6b5a- superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.timeGrain.test.ts
- superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx
- superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx
- superset-frontend/src/chartCustomizations/components/TimeGrain/CustomizationTimeGrainsTransformer.integration.test.ts
-
Files skipped - 0
-
Tools
- Eslint (Linter) - ✔︎ Successful
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
-
/review- Manually triggers a full AI review. -
/pause- Pauses automatic reviews on this pull request. -
/resume- Resumes automatic reviews. -
/resolve- Marks all Bito-posted review comments as resolved. -
/abort- Cancels all in-progress reviews.
Refer to the documentation for additional commands.
Configuration
This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.
Documentation & Help
| @@ -143,9 +114,6 @@ const FilterValue: FC<FilterValueProps> = ({ | |||
| }) => { | |||
| const { id, targets, filterType } = filter; | |||
| const isCustomization = isChartCustomization(filter); | |||
| const allowedTimeGrains = isCustomization | |||
| ? undefined | |||
| : (filter as TimeGrainFilterConfig).time_grains; | |||
| const adhocFilters = isCustomization ? undefined : filter.adhoc_filters; | |||
| const timeRange = isCustomization ? undefined : filter.time_range; | |||
| const granularitySqla = isCustomization ? undefined : filter.granularity_sqla; | |||
There was a problem hiding this comment.
Removed applyTimeGrainAllowlist and TimeGrainFilterConfig type, but filterTransformer.ts still persists time_grains from native filter configs into Filter.time_grains. This orphaned configuration has no consumer—users will set time_grains expecting filtered options but see all time grains instead. Either remove the configuration serialization or restore the filtering logic.
Code Review Run #995125
Should Bito avoid suggestions like this for future reviews? (Manage Rules)
- Yes, avoid them
SUMMARY
The "Pre-filter available values" option configured for Time Grain controls only worked when the control was created as a Native Filter. When the same control was created as a Display Control (chart
customization), the configured allowlist was silently dropped — the dashboard end user always saw all 14 time grains regardless of what the dashboard author had configured.
This regression had three root causes, all in the parallel plumbing that was added for chart customizations after the native filter pre-filter feature shipped (PR #38922):
matched, so the checkbox never rendered.
(filterTransformer.ts) already does this.
The fix mirrors the existing native filter wiring across all three layers and threads the time_grains field through the supporting types (ChartCustomization, ChartCustomizationsFormItem,
PluginFilterTimeGrainCustomizeProps).
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:

After:

TESTING INSTRUCTIONS
ADDITIONAL INFORMATION