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


##########
superset-frontend/plugins/plugin-chart-echarts/src/Pie/transformProps.ts:
##########
@@ -592,7 +599,10 @@ export default function transformProps(
         legendOrientation,
         showLegend,
         theme,
+        false,
+        legendState,
       ),
+      scrollDataIndex: legendIndex || 0,
       data: legendData,

Review Comment:
   ✅ **CodeAnt verified this suggestion was addressed in subsequent commits and 
marked this thread resolved** as of `8d167f8`.
   
   The legend scroll index is now computed through getLegendScrollDataIndex 
with the current legendData.length, preventing a stale saved index from 
exceeding the available entries.
   
   <sub>If that's not right, unresolve this thread and CodeAnt will leave it 
open.</sub>
   
   <!-- codeant-auto-resolve-reply -->



##########
superset-frontend/plugins/plugin-chart-echarts/src/Gantt/EchartsGantt.tsx:
##########
@@ -44,23 +47,19 @@ export default function EchartsGantt(props: 
EchartsGanttChartTransformedProps) {
     setExtraHeight(updatedHeight);
   }, [formData.showExtraControls]);
 
-  const eventHandlers: EventHandlers = {
-    legendselectchanged: payload => {
+  const deferLegendStateChange = useCallback(
+    (legendState: LegendState) => {
       requestAnimationFrame(() => {
-        onLegendStateChanged?.(payload.selected);
+        onLegendStateChanged?.(legendState);
       });

Review Comment:
   ✅ **CodeAnt verified this suggestion was addressed in subsequent commits and 
marked this thread resolved** as of `8d167f8`.
   
   The scheduled animation frame is tracked and cancelled both before 
scheduling a replacement frame and during component unmount cleanup.
   
   <sub>If that's not right, unresolve this thread and CodeAnt will leave it 
open.</sub>
   
   <!-- codeant-auto-resolve-reply -->



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