fix: people list crash + call embed positioning + debug logging

- millify.ts: use named import { millify as millifyPlugin } instead of
  default import to fix Rolldown CJS interop bug where zc.default gets
  set to the whole module object instead of the function (mode=1 forces
  default=n instead of default=n.default, breaking MembersDrawer)
- useCallEmbed.ts: use getBoundingClientRect() for accurate fixed
  positioning; add useEffect to trigger syncCallEmbedPlacement on mount
  so embed is positioned before the first resize event
- CallEmbedProvider.tsx: fix [pipMode, callVisible] effect to NOT clear
  top/left/width/height when callVisible changes (previously cleared
  position set by syncCallEmbedPlacement every time joined changed);
  only clear pip-specific styles when actually exiting pip; add debug
  console logging for positioning state

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lotus Bot
2026-05-22 22:48:39 -04:00
parent 14336ef2a3
commit e5110a13f8
3 changed files with 55 additions and 23 deletions
+13 -4
View File
@@ -154,12 +154,21 @@ export const useCallEmbedPlacementSync = (containerViewRef: RefObject<HTMLDivEle
const container = containerViewRef.current;
if (!embedEl || !container) return;
embedEl.style.top = `${container.offsetTop}px`;
embedEl.style.left = `${container.offsetLeft}px`;
embedEl.style.width = `${container.clientWidth}px`;
embedEl.style.height = `${container.clientHeight}px`;
const rect = container.getBoundingClientRect();
console.log('[CallEmbed] syncCallEmbedPlacement:', {
top: rect.top, left: rect.left, width: rect.width, height: rect.height,
});
embedEl.style.top = `${rect.top}px`;
embedEl.style.left = `${rect.left}px`;
embedEl.style.width = `${rect.width}px`;
embedEl.style.height = `${rect.height}px`;
}, [callEmbedRef, containerViewRef]);
// Sync once on mount so the embed is positioned immediately (deps are stable refs)
useEffect(() => {
syncCallEmbedPlacement();
}, [syncCallEmbedPlacement]);
useResizeObserver(
syncCallEmbedPlacement,
useCallback(() => containerViewRef.current, [containerViewRef]),