codeant-ai-for-open-source[bot] commented on code in PR #42882:
URL: https://github.com/apache/superset/pull/42882#discussion_r3733973905
##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts:
##########
@@ -467,9 +467,17 @@ export function transformSeries(
return formatter(numericValue);
}
if (!onlyTotal) {
+ // A zero-height stacked segment has no meaningful position to
+ // attach a label to: it starts and ends at the same y-coordinate
+ // as the top of the previous segment, so its label would render
+ // directly on top of that segment's own label. Requiring a
+ // strictly positive value keeps this independent of the
+ // configured percentage threshold, whose default of 0 would
+ // otherwise let a value of exactly 0 pass (#42702).
if (
+ numericValue > 0 &&
numericValue >=
- (thresholdValues[dataIndex] || Number.MIN_SAFE_INTEGER)
+ (thresholdValues[dataIndex] || Number.MIN_SAFE_INTEGER)
Review Comment:
**Suggestion:** The strictly-positive guard suppresses every negative
stacked-segment label, even when the configured percentage threshold allows it.
Negative values have a nonzero segment position and the previous comparison
could legitimately render them, particularly when the stacked total and
threshold are negative. Restrict the new guard to excluding exactly zero while
preserving the existing threshold behavior for negative values. [logic error]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ⚠️ Negative stacked segment labels disappear under negative totals.
- ⚠️ Configured percentage thresholds no longer preserve prior behavior.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=f84480d09d994d328b96a28ee2fd45b0&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=f84480d09d994d328b96a28ee2fd45b0&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/plugin-chart-echarts/src/Timeseries/transformers.ts
**Line:** 477:480
**Comment:**
*Logic Error: The strictly-positive guard suppresses every negative
stacked-segment label, even when the configured percentage threshold allows it.
Negative values have a nonzero segment position and the previous comparison
could legitimately render them, particularly when the stacked total and
threshold are negative. Restrict the new guard to excluding exactly zero while
preserving the existing threshold behavior for negative values.
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%2F42882&comment_hash=2020de3a74e56c3f6bbe1cfb6e20ea64e77fe75b00210caf4167b7a00f0759a8&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42882&comment_hash=2020de3a74e56c3f6bbe1cfb6e20ea64e77fe75b00210caf4167b7a00f0759a8&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]