dosubot[bot] commented on issue #37069:
URL: https://github.com/apache/superset/issues/37069#issuecomment-3741966730

   <!-- Answer -->
   In Superset 6.0, the "Clear All" functionality for native filters was 
updated to address issues from earlier versions. The current implementation 
clears all native filters—including dependent ones—by iterating over all 
nativeFilterValues and resetting their values and extraFormData in local state. 
The SelectFilterPlugin was also updated to prevent default values from being 
reapplied during a clear-all operation, ensuring that dependent filters don't 
revert to defaults after clearing. This fix is included in PR #35303 and is now 
the standard behavior in 6.0 ([details and 
code](https://github.com/apache/superset/pull/35303)).
   
   Unlike in 5.x, the 6.0 handleClearAll does not dispatch updateDataMask 
actions immediately for each filter; instead, it relies on local state updates, 
and the actual Redux/global state is updated when the user clicks "Apply". This 
separation means that clearing and applying filters are distinct actions: 
clearing resets the UI, and applying pushes those changes to the store and 
triggers chart reloads ([see 
code](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx#L143-L383)).
   
   Chart customization clearing logic, which was present in the 5.x fix, is no 
longer part of the native filters "Clear All" flow in 6.0. Repository-wide 
searches confirm that this logic has been removed or refactored out of the 
native filters area.
   
   If you want "Clear All" to immediately update the Redux store and reload 
charts (without requiring a separate "Apply" click), you can adapt 
handleClearAll to dispatch updateDataMask for each cleared filter, similar to 
the handleApply logic. Otherwise, the current pattern is to clear locally and 
apply when the user confirms.
   
   If you need to extend "Clear All" to other dashboard state elements, you'll 
need to add that logic separately, as the current implementation is focused 
solely on native filters.
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/1f3e341a-b4c2-4b7b-afd0-3d177d6d6bb7?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/1f3e341a-b4c2-4b7b-afd0-3d177d6d6bb7?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/1f3e341a-b4c2-4b7b-afd0-3d177d6d6bb7?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/1f3e341a-b4c2-4b7b-afd0-3d177d6d6bb7?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/1f3e341a-b4c2-4b7b-afd0-3d177d6d6bb7?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/1f3e341a-b4c2-4b7b-afd0-3d177d6d6bb7?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/1f3e341a-b4c2-4b7b-afd0-3d177d6d6bb7?feedback_type=other)</sup>
   
   [![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=In%20Superset%206.0%2C%20the%20%22Clear%20All%22%20functionality%20for%20native%20filters%20was%20updated%20to%20address%20issues%20from%20earlier%20versions.%20The%20current%20implementation%20clears%20all%20native%20filters%E2%80%94including%20dependent%20ones%E2%80%94by%20iterating%20over%20all%20nativeFilterValues%20and%20resetting%20their%20values%20and%20extraFormData%20in%20local%20state.%20The%20SelectFilterPlugin%20was%20also%20updated%20to%20prevent%20default%20values%20from%20being%20reapplied%20during%20a%20clear-all%20operation%2C%20ensuring%20that%20dependent%20filters%20don%27t%20revert%20to%20defaults%20after%20clearing.%20This%20fix%20is%20included%20in%20PR%20%2335303%20and%20is%20now%20the%20standard%20behavior%20in%206.0%C2%A0%2
 
8%5Bdetails%20and%20code%5D%28https%3A//github.com/apache/superset/pull/35303%29%29.%0A%0AUnlike%20in%205.x%2C%20the%206.0%20handleClearAll%20does%20not%20dispatch%20updateDataMask%20actions%20immediately%20for%20each%20filter%3B%20instead%2C%20it%20relies%20on%20local%20state%20updates%2C%20and%20the%20actual%20Redux/global%20state%20is%20updated%20when%20the%20user%20clicks%20%22Apply%22.%20This%20separation%20means%20that%20clearing%20and%20applying%20filters%20are%20distinct%20actions%3A%20clearing%20resets%20the%20UI%2C%20and%20applying%20pushes%20those%20changes%20to%20the%20store%20and%20triggers%20chart%20reloads%C2%A0%28%5Bsee%20code%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx%23L143-L383%29%29.%0A%0AChart%20customization%20clearing%20logic%2C%20which%20was%20present%20in%20the%205.x%20fix%2C%20is%20no%20longer%20part%20of%20the%20native%20filters%20%22Cl
 
ear%20All%22%20flow%20in%206.0.%20Repository-wide%20searches%20confirm%20that%20this%20logic%20has%20been%20removed%20or%20refactored%20out%20of%20the%20native%20filters%20area.%0A%0AIf%20you%20want%20%22Clear%20All%22%20to%20immediately%20update%20the%20Redux%20store%20and%20reload%20charts%20%28without%20requiring%20a%20separate%20%22Apply%22%20click%29%2C%20you%20can%20adapt%20handleClearAll%20to%20dispatch%20updateDataMask%20for%20each%20cleared%20filter%2C%20similar%20to%20the%20handleApply%20logic.%20Otherwise%2C%20the%20current%20pattern%20is%20to%20clear%20locally%20and%20apply%20when%20the%20user%20confirms.%0A%0AIf%20you%20need%20to%20extend%20%22Clear%20All%22%20to%20other%20dashboard%20state%20elements%2C%20you%27ll%20need%20to%20add%20that%20logic%20separately%2C%20as%20the%20current%20implementation%20is%20focused%20solely%20on%20native%20filters.)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/d
 iscord-bot)&nbsp;[![Share on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/37069)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to