Repository navigation
feat: Color Picker replaces the color selection drop-down list in conditional formatting - #42053
Conversation
This reverts commit 35aaeb6.
There was a problem hiding this comment.
Code Review Agent Run #22271a
Actionable Suggestions - 3
-
superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.test.tsx - 1
- Test searches non-existent RGB string · Line 136-153
-
superset-frontend/src/explore/components/controls/ColorPickerControl.test.tsx - 1
- Tests outside describe block · Line 101-242
-
superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx - 1
- Trend color formatting flags dropped on save · Line 773-773
Additional Suggestions - 1
-
superset-frontend/plugins/plugin-chart-table/src/transformProps.ts - 1
-
Dead code: orphaned constant · Line 755-763The `?? defaultColorFormatters` expression is dead code since `getColorFormatters` (lines 309-354 in `getColorFormatters.ts`) always returns `ColorFormatters` (array), never null/undefined. This nullish-coalescing can never trigger. The diff removes the only usage of `defaultColorFormatters` while keeping the unreachable fallback, leaving an orphaned constant. Compare with `plugin-chart-ag-grid-table` which uses `?? []` directly at line 782 for the same pattern.
-
Filtered by Review Rules
Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.
-
superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.tsx - 1
- CWE-20: Missing value prop on ColorPicker · Line 408-408
-
superset-frontend/src/explore/components/controls/ColorPickerControl.tsx - 1
- Interface contract violation - type change · Line 39-39
Review Details
-
Files reviewed - 18 · Commit Range:
19151d1..619651f- superset-frontend/packages/superset-ui-chart-controls/src/types.ts
- superset-frontend/packages/superset-ui-chart-controls/src/utils/getColorFormatters.ts
- superset-frontend/packages/superset-ui-chart-controls/test/utils/getColorFormatters.test.ts
- superset-frontend/packages/superset-ui-core/src/color/utils.ts
- superset-frontend/packages/superset-ui-core/test/color/utils.test.ts
- superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx
- superset-frontend/plugins/plugin-chart-ag-grid-table/test/controlPanel.test.tsx
- superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.tsx
- superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
- superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx
- superset-frontend/plugins/plugin-chart-table/src/transformProps.ts
- superset-frontend/plugins/plugin-chart-table/test/controlPanel.test.tsx
- superset-frontend/src/explore/components/controls/ColorPickerControl.test.tsx
- superset-frontend/src/explore/components/controls/ColorPickerControl.tsx
- superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.test.tsx
- superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.tsx
- superset-frontend/src/explore/components/controls/ConditionalFormattingControl/constants.ts
- superset-frontend/src/explore/components/controls/ConditionalFormattingControl/types.ts
-
Files skipped - 0
-
Tools
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
- Eslint (Linter) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
-
/review- Manually triggers a full AI review. -
/pause- Pauses automatic reviews on this pull request. -
/resume- Resumes automatic reviews. -
/resolve- Marks all Bito-posted review comments as resolved. -
/abort- Cancels all in-progress reviews.
Refer to the documentation for additional commands.
Configuration
This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].
Documentation & Help
|
🎪 Showtime deployed environment on GHA for 0db1c92 • Environment: http://16.147.8.251:8080 (admin/admin) |
Code Review Agent Run #2b3495Actionable Suggestions - 0Filtered by Review RulesBito filtered these suggestions based on rules created automatically for your feedback. Manage rules.
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
|
This looks awesome! I'm gonna take it for a spin and report back :D |
| return; | ||
| } | ||
|
|
||
| onChange(rgb); |
There was a problem hiding this comment.
This persists an RGBColor object into chart params, so rolling back to a string-only reader turns the color into invalid CSS such as [object Object]FF and drops conditional formatting on already-saved charts. Could custom choices keep a backward-compatible string representation?
There was a problem hiding this comment.
Good catch; I switched the saved format to hex.
There was a problem hiding this comment.
You can now flexibly control the output format using the resolveThemeTokens and outputFormat properties.
For example:
-
resolveThemeTokens = falseandoutputFormat = "hex"
Saves only in hex format. -
resolveThemeTokens = trueandoutputFormat = "hex"
Saves in hex format + tokens. -
resolveThemeTokens = falseandoutputFormat = "rgb"
Saves only in RGB. -
resolveThemeTokens = trueandoutputFormat = "rgb"
Saves in RGB + tokens.
There was a problem hiding this comment.
Confirmed, ConditionalFormattingControl passes outputFormat="hex" now, so this persists a hex string instead of an RGBColor object. Rollback compatibility should be fine.
|
|
||
| Object.entries(themeColors).forEach(([name, value]) => { | ||
| if (typeof value === 'string') { | ||
| reverseMap[normalizeColorToHex(value)] = name; |
There was a problem hiding this comment.
Theme tokens that resolve to the same light-theme color overwrite each other here, so selecting colorSuccess can persist colorSuccessText; after switching to a dark theme, the rule changes to a different shade. Could the selected preset retain its token identity instead of reversing through a non-unique color value?
There was a problem hiding this comment.
The dedup in getReverseThemeColorMap picks a first-wins token when two tokens share the same hex, so identity is deterministic now but still not fully preserved for colliding tokens. Probably fine for now, flagging in case it matters more in practice than I think.
| } | ||
| return colorScheme; | ||
| } | ||
| const baseHexColor = rgbaToHex({ ...colorScheme, a: 1 }); |
There was a problem hiding this comment.
This forces every picked RGBA color opaque before the non-gradient branch returns it, so disabling gradients silently discards the alpha selected in the picker. Should the opaque normalization happen only before computed gradient opacity is appended?
There was a problem hiding this comment.
Confirmed, the opaque override is now gated behind alpha === false instead of applying unconditionally, so disabling gradients no longer clobbers the picked alpha.
|
/review |
There was a problem hiding this comment.
Code Review Agent Run #82aa23
Actionable Suggestions - 1
-
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.tsx - 1
- Unnecessary type guard · Line 205-205
Additional Suggestions - 6
-
superset-frontend/src/explore/components/controls/ColorPickerControl.tsx - 2
-
Case-sensitive key lookup · Line 104-105In `toDisplayHex`, the check `value in SPECIAL_COLORS` (line 105) is case-sensitive. If a caller passes 'red' instead of 'Red', the SPECIAL_COLORS lookup will fail. Consider using `toLowerCase()` for case-insensitive matching or documenting the required casing.
-
Double type assertion bypasses safety · Line 135-135The `extractThemeColors` function uses `as unknown as Record` at line 135 to cast the theme object. This double cast bypasses TypeScript's type checking and could hide type errors if the theme structure changes. Consider using a more specific type assertion or validating the cast.
-
-
superset-frontend/src/explore/components/controls/ConditionalFormattingControl/constants.ts - 1
-
Breaking API rename without alias · Line 68-68Renaming `colorSchemeOptions` to `colorScheme` creates a breaking change risk for any external consumers importing the old name. Consider adding `export const colorSchemeOptions = colorScheme;` as a backward-compatible alias.
-
-
superset-frontend/packages/superset-ui-chart-controls/test/utils/getColorFormatters.test.ts - 1
-
Weak test assertion · Line 1029-1041The test 'should preserve alpha from colorScheme when useGradient is false' only uses negative assertions (`not.toBe`). While the implementation correctly preserves alpha (returning `#ff000080` for `a: 0.5`), the test name suggests it intends to verify alpha preservation but doesn't assert the actual preserved value. A positive assertion would make the test's intent explicit and fail if the implementation changes.
-
-
superset-frontend/packages/superset-ui-chart-controls/src/types.ts - 1
-
Type consistency across packages · Line 495-495The `colorScheme` field uses `RgbaColor | string`, but the companion file `ConditionalFormattingControl/types.ts` uses `RGBColor | string` for the same conceptual field. These types have structural differences (`a` required vs optional), which could cause type mismatch issues when passing objects between these related modules.
-
-
superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.test.tsx - 1
-
Misleading test name · Line 116-116Test name 'renders None for operator when Green for increase is selected' no longer reflects actual behavior. The test now interacts with a color picker UI and selects a preset color, not the legacy 'Green for increase' option.
-
Filtered by Review Rules
Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.
-
superset-frontend/src/explore/components/controls/ColorPickerControl.test.tsx - 1
- Missing await on async click · Line 79-79
Review Details
-
Files reviewed - 18 · Commit Range:
19151d1..14caf7f- superset-frontend/packages/superset-ui-chart-controls/src/types.ts
- superset-frontend/packages/superset-ui-chart-controls/src/utils/getColorFormatters.ts
- superset-frontend/packages/superset-ui-chart-controls/test/utils/getColorFormatters.test.ts
- superset-frontend/packages/superset-ui-core/src/color/utils.ts
- superset-frontend/packages/superset-ui-core/test/color/utils.test.ts
- superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx
- superset-frontend/plugins/plugin-chart-ag-grid-table/test/controlPanel.test.tsx
- superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.tsx
- superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
- superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx
- superset-frontend/plugins/plugin-chart-table/src/transformProps.ts
- superset-frontend/plugins/plugin-chart-table/test/controlPanel.test.tsx
- superset-frontend/src/explore/components/controls/ColorPickerControl.test.tsx
- superset-frontend/src/explore/components/controls/ColorPickerControl.tsx
- superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.test.tsx
- superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.tsx
- superset-frontend/src/explore/components/controls/ConditionalFormattingControl/constants.ts
- superset-frontend/src/explore/components/controls/ConditionalFormattingControl/types.ts
-
Files skipped - 0
-
Tools
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
- Eslint (Linter) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
-
/review- Manually triggers a full AI review. -
/pause- Pauses automatic reviews on this pull request. -
/resume- Resumes automatic reviews. -
/resolve- Marks all Bito-posted review comments as resolved. -
/abort- Cancels all in-progress reviews.
Refer to the documentation for additional commands.
Configuration
This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].
Documentation & Help
There was a problem hiding this comment.
Code Review Agent Run #72427f
Actionable Suggestions - 1
-
superset-frontend/src/explore/components/controls/ConditionalFormattingControl/types.ts - 1
- Type mismatch: RGBColor vs string consumers · Line 36-36
Additional Suggestions - 1
-
superset-frontend/packages/superset-ui-core/test/color/utils.test.ts - 1
-
Missing 3-digit hex test · Line 130-146The `forceHexAlpha` describe block (lines 130-146) covers 6-digit, 8-digit, and RGBColor inputs, but omits 3-digit hex strings. Calling `forceHexAlpha('#f00')` produces `#f0099` where the RGB portion remains 1-digit per channel, violating the expected `#rrggbb` format. Add a test case to catch this behavior gap.
-
Filtered by Review Rules
Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.
-
superset-frontend/packages/superset-ui-chart-controls/src/utils/getColorFormatters.ts - 1
- CWE-20: Missing Function Import · Line 22-22
-
superset-frontend/packages/superset-ui-chart-controls/test/utils/getColorFormatters.test.ts - 2
- Incorrect test assertion · Line 956-968
- Weak test assertions · Line 1029-1041
Review Details
-
Files reviewed - 18 · Commit Range:
19151d1..14caf7f- superset-frontend/packages/superset-ui-chart-controls/src/types.ts
- superset-frontend/packages/superset-ui-chart-controls/src/utils/getColorFormatters.ts
- superset-frontend/packages/superset-ui-chart-controls/test/utils/getColorFormatters.test.ts
- superset-frontend/packages/superset-ui-core/src/color/utils.ts
- superset-frontend/packages/superset-ui-core/test/color/utils.test.ts
- superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx
- superset-frontend/plugins/plugin-chart-ag-grid-table/test/controlPanel.test.tsx
- superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.tsx
- superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
- superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx
- superset-frontend/plugins/plugin-chart-table/src/transformProps.ts
- superset-frontend/plugins/plugin-chart-table/test/controlPanel.test.tsx
- superset-frontend/src/explore/components/controls/ColorPickerControl.test.tsx
- superset-frontend/src/explore/components/controls/ColorPickerControl.tsx
- superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.test.tsx
- superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.tsx
- superset-frontend/src/explore/components/controls/ConditionalFormattingControl/constants.ts
- superset-frontend/src/explore/components/controls/ConditionalFormattingControl/types.ts
-
Files skipped - 0
-
Tools
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
- Eslint (Linter) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
-
/review- Manually triggers a full AI review. -
/pause- Pauses automatic reviews on this pull request. -
/resume- Resumes automatic reviews. -
/resolve- Marks all Bito-posted review comments as resolved. -
/abort- Cancels all in-progress reviews.
Refer to the documentation for additional commands.
Configuration
This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].
Documentation & Help
There was a problem hiding this comment.
Code Review Agent Run #be1e9b
Actionable Suggestions - 1
-
superset-frontend/packages/superset-ui-chart-controls/src/types.ts - 1
- CWE-20: Type change makes alpha property optional · Line 495-498
Review Details
-
Files reviewed - 5 · Commit Range:
14caf7f..7943a00- superset-frontend/packages/superset-ui-chart-controls/src/types.ts
- superset-frontend/packages/superset-ui-chart-controls/src/utils/getColorFormatters.ts
- superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.tsx
- superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
- superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx
-
Files skipped - 0
-
Tools
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
- Eslint (Linter) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
-
/review- Manually triggers a full AI review. -
/pause- Pauses automatic reviews on this pull request. -
/resume- Resumes automatic reviews. -
/resolve- Marks all Bito-posted review comments as resolved. -
/abort- Cancels all in-progress reviews.
Refer to the documentation for additional commands.
Configuration
This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].
Documentation & Help
| targetValueLeft?: number; | ||
| targetValueRight?: number; | ||
| column?: string; | ||
| colorScheme?: string; | ||
| colorScheme?: RGBColor | string; |
There was a problem hiding this comment.
The ConditionalFormattingConfig.colorScheme type is being changed from RgbaColor to RGBColor. These are semantically different: RgbaColor requires the a (alpha) field while RGBColor marks it optional. Code in getColorFormatters.ts accesses .a on colorScheme objects without guarding for undefined (lines 308, 313). Changing the type to make a optional risks runtime errors when existing code passes objects without an alpha value. Import both types and keep the original RgbaColor binding to preserve the original contract. (See also: CWE-20)
Code Review Run #be1e9b
Should Bito avoid suggestions like this for future reviews? (Manage Rules)
- Yes, avoid them
There was a problem hiding this comment.
I think this is a false positive, rgbaToHex already destructures with a default (const { r, g, b, a = 1 } = rgb), so nothing accesses .a unguarded even with the looser RGBColor type.
There was a problem hiding this comment.
The reviewer's concern regarding the a (alpha) property is valid in the context of type safety, but your observation about the destructuring pattern is correct. Since rgbaToHex (and similar utility functions) typically use const { r, g, b, a = 1 } = rgb;, the code safely handles cases where a is undefined by providing a default value of 1. This pattern effectively mitigates the risk of runtime errors when transitioning from a strict RgbaColor type to a more flexible RGBColor type where a is optional.
- rgbaToHex now clamps RGB channels to 0-255 and alpha to 0-1 so out-of-range persisted values can't produce malformed hex strings. - forceHexAlpha expands shorthand hex (#rgb/#rgba) before appending the alpha channel, avoiding invalid 5-digit CSS colors. - Pivot table's transformProps now filters out the Green/Red trend-color tokens before calling getColorFormatters, matching the Table chart's existing filter, since only Table chart's own comparison-aware formatter resolves those tokens. Co-Authored-By: Claude <[email protected]>
Code Review Agent Run #b2c8eaActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Code Review Agent Run #84babdActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |

SUMMARY
This PR replaces the color selection dropdown in conditional formatting with a color picker.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
Run test
superset-frontend/src/explore/components/controls/ColorPickerControl.test.tsx
superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.test.tsx
superset-frontend/packages/superset-ui-chart-controls/test/utils/getColorFormatters.test.ts
superset-frontend/packages/superset-ui-core/test/color/utils.test.ts
ADDITIONAL INFORMATION