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


##########
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.tsx:
##########
@@ -1044,10 +1080,18 @@ export class TableRenderer extends Component<
 
         const headerCellFormattedValue =
           dateFormatters?.[rowAttrs[i]]?.(r) ?? r;
+
+        const { backgroundColor } = getCellColor(
+          [rowAttrs[i]],
+          headerCellFormattedValue,
+          cellColorFormatters,
+        );

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Incorrect color key in column header</b></div>
   <div id="fix">
   
   The getCellColor call in renderColHeaderRow uses [rowAttrs[i]] as keys, but 
this is the attribute name (e.g., 'country'), not the cell value needed for 
matching formatter.column. It should be [headerCellFormattedValue] to enable 
correct conditional coloring of column headers based on their displayed values.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ````suggestion
           const { backgroundColor } = getCellColor(
             [headerCellFormattedValue],
             headerCellFormattedValue,
             cellColorFormatters,
           );
   ````
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #a74765</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



##########
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.tsx:
##########
@@ -1044,10 +1080,18 @@ export class TableRenderer extends Component<
 
         const headerCellFormattedValue =
           dateFormatters?.[rowAttrs[i]]?.(r) ?? r;
+
+        const { backgroundColor } = getCellColor(
+          [rowAttrs[i]],
+          headerCellFormattedValue,
+          cellColorFormatters,
+        );

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Incorrect color key in row header</b></div>
   <div id="fix">
   
   Similar to the column header issue, the getCellColor call in renderTableRow 
uses [rowAttrs[i]] as keys, which is the attribute name, but should be 
[headerCellFormattedValue] to match formatter.column with the actual cell value 
for proper row header coloring.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ````suggestion
           const { backgroundColor } = getCellColor(
             [headerCellFormattedValue],
             headerCellFormattedValue,
             cellColorFormatters,
           );
   ````
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #a74765</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