richardfogaca opened a new pull request, #35886:
URL: https://github.com/apache/superset/pull/35886

   ### SUMMARY
   Fixes a bug where filters appear in "Filters out of scope" section after 
editing non-scope properties (e.g., changing "Sort filter values" settings) in 
dashboards with horizontal filter bars.
   
   **Root Cause:** When a filter is modified, the backend response doesn't 
include the `chartsInScope` property (it's calculated on the frontend). The 
`DashboardContainer` useEffect that recalculates `chartsInScope` wasn't 
triggered because it only depended on the `scope` property, which didn't change 
when modifying other filter settings.
   
   **Fix:** Added `nativeFilters` to the useEffect dependencies in 
`DashboardContainer.tsx` so that `chartsInScope` is recalculated whenever any 
filter property changes.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   **Before:** After editing a filter's "Sort filter values" setting, the 
filter incorrectly appears in "Filters out of scope" until page refresh.
   <img width="892" height="551" alt="Screenshot 2025-10-29 at 09 27 53" 
src="https://github.com/user-attachments/assets/539ad4ef-e67c-41e0-962d-65b75417eb23";
 />
   <img width="1266" height="460" alt="Screenshot 2025-10-29 at 09 27 41" 
src="https://github.com/user-attachments/assets/a046640e-07b8-40cd-a726-5bbeadcbf00d";
 />
   
   
   **After:** Filter remains in the correct scope section after editing.
   <img width="1250" height="496" alt="Screenshot 2025-10-29 at 09 24 28" 
src="https://github.com/user-attachments/assets/56a3fe1f-050c-4f80-8ad9-acf48485128d";
 />
   
   
   ### TESTING INSTRUCTIONS
   1. Open a dashboard with horizontal filters and multiple tabs
   2. Ensure there are enough filters to trigger the "More filters" dropdown
   3. Click "Add or edit filters"
   4. Edit a filter by changing a non-scope setting (e.g., "Sort filter values" 
→ "Sort descending")
   5. Click Save
   6. Verify the filter remains in the correct scope section (not moved to 
"Filters out of scope")
   
   ### ADDITIONAL INFORMATION
   - [x] Has associated issue: Filter scope bug investigation (internal)
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
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