codeant-ai-for-open-source[bot] commented on code in PR #42921:
URL: https://github.com/apache/superset/pull/42921#discussion_r3741820935
##########
superset-frontend/plugins/preset-chart-deckgl/src/layers/Geojson/controlPanel.ts:
##########
@@ -44,6 +44,18 @@ import {
import { dndGeojsonColumn } from '../../utilities/sharedDndControls';
import { BLACK_COLOR } from '../../utilities/controls';
+// The shared fillColorPicker is only shown when a `color_scheme_type` control
is
+// set to "fixed color". The GeoJSON layer has no such control - features carry
+// their own colors and this picker acts as an override (set the opacity to 0
to
+// fall back to the feature's own fillColor) - so the gate is dropped here.
+const geojsonFillColorPicker = {
+ ...fillColorPicker,
+ config: {
+ ...fillColorPicker.config,
+ visibility: () => true,
+ },
+};
Review Comment:
**Suggestion:** The cloned control retains `fillColorPicker.config.default`,
which is `PRIMARY_COLOR` with full opacity. When the control panel materializes
this default for a GeoJSON chart, `getLayer` receives that value and replaces
every feature's own `fillColor` with the teal override by default. The
GeoJSON-specific control should default to a transparent color (or otherwise
remain unset) so feature-provided colors are preserved until the user
explicitly selects an override. [logic error]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ❌ GeoJSON features lose their configured fill colors by default.
- ⚠️ New GeoJSON charts render with the teal primary fill.
- ⚠️ The opacity-zero fallback is unavailable without manual adjustment.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=8192cd9c12e646ba81d6149869f84dee&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=8192cd9c12e646ba81d6149869f84dee&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:**
superset-frontend/plugins/preset-chart-deckgl/src/layers/Geojson/controlPanel.ts
**Line:** 51:57
**Comment:**
*Logic Error: The cloned control retains
`fillColorPicker.config.default`, which is `PRIMARY_COLOR` with full opacity.
When the control panel materializes this default for a GeoJSON chart,
`getLayer` receives that value and replaces every feature's own `fillColor`
with the teal override by default. The GeoJSON-specific control should default
to a transparent color (or otherwise remain unset) so feature-provided colors
are preserved until the user explicitly selects an override.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42921&comment_hash=a06f21aae68ee4814464eddccdfad728fcfe453dff08f61cfd4a92b8caff0181&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42921&comment_hash=a06f21aae68ee4814464eddccdfad728fcfe453dff08f61cfd4a92b8caff0181&reaction=dislike'>👎</a>
--
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]