codeant-ai-for-open-source[bot] commented on code in PR #43397:
URL: https://github.com/apache/superset/pull/43397#discussion_r3831860431
##########
superset-frontend/plugins/plugin-chart-echarts/src/utils/eChartOptionsSchema.ts:
##########
@@ -386,7 +417,9 @@ export const tooltipSchema = z.object({
z.array(z.union([z.number(), z.string()])),
])
.optional(),
- formatter: z.string().optional(), // Only string formatters
+ // Only string formatters, and only markup-free ones: a string tooltip
+ // formatter is rendered via innerHTML (default renderMode 'html').
+ formatter: htmlFreeFormatterSchema.optional(),
Review Comment:
**Suggestion:** Rejecting every tooltip formatter containing `<` breaks
ECharts' supported HTML string formatter syntax, including benign layouts using
tags such as `<br/>` or `<b>`. This causes otherwise valid creator
configurations to fail validation and lose their tooltips; sanitize permitted
formatter content or use a safer rendering mode rather than rejecting all
markup. [api mismatch]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ⚠️ HTML-formatted ECharts tooltips are rejected.<br/>- ⚠️ Timeseries
custom options are discarded after validation failure.<br/>- ⚠️ Existing
ECharts specification compatibility is reduced.
```
</details>
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
<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/utils/eChartOptionsSchema.ts
**Line:** 422:422
**Comment:**
*Api Mismatch: Rejecting every tooltip formatter containing `<` breaks
ECharts' supported HTML string formatter syntax, including benign layouts using
tags such as `<br/>` or `<b>`. This causes otherwise valid creator
configurations to fail validation and lose their tooltips; sanitize permitted
formatter content or use a safer rendering mode rather than rejecting all
markup.
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%2F43397&comment_hash=122e0976f3a7cc08ce14c647dcb14aef9b3ea975827fa93921693ffcaf43f6ae&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43397&comment_hash=122e0976f3a7cc08ce14c647dcb14aef9b3ea975827fa93921693ffcaf43f6ae&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]