codeant-ai-for-open-source[bot] commented on code in PR #42053:
URL: https://github.com/apache/superset/pull/42053#discussion_r3690609713


##########
superset-frontend/packages/superset-ui-chart-controls/src/utils/getColorFormatters.ts:
##########
@@ -270,19 +274,35 @@ export const getColorFunction = (
     if (compareResult === false) return undefined;
     const { cutoffValue, extremeValue } = compareResult;
 
+    if (typeof colorScheme === 'string') {
+      if (isSpecialColor(colorScheme)) {
+        return colorScheme;
+      }

Review Comment:
   **Suggestion:** Returning `Green` or `Red` unchanged bypasses the 
special-color rendering used by the pivot table. The pivot renderer passes this 
result directly to the cell style, so cells receive the opaque CSS named color 
instead of the intended translucent special color (`rgba(0,150,0,0.2)` or 
`rgba(150,0,0,0.2)`) and the corresponding readable text color. Resolve these 
special values before returning them, or filter them out for every renderer 
that does not implement trend-color handling. [api mismatch]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ❌ Pivot conditional formatting uses opaque Green/Red backgrounds.
   - ⚠️ Pivot text contrast is calculated from the wrong background.
   - ⚠️ Table renderers separately implement trend-color handling.
   ```
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=0c30f26cb48c411ab03397093b9c42d0&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=0c30f26cb48c411ab03397093b9c42d0&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/packages/superset-ui-chart-controls/src/utils/getColorFormatters.ts
   **Line:** 277:280
   **Comment:**
        *Api Mismatch: Returning `Green` or `Red` unchanged bypasses the 
special-color rendering used by the pivot table. The pivot renderer passes this 
result directly to the cell style, so cells receive the opaque CSS named color 
instead of the intended translucent special color (`rgba(0,150,0,0.2)` or 
`rgba(150,0,0,0.2)`) and the corresponding readable text color. Resolve these 
special values before returning them, or filter them out for every renderer 
that does not implement trend-color handling.
   
   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%2F42053&comment_hash=0271b51bbabf851f46285d17e442e315eb73de63d7dca85aee0670475ad90a53&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42053&comment_hash=0271b51bbabf851f46285d17e442e315eb73de63d7dca85aee0670475ad90a53&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]

Reply via email to