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


##########
superset-frontend/src/components/MessageToasts/ToastPresenter.tsx:
##########
@@ -39,6 +39,9 @@ const StyledToastPresenter = styled.div<VisualProps>(
 
     height: calc(100vh - 100px);
 
+    /* Full-height overlay: pass clicks through empty area; toasts re-enable 
below. */
+    pointer-events: none;

Review Comment:
   **Suggestion:** Setting `pointer-events: none` on the entire fixed presenter 
also disables pointer interaction with the presenter's own scroll container 
(including scrollbar thumb/track), so when many toasts overflow the viewport 
users can lose direct mouse-based scrolling of the toast stack. Keep 
click-through behavior only for truly empty overlay space (for example via a 
separate wrapper layer) while preserving pointer events on the actual 
scrollable presenter element. [css layout issue]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ❌ Users cannot drag toast stack scrollbar with mouse.
   - ⚠️ Reviewing many historical toasts becomes cumbersome when overflowing 
viewport.
   - ⚠️ Embedded dashboards toast UX degraded for long-running sessions.
   ```
   </details>
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. In the embedded dashboard entrypoint at
   `superset-frontend/src/embedded/index.tsx:69-86`, note that `EmbeddedRoute` 
renders
   `<ToastContainer position="top" />` (line 85), which in turn connects Redux
   `messageToasts` state to `ToastPresenter` via `ToastContainer` in
   `src/components/MessageToasts/ToastContainer.tsx:21-28`.
   
   2. `ToastPresenter` renders the fixed, full-height scroll container 
`StyledToastPresenter`
   in `src/components/MessageToasts/ToastPresenter.tsx:27-53`, which is styled 
with `height:
   calc(100vh - 100px);` and `overflow-y: auto;` (lines 40 and 49), so when 
many toasts exist
   (from `messageToastsReducer` in 
`src/components/MessageToasts/reducers.ts:36-45`), the
   container becomes vertically scrollable with a scrollbar 
(`&::-webkit-scrollbar` at lines
   67-83).
   
   3. The same styled block sets `pointer-events: none;` on the presenter at
   `ToastPresenter.tsx:42-43`, and only re-enables pointer events on `.toast` 
children at
   `ToastPresenter.tsx:95-102` (`.toast { pointer-events: auto; ... }`), 
meaning the scroll
   container box and its scrollbar track/thumb (not children) do not receive 
pointer events
   while the empty overlay area passes clicks through to underlying UI.
   
   4. Run the frontend, navigate to any route that mounts `<ToastContainer />` 
(e.g. the
   embedded dashboard route above or Storybook `InteractiveCopyToClipboard` 
which renders
   `<ToastContainer />` in
   `src/components/CopyToClipboard/CopyToClipboard.stories.tsx:7-11`), trigger 
enough toasts
   via any `addSuccessToast`/`addDangerToast` usage (e.g. dashboard save 
success at
   `src/dashboard/actions/dashboardState.ts:545-547`), so that the toast stack 
overflows and
   shows a scrollbar, then attempt to click or drag the scrollbar thumb of
   `#toast-presenter`: because `pointer-events: none` is set on the scroll 
container, those
   mouse interactions are ignored or passed to underlying content instead of 
scrolling the
   toast stack, preventing direct mouse-based scrollbar control of the toasts.
   ```
   </details>
   
   [Fix in 
Cursor](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=c04b0b1194dd4401abffa3a70f92dd46&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 | [Fix in VSCode 
Claude](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=c04b0b1194dd4401abffa3a70f92dd46&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/src/components/MessageToasts/ToastPresenter.tsx
   **Line:** 42:43
   **Comment:**
        *Css Layout Issue: Setting `pointer-events: none` on the entire fixed 
presenter also disables pointer interaction with the presenter's own scroll 
container (including scrollbar thumb/track), so when many toasts overflow the 
viewport users can lose direct mouse-based scrolling of the toast stack. Keep 
click-through behavior only for truly empty overlay space (for example via a 
separate wrapper layer) while preserving pointer events on the actual 
scrollable presenter element.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve 
this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask 
user if the user wants to fix the rest of the comments as well. if said yes, 
then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40805&comment_hash=165f053ddfc187d085428674d9d7315e0cf0bcaa259c08dc1f815ac512404c23&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40805&comment_hash=165f053ddfc187d085428674d9d7315e0cf0bcaa259c08dc1f815ac512404c23&reaction=dislike'>👎</a>



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