From eb65a4ead383f593b877097e4d1f53b32ad477dd Mon Sep 17 00:00:00 2001 From: Badcuban <108198679+badcuban@users.noreply.github.com> Date: Mon, 16 Nov 2026 10:33:37 -0500 Subject: [PATCH] fix(web): the background runs list keeps clear of the iPhone Duo's dock On a phone the list of background runs spans the screen between 12px gutters, a width set in CSS from 100vw. It ignored the screen's side strips, so on the folded iPhone Duo it ran about 85px under the status dock down the right edge, hiding each run's Stop button and the count. The width now takes --safe-area-left and --safe-area-right out of the space it spans, matching the collision padding the positioner already adds for the strips. Screens without strips are unchanged; the open Duo already fit. The phone-width browser test adds an 85px strip and checks the list stops 12px short of it. --- .../chat/ThreadActivityPopover.browser.tsx | 12 ++++++++++++ .../src/components/chat/ThreadActivityPopover.tsx | 6 ++++-- 2 files changed, 16 insertions(+), 2 deletions(-) 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. */