Copilot commented on code in PR #43370:
URL: https://github.com/apache/superset/pull/43370#discussion_r3847053258
##########
superset-frontend/plugins/plugin-chart-table/src/transformProps.ts:
##########
@@ -767,6 +793,25 @@ const transformProps = (
columns,
conditionalFormatting,
);
+ const totalsBasicColorSource =
+ applyConditionalFormattingToTotals && totals
+ ? [
+ isUsingTimeComparison && comparisonSuffix
+ ? toOriginalMetricTotals(totals, columns, comparisonSuffix)
+ : totals,
+ ]
+ : undefined;
+ const totalsBasicColorFormatters =
+ totalsBasicColorSource && comparisonColorEnabled
+ ? getBasicColorFormatter(totalsBasicColorSource, columns)?.[0]
+ : undefined;
Review Comment:
When client-side search is active, `TableChart` recomputes `displayedTotals`
from the filtered rows (`TableChart.tsx:1637-1651`), but these formatter maps
are generated from the original `totals` only. The footer therefore formats the
filtered total with a stale comparison/Green-Red result; a subset that changes
from positive to negative (or vice versa) still displays the pre-search color.
Recompute the basic formatter maps from the displayed totals, or otherwise keep
the displayed value and formatter source consistent.
--
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]