feat(native-filters): make filter dependency support extensible via plugin registry#40905
feat(native-filters): make filter dependency support extensible via plugin registry#40905ashah65 wants to merge 2 commits into
Conversation
…lugin registry Replace hardcoded ALLOW_DEPENDENCIES list with a registry-based check so any filter plugin registering with Behavior.NativeFilter automatically supports the cascade dependency feature — no core changes needed for new plugins. Also adds isColumnSelect support in getControlItemsMap to allow plugins to declare dataset column picker controls.
|
The flagged issue is correct. When divider edits are made, the To resolve this, you should ensure that divider-specific changes are tracked. You can update Would you like me to fetch all other comments on this PR to validate them and implement minimal fixes for those as well? superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.tsx |
There was a problem hiding this comment.
Code Review Agent Run #d2347d
Actionable Suggestions - 3
-
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/getControlItemsMap.tsx - 2
- Missing error handling for API call · Line 122-135
- Missing value prop for saved data restoration · Line 343-343
-
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.tsx - 1
- Divider edits silently dropped on save · Line 473-476
Additional Suggestions - 2
-
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx - 1
-
Dead code from incomplete removal · Line 650-691Since the operatorType auto-reset logic depends on columns.type_generic, you should either add 'columns.type_generic' back to the API query's columns list or remove the related operatorType auto-reset code (lines 650–691) entirely.
-
-
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/getControlItemsMap.tsx - 1
-
Missing test coverage for isColumnSelect · Line 322-350The new `isColumnSelect` feature block (lines 322-350) lacks test coverage. Existing tests mock `ColumnSelect` but not `DatasetColumnSelect`. Add unit tests following the pattern in lines 212-251 to validate the new feature's behavior, including `notifyChange` propagation and initial value resolution.
-
Filtered by Review Rules
Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.
-
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/getControlItemsMap.tsx - 1
- Missing unit tests for DatasetColumnSelect · Line 105-149
-
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx - 1
- Hardcoded label bypasses feature flag · Line 975-975
Review Details
-
Files reviewed - 5 · Commit Range:
3596459..3596459- superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx
- superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/getControlItemsMap.tsx
- superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.tsx
- superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/index.ts
- superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useFilterOperations.ts
-
Files skipped - 0
-
Tools
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
- Eslint (Linter) - ✔︎ 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
There was a problem hiding this comment.
Pull request overview
This PR refactors native filter cascading-dependency support to be registry-driven (based on plugin metadata behaviors) and extends the native filter config modal’s control mapping to support plugin-declared dataset column picker controls (isColumnSelect).
Changes:
- Replaced the hardcoded native-filter dependency allowlist with a registry-based
Behavior.NativeFiltercheck. - Exported the new dependency-support helper through the hooks index and config modal module.
- Added
isColumnSelecthandling ingetControlItemsMapand introduced a dataset-column fetching select control for plugins.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useFilterOperations.ts | Switches dependency eligibility to a registry/behavior-based check. |
| superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/index.ts | Re-exports the new helper instead of the removed hardcoded allowlist. |
| superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.tsx | Wires the new helper export; modifies form onValuesChange handling. |
| superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/getControlItemsMap.tsx | Adds isColumnSelect rendering and a dataset column select control. |
| superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx | Adopts the new dependency helper; includes additional unrelated UI logic changes. |
- Mark divider edits as modified so canSave is enabled for divider changes - Persist sortMetric=undefined when Select is cleared via allowClear - Restore datasetLabel() for semantic-layers feature flag consistency - Restore time_grains allowlist UI for filter_timegrain config - Restore operatorType (Match type) UI for filter_select config - Fix ControlLabel to resolve function-typed label/description props - Fix DatasetColumnSelect: add cancellation, error handling, allowClear Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Code Review Agent Run #0adbb6Actionable Suggestions - 0Additional Suggestions - 2
Review 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 |
Replace hardcoded ALLOW_DEPENDENCIES list with a registry-based check so any filter plugin registering with Behavior.NativeFilter automatically supports the cascade dependency feature — no core changes needed for new plugins.
Also adds isColumnSelect support in getControlItemsMap to allow plugins to declare dataset column picker controls.
SUMMARY
Currently, the mechanism that determines which native filters support cascading dependencies relies on a hardcoded list (ALLOW_DEPENDENCIES) within the core Superset codebase. This creates a tight coupling that blocks external, third-party, or custom filter plugins from leveraging cascading features without directly mutating core files.
This PR refactors the filter dependency system to be entirely registry-driven and enhances control mapping flexibility.
Design Decisions & Changes:
Registry-Driven Dependencies: Replaced the hardcoded check with a dynamic lookup. Any filter plugin that registers with Behavior.NativeFilter now automatically inherits support for the cascade dependency feature out-of-the-box. This eliminates the need for future core repository changes when new filters are introduced.
Dynamic Column Selection Controls: Added explicit support for isColumnSelect inside getControlItemsMap. This allows external plugins to declaratively request dataset column picker controls directly from the native filter configuration modal.
TESTING INSTRUCTIONS
Since this is an architectural enablement patch, testing should focus on verifying that existing core filters suffer no regressions, and that the underlying hooks resolve correctly.
Navigate to a dashboard and open the Manage native filters modal.
Create a standard core filter (e.g., a Select or Numerical Range filter).
Ensure that the "Filter is dependent on..." (cascading) configuration option is visible, selectable, and functional.
Verify that dataset column configuration selectors still populate and save accurately for out-of-the-box filters.
Register a custom dummy plugin leveraging Behavior.NativeFilter to verify it successfully reveals dependency options without updating core mapping arrays.
ADDITIONAL INFORMATION