rusackas commented on code in PR #42910:
URL: https://github.com/apache/superset/pull/42910#discussion_r4362311026


##########
superset/mcp_service/chart/preview_utils.py:
##########
@@ -2773,18 +2809,24 @@ def threshold_details(
         )
 
     layers: list[dict[str, Any]] = []
+    # Custom colors (if any) are authored positionally against the original,
+    # pre-sort `ranges` order via the `range_colors` control -- capture each
+    # range's color here, before the descending sort below reorders them.
+    # Mirrors Bullet/transformProps.ts exactly, so the MCP preview matches
+    # what Explore actually renders for the saved chart.
     range_entries = sorted(
         [
             (
                 threshold,
                 label_at(model.range_labels, index, threshold, "Range"),
+                model.range_colors[index] if index < len(model.range_colors) 
else "",

Review Comment:
   @sadpandajoe good catch. The preview now drops `range_colors` unless 
`ranges` was user-entered, so the synthesized band uses the default fill like 
Explore. Added a test.



##########
superset-frontend/src/explore/components/controls/ColorPickerControl.tsx:
##########


Review Comment:
   @SBIN2010 yes. With `resolveThemeTokens` on, the presets now go through 
`toDisplayHex`, so the Green chip matches the trigger hex.



-- 
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]

Reply via email to