fix(chat): improve in-app keyboard avoidance

This commit is contained in:
2026-06-24 15:13:11 +08:00
parent 853ae776f9
commit 08c954903f
7 changed files with 193 additions and 66 deletions
-6
View File
@@ -5,7 +5,6 @@ import Image from "next/image";
import { useRouter } from "next/navigation";
import { useAuthState } from "@/stores/auth/auth-context";
import { useKeyboardHeight } from "@/hooks/use-keyboard-height";
import type { LoginStatus } from "@/data/dto/auth";
import { AppStorage } from "@/data/storage/app/app_storage";
import { AuthStorage } from "@/data/storage/auth/auth_storage";
@@ -43,11 +42,6 @@ export function ChatScreen() {
const [showExternalBrowserDialog, setShowExternalBrowserDialog] =
useState(false);
// 全局副作用:把软键盘高度写到 <html> 的 --keyboard-height CSS 变量,
// 让 .bar 的 padding-bottom 跟着调整,修复 FB IAB / 小米 WebView 输入框被键盘遮挡的问题。
// 详见 src/hooks/use-keyboard-height.ts
useKeyboardHeight();
// isGuest 派生(chat-screen 是唯一知道这个值的地方 —— chat 机器无 isGuest 字段)
const isGuest = deriveIsGuest(authState.loginStatus);