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


##########
superset-frontend/src/components/TableSelector/index.tsx:
##########
@@ -295,6 +314,28 @@ const TableSelector: FunctionComponent<TableSelectorProps> 
= ({
     setTableSelectValue(value);
   };
 
+  const openDatabaseSelectorModal = () => {
+    // Reset modal state to current values when opening
+    setModalDb(database);
+    setModalCatalog(currentCatalog);
+    setModalSchema(currentSchema);
+    setIsDatabaseSelectorModalOpen(true);
+  };
+
+  const handleModalOk = () => {
+    // Apply all modal selections to actual state
+    if (modalDb && modalDb !== database) {

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Logic inconsistency in modal change application</b></div>
   <div id="fix">
   
   The condition for applying database changes in the modal includes an extra 
'modalDb &&' check that prevents setting the database to null, unlike the 
conditions for catalog and schema. This inconsistency could block users from 
deselecting the database in sqlLabMode.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ````suggestion
       if (modalDb !== database) {
   ````
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #5e3291</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