Copilot commented on code in PR #45030:
URL: https://github.com/apache/superset/pull/45030#discussion_r4199096780


##########
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.tsx:
##########
@@ -729,17 +761,23 @@ export function TableRenderer(props: TableRendererProps) {
       collapsed: Record<string, boolean>,
       numAttrs: number,
       subtotalDisplay: SubtotalDisplay,
+      collapseByDefault: boolean,
     ) =>
       keys.filter(
         (key: string[]) =>
           // Is the key hidden by one of its parents?
-          !key.some(
-            (_k: string, j: number) => collapsed[flatKey(key.slice(0, j))],
+          !key.some((_k: string, j: number) =>
+            isEffectivelyCollapsed(
+              key.slice(0, j),
+              collapsed,
+              collapseByDefault,
+            ),

Review Comment:
   Default collapse treats every nonempty ancestor as a collapsible group, even 
when no subtotal row exists for it. With metrics on Rows, Combine metrics off, 
Show columns total off, and non-percentage values, `buildGroupbyCombinations` 
omits the empty-row rollup. `PivotTableChart` then produces keys such as 
`['value', 'US']` but no `['value']` subtotal. This walk treats that missing 
ancestor as collapsed and filters out every row. With Combine metrics on, 
intermediate row rollups are also omitted, so leaf keys such as `['US', 'NYC', 
'value']` disappear too. Both cases leave no row-group arrow to reopen the 
data. Restrict default collapse to prefixes with renderable subtotal rows, use 
that same eligibility check for arrow state and toggle defaults, and add 
regression tests for both production metric layouts.



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