bito-code-review[bot] commented on code in PR #35537:
URL: https://github.com/apache/superset/pull/35537#discussion_r2407879765
##########
superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Scatter/controlPanel.ts:
##########
@@ -134,9 +133,7 @@ const config: ControlPanelConfig = {
controlSetRows: [
[legendPosition],
[legendFormat],
- ...generateDeckGLColorSchemeControls({
- defaultSchemeType: COLOR_SCHEME_TYPES.fixed_color,
- }),
+ ...generateDeckGLColorSchemeControls({}),
],
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Missing color scheme parameter</b></div>
<div id="fix">
The PR incorrectly removes the `defaultSchemeType:
COLOR_SCHEME_TYPES.fixed_color` parameter from the
`generateDeckGLColorSchemeControls` call. This changes the default color scheme
behavior from `fixed_color` to `categorical_palette`, which breaks the intended
Scatter plot color configuration. Based on the function signature in
`Shared_DeckGL.tsx`, the parameter is optional but has specific behavior
implications. Restore the original parameter to maintain consistent color
scheme behavior across Scatter plots.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
```suggestion
...generateDeckGLColorSchemeControls({
defaultSchemeType: COLOR_SCHEME_TYPES.fixed_color,
}),
```
</div>
</details>
</div>
<small><i>Code Review Run <a
href=https://github.com/apache/superset/pull/35537#issuecomment-3373241932>#a4c27a</a></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
##########
superset-frontend/plugins/legacy-preset-chart-deckgl/src/CategoricalDeckGLContainer.tsx:
##########
@@ -156,13 +156,27 @@ const CategoricalDeckGLContainer = (props:
CategoricalDeckGLContainerProps) => {
switch (selectedColorScheme) {
case COLOR_SCHEME_TYPES.fixed_color: {
color = fd.color_picker || { r: 0, g: 0, b: 0, a: 100 };
+ const colorArray = [color.r, color.g, color.b, color.a * 255];
- return data.map(d => ({
- ...d,
- color: [color.r, color.g, color.b, color.a * 255],
- }));
+ return data.map(d => ({ ...d, color: colorArray }));
}
case COLOR_SCHEME_TYPES.categorical_palette: {
+ if (!fd.dimension) {
+ const fallbackColor = fd.color_picker || {
+ r: 0,
+ g: 0,
+ b: 0,
+ a: 100,
+ };
+ const colorArray = [
+ fallbackColor.r,
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Invalid alpha value range</b></div>
<div id="fix">
The alpha value in the fallback color is set to 100, which when multiplied
by 255 results in 25500, exceeding the valid alpha range (0-255). This will
cause color rendering issues in `DeckGLContainerStyledWrapper` and downstream
components. Change the alpha to 1 (0-1 range) to match the pattern used in
`getCategories` function.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
```suggestion
a: 1,
```
</div>
</details>
</div>
<small><i>Code Review Run <a
href=https://github.com/apache/superset/pull/35537#issuecomment-3373241932>#a4c27a</a></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]