bito-code-review[bot] commented on code in PR #43370:
URL: https://github.com/apache/superset/pull/43370#discussion_r3825990575


##########
superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx:
##########
@@ -1049,6 +1117,87 @@ export default function TableChart<D extends DataRecord 
= DataRecord>(
       // Cache sanitized header ID to avoid recomputing it multiple times
       const headerId = sanitizeHeaderId(column.originalLabel ?? column.key);
 
+      const renderTotalsFooter = () => {
+        if (!displayedTotals) {
+          return undefined;
+        }
+        if (i === 0) {
+          return (
+            <th key={`footer-summary-${i}`}>
+              <div
+                css={css`
+                  display: flex;
+                  align-items: center;
+                  & svg {
+                    margin-left: ${theme.sizeUnit}px;
+                    color: ${theme.colorBorder} !important;
+                  }
+                `}
+              >
+                {t('Summary')}
+                <Tooltip
+                  overlay={t(
+                    'Show total aggregations of selected metrics. Note that 
row limit does not apply to the result.',
+                  )}
+                >
+                  <InfoCircleOutlined />
+                </Tooltip>
+              </div>
+            </th>
+          );
+        }
+        const totalValue = displayedTotals[key];
+        const originKey = key.substring(label.length).trim();
+        let backgroundColor;
+        let color;
+        if (applyConditionalFormattingToTotals) {
+          if (!hasColumnColorFormatters && totalsBasicColorFormatters) {
+            backgroundColor =
+              totalsBasicColorFormatters[originKey]?.backgroundColor ||
+              totalsBasicColorFormatters[key]?.backgroundColor;
+          }
+          if (hasColumnColorFormatters) {
+            const formatting = getConditionalFormattingColors(
+              columnColorFormatters!,
+              displayedTotals,
+              key,
+              totalValue,
+            );

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Incomplete totals color handling</b></div>
   <div id="fix">
   
   The totals conditional formatting call at line 1165 ignores 
`backgroundColorCellBar` and `skipValueRange` returned by 
`getConditionalFormattingColors`, and omits the `applyCellBars` argument. 
Compare with the row formatting at lines 1227-1245, which applies all four 
properties and passes `generalShowCellBars`. This causes cell-bar backgrounds 
and value-range overrides to silently drop for totals rows.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #000e4c</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



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