bito-code-review[bot] commented on code in PR #35897:
URL: https://github.com/apache/superset/pull/35897#discussion_r2784789237


##########
superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.tsx:
##########
@@ -355,6 +319,52 @@ export const FormattingPopoverContent = ({
     setPreviousColumnType(newColumnType);
   };
 
+  const handleAllColumnChange = (
+    value: string | ObjectFormattingEnum | undefined,
+  ) => {
+    setColumnFormating(value);
+  };
+  const numericColumns = useMemo(
+    () => allColumns.filter(col => col.dataType === GenericDataType.Numeric),
+    [allColumns],
+  );
+
+  const visibleUseGradient = useMemo(
+    () =>
+      numericColumns.length > 0
+        ? numericColumns.some((col: ColumnOption) => col.value === column)
+        : false,
+    [column],

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Incomplete useMemo dependencies</b></div>
   <div id="fix">
   
   The useMemo for visibleUseGradient uses numericColumns in its computation 
but omits it from the dependency array. This can cause the UI to show stale 
values if allColumns changes while the selected column remains the same, 
potentially displaying the 'Use gradient' checkbox incorrectly.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ````suggestion
           : false,
       [column, numericColumns],
   ````
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #fbfbc4</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



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