bito-code-review[bot] commented on code in PR #42053:
URL: https://github.com/apache/superset/pull/42053#discussion_r3724992964
##########
superset-frontend/src/explore/components/controls/ConditionalFormattingControl/types.ts:
##########
@@ -25,14 +25,15 @@ import {
ObjectFormattingEnum,
} from '@superset-ui/chart-controls';
import { GenericDataType } from '@apache-superset/core/common';
+import { type RGBColor } from '@superset-ui/core/components';
export type ConditionalFormattingConfig = {
operator?: Comparator;
targetValue?: number;
targetValueLeft?: number;
targetValueRight?: number;
column?: string;
- colorScheme?: string;
+ colorScheme?: RGBColor | string;
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Type mismatch: RGBColor vs string consumers</b></div>
<div id="fix">
The `colorScheme` type now accepts `RGBColor | string`, but
`calculateBasicStyle` in transformProps.ts only accepts `ColorSchemeEnum` and
compares it using `===` against string values `'Green'` and `'Red'`. Passing an
`RGBColor` object will silently fail the comparison, causing conditional
formatting to be skipped for custom RGB colors. The type change exposes a
contract the consumer cannot fulfill.
</div>
</div>
<small><i>Code Review Run #72427f</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]