Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions apps/web/src/components/chat/ThreadActivityPopover.browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand All @@ -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);
}
Expand Down
6 changes: 4 additions & 2 deletions apps/web/src/components/chat/ThreadActivityPopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
Loading