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


##########
superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterOption/index.tsx:
##########
@@ -59,14 +60,16 @@ export default function AdhocFilterOption({
       operators={operators}
       adhocFilter={adhocFilter}
       options={options}
-      datasource={datasource}
+      datasource={datasource as Record<string, unknown> || {}}
       onFilterEdit={onFilterEdit}
-      partitionColumn={partitionColumn}
+      partitionColumn={partitionColumn ?? undefined}
     >
       <OptionControlLabel
         label={actualTimeRange ?? adhocFilter.getDefaultLabel()}
         tooltipTitle={title ?? adhocFilter.getTooltipTitle()}
-        onRemove={onRemoveFilter}
+        onRemove={() =>
+          onRemoveFilter({} as React.MouseEvent<Element, MouseEvent>)
+        }

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Runtime Error: Fake MouseEvent Lacks Methods</b></div>
   <div id="fix">
   
   This change passes an empty object cast as a React.MouseEvent to 
onRemoveFilter, but the fake event lacks the stopPropagation method that the 
parent expects, leading to a runtime TypeError when users click to remove 
filters. The underlying issue is a type mismatch in OptionControlLabel where 
onRemove is typed as () => void but receives a MouseEvent from onClick. 
Consider updating the component's interface to properly accept the event.
   </div>
   
   
   </div>
   
   <details>
   <summary><b>Citations</b></summary>
   <ul>
   
   <li>
   Rule Violated: <a 
href="https://github.com/apache/superset/blob/615d63d/.cursor/rules/dev-standard.mdc#L16";>dev-standard.mdc:16</a>
   </li>
   
   </ul>
   </details>
   
   
   
   
   <small><i>Code Review Run #6677b1</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