Copilot commented on code in PR #43180:
URL: https://github.com/apache/superset/pull/43180#discussion_r3797516405


##########
superset-frontend/packages/superset-ui-core/src/color/CategoricalColorScale.ts:
##########
@@ -207,6 +217,36 @@ class CategoricalColorScale extends ExtensibleFunction {
     return color;
   }
 
+  /**
+   * Colors that already belong to a label other than the given one, either
+   * because a custom label color forces them or because the shared dashboard
+   * color map assigned them. Such colors have an owner and must not be handed
+   * to a label that has no color yet.

Review Comment:
   The JSDoc here says reserved colors “must not be handed to a label that has 
no color yet”, but the implementation treats reservation as a best-effort 
preference (e.g. `getNextAvailableColor` will fall back to a reserved color 
once all unused non-reserved options are exhausted). Updating the comment to 
reflect “avoid when possible” will keep docs consistent with actual behavior 
and the intended trade-off described in the PR.



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