codeant-ai-for-open-source[bot] commented on code in PR #44665:
URL: https://github.com/apache/superset/pull/44665#discussion_r4139667064


##########
superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx:
##########
@@ -1140,6 +1176,19 @@ export default function TableChart<D extends DataRecord 
= DataRecord>(
                 } else {
                   valueToFormat = value;
                 }
+                // String cells that read as numbers ("1.00") must compare
+                // numerically, or comparator rules like `= 1` never match.
+                if (
+                  formatter.objectFormatting ===
+                    ObjectFormattingEnum.CELL_BAR &&
+                  valueToFormat !== null &&
+                  valueToFormat !== undefined
+                ) {
+                  const coerced = parseNumeric(valueToFormat);
+                  if (coerced !== undefined) {
+                    valueToFormat = coerced;
+                  }
+                }

Review Comment:
   ✅ **CodeAnt verified this suggestion was addressed in subsequent commits and 
marked this thread resolved** as of `b3a0c44`.
   
   Cell-bar formatter values are no longer coerced when the operator is a 
string comparator or when the target value is stored as text. Numeric coercion 
remains for other applicable rules.
   
   <sub>If that's not right, unresolve this thread and CodeAnt will leave it 
open.</sub>
   
   <!-- codeant-auto-resolve-reply -->



##########
superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx:
##########
@@ -1195,29 +1244,38 @@ export default function TableChart<D extends DataRecord 
= DataRecord>(
             top: 0;
             ${
               valueRange &&
-              typeof value === 'number' &&
+              numericValue !== undefined &&
               valueRangeFlag &&
               `
                 width: ${`${cellWidth({
-                  value: value as number,
+                  value: numericValue,
                   valueRange,
                   alignPositiveNegative,
                 })}%`};
                 left: ${`${cellOffset({
-                  value: value as number,
+                  value: numericValue,
                   valueRange,
                   alignPositiveNegative,
                 })}%`};
                 background-color: ${
                   backgroundColorCellBar ||
                   cellBackground({
-                    value: value as number,
+                    value: numericValue,
                     colorPositiveNegative,
                     theme,
                   })
                 };
               `
             }
+            ${
+              !(valueRange && numericValue !== undefined && valueRangeFlag) &&
+              backgroundColorCellBar &&
+              `
+                width: 100%;
+                left: 0;
+                background-color: ${backgroundColorCellBar};
+              `

Review Comment:
   ✅ **CodeAnt verified this suggestion was addressed in subsequent commits and 
marked this thread resolved** as of `b3a0c44`.
   
   Bar geometry is now guarded by both a numeric value and a valid range, so 
matching nonnumeric cells do not receive width or offset styles for a full-cell 
bar.
   
   <sub>If that's not right, unresolve this thread and CodeAnt will leave it 
open.</sub>
   
   <!-- codeant-auto-resolve-reply -->



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