justinpark opened a new pull request, #33106: URL: https://github.com/apache/superset/pull/33106
### SUMMARY The bug where filters outside the current scope are displayed was newly introduced during the process of identifying filters applied to active tabs in [#32115](https://github.com/apache/superset/pull/32115/files#diff-1bbe96474254d89b21e3b373e1c9e8a222ee892518595a69a809c5f035e5bd4eR126). The root cause occurs from the issue that when tabs are structured with multiple levels and the scope is applied to a lower tab, changing the top-level tab leads to an issue where tabs that are no longer visible are not removed from the active tabs state. For example, in the following tab structure, when the top-level tab is changed, the previous active tabs retain the sub-tabs of the previous tab. ``` ROOT | | TAB-A TAB-B | | TAB-SUB-A TAB-SUB-B active_tabs: ['ROOT', 'TAB-A', 'TAB-SUB-A'] // setActiveTab from TAB-A to TAB-B active_tabs: ['ROOT', 'TAB-B', 'TAB-SUB-A', 'TAB-SUB-B'] ``` To address this issue, this commit added a logic to remove the inactive tabs from the active tabs when the top-level tab is switched. Furthermore, to restore the state of previously selected sub-tabs when the tabs return to their original state, this commit modified the logic to store them in the inactive tabs state and recover the sub-tabs associated with the changed top-level tab. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF Before: https://github.com/user-attachments/assets/6348574e-3177-4fae-b7ad-39780dd8ae72 After: https://github.com/user-attachments/assets/a19bc36e-6381-4c01-8152-26b859f47b83 ### TESTING INSTRUCTIONS Follow the above screencapture steps ### ADDITIONAL INFORMATION - [ ] Has associated issue: - [ ] 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]
