codeant-ai-for-open-source[bot] commented on code in PR #42563:
URL: https://github.com/apache/superset/pull/42563#discussion_r3673754175


##########
superset-frontend/src/components/Chart/DrillDetail/DrillDetailModal.tsx:
##########
@@ -108,6 +111,19 @@ export default function DrillDetailModal({
     findPermission('can_explore', 'Superset', state.user?.roles),
   );
 
+  // Unlike DrillByModal, this component stays mounted for the lifetime of the
+  // chart and is toggled via `showModal`, so the event is gated on the modal
+  // actually being opened rather than firing on mount.
+  useEffect(() => {
+    if (showModal) {
+      dispatch(
+        logEvent(LOG_ACTIONS_DRILL_TO_DETAIL_MODAL_OPENED, {
+          slice_id: chartId,
+        }),
+      );
+    }
+  }, [dispatch, showModal, chartId]);

Review Comment:
   ✅ **Customized review instruction saved!**
   
   **Instruction:**
   > Do not flag duplicate modal-open analytics caused by chart identity 
changes when each modal instance has a chart ID fixed for its lifetime; only 
flag this when a modal instance can be reused across charts while remaining 
open.
   
   **Applied to:**
     - `superset-frontend/src/components/Chart/DrillDetail/DrillDetailModal.tsx`
   
   ---
   💡 *To manage or update this instruction, visit: [CodeAnt AI 
Settings](https://app.codeant.ai/org/settings/learnings)*



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