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


##########
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx:
##########
@@ -916,6 +923,7 @@ export class TableRenderer extends Component {
       maxColVisible: Math.max(...visibleColKeys.map(k => k.length)),
       rowAttrSpans: this.calcAttrSpans(visibleRowKeys, rowAttrs.length),
       colAttrSpans: this.calcAttrSpans(visibleColKeys, colAttrs.length),
+      totalRowsCount: visibleRowKeys.length + (colTotals ? 1 : 0),

Review Comment:
   The `totalRowsCount` calculation incorrectly includes the column totals row. 
The totals row is rendered separately via `renderTotalsRow()` and should not be 
counted when determining if a data row cell is the last row. 
   
   When `colTotals` is enabled, a cell in the last data row with `rowSpan=1` 
will have `rowIdx + rowSpan = N` (where N is `visibleRowKeys.length`), but this 
will never equal `totalRowsCount = N + 1`, so the border will never be applied.
   
   The calculation should be:
   ```javascript
   totalRowsCount: visibleRowKeys.length,
   ```
   ```suggestion
         totalRowsCount: visibleRowKeys.length,
   ```



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