JCelento opened a new pull request, #37139: URL: https://github.com/apache/superset/pull/37139
<!--- Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/ Example: fix(dashboard): load charts correctly --> ### SUMMARY **Issue:** Dashboard filters appear in tabs that were explicitly excluded from the filter scope, particularly when dealing with nested tabs. **Root cause:** The original implementation used OR logic (`isChartInScope || isFilterInActiveTab`), which allowed the `rootPath` fallback to incorrectly show filters even when charts in `chartsInScope` were not visible. When a child tab was excluded, but its parent tab was active, the `rootPath` check would match the parent tab and incorrectly display the filter. **Fix:** Changed the logic to prioritize `chartsInScope` when it exists, using if/else instead of OR. When `chartsInScope` is present, only chart visibility is checked (requiring all tab ancestors to be active). ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF **BEFORE:**  **AFTER:**  ### TESTING INSTRUCTIONS 1. Create a dashboard with two tabs. 2. One tab needs to have two other tabs (Child1 and Child2) 3 .Each of them needs to have two charts nested (Child1, Child2, and Parent2). You need to do this before creating the dashboard filter. If any of the previous tabs don’t have the charts nested, then the bug is not produced. 4. Create a dashboard filter (e.g. Time grain) and change the scope not to consider the Child2 tab). <img width="1440" height="707" alt="image" src="https://github.com/user-attachments/assets/81b61881-c646-4d00-8403-b8ed764380e0" /> 5. Save the changes. **EXPECTED RESULTS** The scope you assign in your dashboard filter is respected. ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] 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]
