fix(native-filters): clear all functionality#36882
fix(native-filters): clear all functionality#36882vighneshtule wants to merge 10 commits intoapache:masterfrom
Conversation
Nitpicks 🔍
|
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx
Show resolved
Hide resolved
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx
Outdated
Show resolved
Hide resolved
…rBar/index.tsx Co-authored-by: codeant-ai-for-open-source[bot] <244253245+codeant-ai-for-open-source[bot]@users.noreply.github.com>
…rBar/index.tsx Co-authored-by: codeant-ai-for-open-source[bot] <244253245+codeant-ai-for-open-source[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes issue #36876 where the "Clear All" button in Native Filters only reset the UI form state without immediately applying the changes to the dashboard. Users had to manually click "Apply" again to see the cleared filters take effect, creating a confusing two-step process.
Key Changes
- Modified
handleClearAllto immediately dispatchupdateDataMaskactions for all cleared filters, synchronizing local component state with global Redux state - Refactored filter clearing logic to batch state updates before applying them, improving code organization
- Added immediate persistence of cleared chart customizations via
saveChartCustomizationcall
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx
Show resolved
Hide resolved
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx
Outdated
Show resolved
Hide resolved
…rBar/index.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Code Review Agent Run #07c9f8
Actionable Suggestions - 1
-
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx - 1
- State Update Logic Bug · Line 399-399
Review Details
-
Files reviewed - 1 · Commit Range:
ca8424e..74741c8- superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx
-
Files skipped - 0
-
Tools
- 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
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx
Show resolved
Hide resolved
|
Running CI 🤞 |
|
CodeAnt AI is running Incremental review Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
CodeAnt AI Incremental review completed. |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
User description
Description
Fixes #36876.
Summary
The "Clear All" button in the Native Filters bar previously only reset the form UI without dispatching the corresponding updates to the Redux store. This left the dashboard in a desynchronized state where the UI appeared empty, but the charts remained filtered until the user manually clicked "Apply".
This PR updates
handleClearAllto explicitly nullify values for all active filters and dispatchupdateDataMaskimmediately. This ensures consistency between the local component state and the global Redux state, triggering the necessary dashboard refresh and correctly disabling the "Apply" button.Before/After Screenshots
Before:
FCC.New.Coder.Survey.2018.-.Comet.2026-01-01.02-34-11.mp4
After:
Superset.-.Google.Chrome.2026-01-01.04-19-01.mp4
Testing Instructions
CodeAnt-AI Description
Ensure 'Clear All' resets native filters and applies immediately
What Changed
Impact
✅ Immediate chart reloads when clearing filters✅ Fewer dashboards left in a desynced state after using Clear All✅ Disabled "Apply" when there are no pending filter changes💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.