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


##########
superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx:
##########
@@ -188,14 +188,21 @@ export const DataTablesPane = ({
     queryForce,
     ownState,
     isRequest: isRequest.results,
-    setForceQuery,
-    isVisible: ResultTypes.Results === activeTabKey,
     canDownload,
-  }).map((pane, idx) => ({
-    key: idx === 0 ? ResultTypes.Results : `${ResultTypes.Results} ${idx + 1}`,
-    label: idx === 0 ? t('Results') : t('Results %s', idx + 1),
-    children: pane,
-  }));
+  }).map((pane, idx) => {
+      const tabKey =
+        idx === 0 ? ResultTypes.Results : `${ResultTypes.Results} ${idx + 1}`;
+    
+      return {
+        key: tabKey,
+        label: idx === 0 ? t('Results') : t('Results %s', idx + 1),
+        children:
+          activeTabKey === tabKey ? (
+            pane
+          ) : null,
+      };
+    });
+

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>State Loss on Tab Switch</b></div>
   <div id="fix">
   
   Conditional rendering of tab children may cause loss of local state (e.g., 
filterText in SingleQueryResultPane) when switching tabs, as components 
unmount. This changes observable behavior from previous always-rendered tabs.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #1ba5c9</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