From 242d0bacfce5227b7ea569a74106227b0ccf8ad8 Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Wed, 4 Nov 2026 07:16:24 +0100 Subject: [PATCH] fix: keep toasts at the bottom instead of over the composer's close button --- components/ui/__tests__/toast-layout.test.tsx | 19 +++++++++++++++++++ components/ui/toast.tsx | 18 +++++++++++++----- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/components/ui/__tests__/toast-layout.test.tsx b/components/ui/__tests__/toast-layout.test.tsx index a421af676..335d03634 100644 --- a/components/ui/__tests__/toast-layout.test.tsx +++ b/components/ui/__tests__/toast-layout.test.tsx @@ -208,6 +208,25 @@ describe('toasts and the focused element', () => { expect(toastContainer()).not.toHaveAttribute('data-dodging'); }); + // With the focus in the composer's text or the quick reply box, "Email + // sent" and "Sending in 5 seconds" moved to the top and covered the + // composer's close button and the reader's toolbar. A large field the + // stack only overlaps at a corner keeps the toasts at the bottom. + it('stays at the bottom over a corner of a large focused field', () => { + const h = window.innerHeight; + vi.spyOn(HTMLElement.prototype, 'getBoundingClientRect').mockImplementation(function (this: HTMLElement) { + if (this.hasAttribute('data-toast-container')) return rect(h - 100, 600, 360, 80); + if (this.id === 'body') return rect(h - 400, 300, 700, 360); + return rect(10, 10, 80, 36); + }); + render(<>