fix(chat): restore Facebook keyboard avoidance

This commit is contained in:
2026-07-16 16:28:10 +08:00
parent 9d04176e90
commit 54b9031622
10 changed files with 642 additions and 121 deletions
@@ -44,6 +44,8 @@ export interface ChatKeyboardDebugSnapshot {
activeFocused: boolean;
inputBarTop: number | null;
inputBarBottom: number | null;
inputBarPaddingBottom: string | null;
keyboardBottomInset: string | null;
appViewportHeight: string | null;
appVisibleHeight: string | null;
appVisibleOffsetTop: string | null;
@@ -157,7 +159,9 @@ function createChatKeyboardDebugSnapshot(
const platform = PlatformDetector.getPlatformInfo();
const browser = BrowserDetector.getBrowserInfo();
const rootStyle = document.documentElement.style;
const inputBarRect = containerRef.current?.getBoundingClientRect() ?? null;
const inputBar = containerRef.current;
const inputBarRect = inputBar?.getBoundingClientRect() ?? null;
const inputBarStyle = inputBar ? window.getComputedStyle(inputBar) : null;
return {
event,
@@ -187,6 +191,9 @@ function createChatKeyboardDebugSnapshot(
activeFocused: activeElement !== document.body,
inputBarTop: inputBarRect?.top ?? null,
inputBarBottom: inputBarRect?.bottom ?? null,
inputBarPaddingBottom: inputBarStyle?.paddingBottom ?? null,
keyboardBottomInset:
inputBar?.style.getPropertyValue("--chat-keyboard-bottom-inset") || null,
appViewportHeight:
rootStyle.getPropertyValue("--app-viewport-height") || null,
appVisibleHeight: