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


##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/TimeseriesLegend.tsx:
##########
@@ -134,18 +150,31 @@ export type TimeseriesLegendProps = 
TimeseriesCustomLegend & {
 function TimeseriesLegend({
   items,
   maxHeight,
+  maxWidth,
   onAll,
   onHover,
   onInverse,
   onToggle,
+  orientation,
   showSelectors,
 }: TimeseriesLegendProps) {
-  if (items.length === 0 || maxHeight <= 0) {
+  const isVertical =
+    orientation === 'left' || orientation === 'right';
+
+  const isEmpty = items.length === 0;
+  const noSpace =
+    isVertical ? (maxWidth !== undefined && maxWidth <= 0) : maxHeight <= 0;
+
+  if (isEmpty || noSpace) {
     return null;
   }
 
   return (
-    <LegendViewport data-test="timeseries-custom-legend" maxHeight={maxHeight}>
+    <LegendViewport
+      data-test="timeseries-custom-legend"
+      maxHeight={isVertical ? 0 : maxHeight}

Review Comment:
   ✅ **CodeAnt verified this suggestion was addressed in subsequent commits and 
marked this thread resolved** as of `d065af1`.
   
   `LegendViewport` now receives `maxHeight` for vertical as well as horizontal 
legends, retaining the computed height limit for left and right legends.
   
   <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