From 33cc0de97c52812199354bb28d712b04fd73019a Mon Sep 17 00:00:00 2001 From: Lotus CI Date: Sat, 17 Oct 2026 20:47:34 -0400 Subject: [PATCH] fix(calls): the call PiP no longer opens on top of the composer (#323) The first-use PiP position was bottom-right, 72px from the bottom: on desktop over Send, on phones over Send, Emoji and the message box, so the first thing you typed or tapped in the text room hit the call. Default to top-right under the room header instead. A dragged position is still remembered. Refs #323 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5 --- src/app/components/CallEmbedProvider.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/app/components/CallEmbedProvider.tsx b/src/app/components/CallEmbedProvider.tsx index 17e054da5..17fdfc1f8 100644 --- a/src/app/components/CallEmbedProvider.tsx +++ b/src/app/components/CallEmbedProvider.tsx @@ -89,6 +89,8 @@ import { zIndices } from '../styles/zIndex'; const PIP_MIN_W = 200; const PIP_MIN_H = 112; +/** Default PiP top: just below the 64px-ish room header. */ +const PIP_DEFAULT_TOP = 72; type Corner = 'se' | 'sw' | 'ne' | 'nw'; @@ -1046,8 +1048,11 @@ export function CallEmbedProvider({ children }: CallEmbedProviderProps) { el.style.left = `${Math.max(0, Math.min(savedPos.left, window.innerWidth - 280))}px`; el.style.top = `${Math.max(0, Math.min(savedPos.top, window.innerHeight - 158))}px`; } else { - el.style.left = `${window.innerWidth - 280 - 16}px`; - el.style.top = `${window.innerHeight - 158 - 72}px`; + // [Gitea #323] First use: top-right under the room header, over the + // timeline. Bottom-right sat on the composer (Send / Emoji, and on + // phones the whole message box), so typing landed on the call. + el.style.left = `${Math.max(0, window.innerWidth - 280 - 16)}px`; + el.style.top = `${PIP_DEFAULT_TOP}px`; } el.style.width = '280px'; el.style.height = '158px';