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


##########
superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx:
##########
@@ -1050,11 +1071,23 @@ export default function TableChart<D extends DataRecord 
= DataRecord>(
         basicColorFormatters.length > 0;
       const generalShowCellBars =
         config.showCellBars === undefined ? showCellBars : config.showCellBars;
+      // A Cell bar conditional-formatting rule must keep working even when the
+      // generic "Show cell bars" toggle is off: the toggle controls the 
default
+      // gradient, not whether an explicit formatter rule can draw its bar.
+      const hasCellBarFormatter =
+        hasColumnColorFormatters &&
+        columnColorFormatters.some(
+          formatter =>
+            formatter.objectFormatting === ObjectFormattingEnum.CELL_BAR &&
+            (formatter.columnFormatting
+              ? formatter.columnFormatting === key
+              : formatter.column === key),
+        );
       const valueRange =
         !hasBasicColorFormatters &&
-        generalShowCellBars &&
+        (generalShowCellBars || hasCellBarFormatter) &&
         (isMetric || isRawRecords || isPercentMetric) &&
-        getValueRange(key, alignPositiveNegative);
+        getValueRange(key, alignPositiveNegative, hasCellBarFormatter);

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Range/render coercion mismatch</b></div>
   <div id="fix">
   
   The render path coerces every cell via `parseNumeric(value)` (line 1131), 
but `getValueRange` only coerces when `hasCellBarFormatter` is true. With 
`generalShowCellBars` on and no cell-bar formatter, a column mixing native 
numbers and numeric strings ("-50") draws bars for string cells against a range 
built from native numbers only — e.g. a negative string cell gets `left: -50%` 
and hangs outside the cell, and an all-strings column draws no bars. Pass 
`generalShowCellBars || hasCellBarFormatter` to align range and render.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #ab76bc</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