diff --git a/apps/web/src/components/chat/ThreadActivityPopover.browser.tsx b/apps/web/src/components/chat/ThreadActivityPopover.browser.tsx index 637e61038..15b2b051c 100644 --- a/apps/web/src/components/chat/ThreadActivityPopover.browser.tsx +++ b/apps/web/src/components/chat/ThreadActivityPopover.browser.tsx @@ -149,6 +149,17 @@ describe("ThreadActivityPopover", () => { expect(Math.round(window.innerWidth - box.right)).toBe(12); }); + // A strip down the screen's right side (an iPhone Duo's status dock): + // the panel stops the same distance short of it, Stop out from under it. + const strip = 85; + document.documentElement.style.setProperty("--safe-area-right", `${strip}px`); + await vi.waitFor(() => { + const box = popupBox(); + expect(Math.round(box.left)).toBe(12); + expect(Math.round(window.innerWidth - strip - box.right)).toBe(12); + }); + document.documentElement.style.removeProperty("--safe-area-right"); + await page.viewport(1200, 800); // Wider, it hangs from its button, and the open panel moves with it. await vi.waitFor(() => { @@ -159,6 +170,7 @@ describe("ThreadActivityPopover", () => { expect(box.width).toBeLessThanOrEqual(480); }); } finally { + document.documentElement.style.removeProperty("--safe-area-right"); await mounted.unmount(); await page.viewport(1_600, 1_300); } diff --git a/apps/web/src/components/chat/ThreadActivityPopover.tsx b/apps/web/src/components/chat/ThreadActivityPopover.tsx index fe8f6b10e..a67c42005 100644 --- a/apps/web/src/components/chat/ThreadActivityPopover.tsx +++ b/apps/web/src/components/chat/ThreadActivityPopover.tsx @@ -110,10 +110,12 @@ const ACTIVITY_POPOVER_COLLISION_AVOIDANCE = { align: "shift" } as const; * 30rem). The width then changes in the same layout the positioner reads, so * the open panel stays put against its button while the window resizes, * with no remount (which would replay its entrance and close any steps the - * reader unfolded). + * reader unfolded). The screen's side strips (an iPhone Duo's status dock, + * sideStrips.ts) come out of the space it spans, the way they come out of its + * collision padding, so its Stop buttons never sit under the dock. */ const ACTIVITY_POPOVER_WIDTH_CLASS_NAME = - "w-[clamp(20rem,36vw,30rem)] max-w-[calc(100vw-1.5rem)] max-sm:w-[calc(100vw-1.5rem)]"; + "w-[clamp(20rem,36vw,30rem)] max-w-[calc(100vw-1.5rem-var(--safe-area-left)-var(--safe-area-right))] max-sm:w-[calc(100vw-1.5rem-var(--safe-area-left)-var(--safe-area-right))]"; /** Plans up to this long draw one block per step on the top-bar button; * longer ones draw a single bar. */