Copilot commented on code in PR #44996:
URL: https://github.com/apache/superset/pull/44996#discussion_r4198341031


##########
superset-frontend/src/explore/components/controls/ComparisonRangeLabel.tsx:
##########
@@ -182,17 +182,15 @@ export const ComparisonRangeLabel = ({
     <>
       <ControlHeader label={t('Actual range for comparison')} />
       {labels.flat().map(label => (
-        <>
-          <div
-            css={theme => css`
-              font-size: ${theme.fontSize}px;
-              color: ${theme.colorText};
-            `}
-            key={label}
-          >
-            {label}
-          </div>
-        </>
+        <div
+          css={theme => css`
+            font-size: ${theme.fontSize}px;
+            color: ${theme.colorText};
+          `}
+          key={label}

Review Comment:
   Distinct shifts can produce identical labels. For a 30-day range, selecting 
both `inherit` and `30 days ago` produces the same offset twice; 
`fetchTimeRange` retains both results. Removing the Fragments makes these divs 
siblings with duplicate keys, triggering React warnings and potentially 
incorrect reconciliation when comparisons change. Include the entry index in 
the key so repeated labels remain distinct.



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