gkhnelbstn commented on PR #43821:
URL: https://github.com/apache/superset/pull/43821#issuecomment-5888294269

   Thanks for taking pre-commit, and sorry for the wait. The rest is in 22f41f3 
and 1cff0d0.
   
   **Display regression.** You're right. Once the scope is anchored at the 
root, `useFilterScope` took the flat chart-list branch for every scope with 
exclusions, so a whole tab was listed as its charts. That branch now runs only 
on dashboards without top-level tabs. On a tabbed dashboard, a root-anchored 
scope goes through the existing tab branch, starting from every top-level tab 
that holds a chart. That branch already works out which tabs are fully in scope 
and which charts to list from partial tabs. The "holds a chart" part matters 
for tabs with only markdown: nothing can be excluded from them, so without the 
check they would always be named as in scope.
   
   New `FilterCard` tests on the existing fixture (charts 1-3 in Tab 1, chart 4 
in Tab 2, plus a chartless Tab 3 I added):
   
   | scope | shown |
   |---|---|
   | `[ROOT]`, excluded `[1, 2, 3]` | `Tab 2` |
   | `[ROOT]`, excluded `[1]` | `Tab 2, Test chart 2, Test chart 3` |
   
   Both fail on the previous `useFilterScope`, and both fail again if the 
chartless-tab check is removed. The existing `[ROOT]`, excluded `[1, 4]` case 
now goes through the tab branch too and still renders `Test chart 2, Test chart 
3`.
   
   **Copilot comments on utils.ts**
   - `as number`: both chart id lists now use a type guard instead of the cast. 
Behavior doesn't change, since `excluded` already skipped charts without an id, 
but the types are now honest.
   - `excluded` ordering: sorted numerically, with a test that reverses the 
layout's key order.
   - `describe` block: the `findFilterScope` tests are now top-level 
`test('findFilterScope: …')` cases, and the eslint-disable is gone.
   
   Locally, jest passes on `utils.test.ts` and on `FilterCard.test.tsx`, and 
oxfmt and oxlint are clean on the changed files.
   


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