Copilot commented on code in PR #40805:
URL: https://github.com/apache/superset/pull/40805#discussion_r3364313612


##########
superset-frontend/src/components/MessageToasts/ToastPresenter.test.tsx:
##########
@@ -47,3 +47,12 @@ test('should pass removeToast to the Toast component', async 
() => {
   fireEvent.click(getAllByTestId('close-button')[0]);
   await waitFor(() => expect(removeToast).toHaveBeenCalledTimes(1));
 });
+
+test('presenter caps its height with max-height so it hugs the toasts', () => {
+  // A fixed `height` would make the fixed overlay span the viewport and block
+  // controls underneath it; `max-height` lets it shrink to the toasts while
+  // still scrolling when they overflow.
+  const presenter = setup().container.querySelector('#toast-presenter');
+  expect(presenter).toHaveStyleRule('max-height', 'calc(100vh - 100px)');
+  expect(presenter).not.toHaveStyleRule('height', 'calc(100vh - 100px)');

Review Comment:
   `querySelector('#toast-presenter')` can return null; adding an explicit 
presence assertion makes failures clearer and avoids running style matchers on 
a null value.



##########
superset-frontend/src/components/MessageToasts/ToastPresenter.tsx:
##########
@@ -37,7 +37,9 @@ const StyledToastPresenter = styled.div<VisualProps>(
     z-index: ${theme.zIndexPopupBase + 1};
     word-break: break-word;
 
-    height: calc(100vh - 100px);
+    /* Cap height for scrolling, but hug the toasts so the fixed overlay does 
not
+       reserve the full viewport and block controls underneath it. */
+    max-height: calc(100vh - 100px);

Review Comment:
   The PR description and testing instructions state the fix uses 
`pointer-events: none` on the presenter container and `pointer-events: auto` on 
each toast. The actual code change here instead replaces a fixed `height` with 
`max-height` (and the new test asserts that), so the PR metadata no longer 
matches the implementation. Please update the PR description/title/testing 
steps to reflect the `max-height` approach (or adjust the code to match the 
documented `pointer-events` behavior).



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