From 2b133feec5d3916e247b977b9d2dc628d6b86888 Mon Sep 17 00:00:00 2001 From: Qihan <3045019481@qq.com> Date: Thu, 26 Mar 2026 08:04:58 +0800 Subject: [PATCH] fix(web): keep mobile views scrollable and new-session actions reachable (#364) --- web/src/App.tsx | 2 +- web/src/components/InstallPrompt.tsx | 18 +++++++++++++++++- .../components/NewSession/ActionButtons.tsx | 2 +- .../components/NewSession/AgentSelector.tsx | 2 +- web/src/components/SessionChat.tsx | 2 +- web/src/router.tsx | 5 ++++- web/src/routes/sessions/file.tsx | 4 ++-- web/src/routes/sessions/files.tsx | 4 ++-- web/src/routes/sessions/terminal.tsx | 4 ++-- web/src/routes/settings/index.tsx | 4 ++-- 10 files changed, 33 insertions(+), 14 deletions(-) diff --git a/web/src/App.tsx b/web/src/App.tsx index ca3d2921..daf6531d 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -347,7 +347,7 @@ function AppInner() { /> -
+
diff --git a/web/src/components/InstallPrompt.tsx b/web/src/components/InstallPrompt.tsx index d790a60a..fe4af0da 100644 --- a/web/src/components/InstallPrompt.tsx +++ b/web/src/components/InstallPrompt.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react' +import { useEffect, useState } from 'react' import { usePWAInstall } from '@/hooks/usePWAInstall' import { usePlatform } from '@/hooks/usePlatform' import { CloseIcon, ShareIcon, PlusCircleIcon } from '@/components/icons' @@ -9,6 +9,22 @@ export function InstallPrompt() { const { canInstall, canInstallIOS, promptInstall, dismissInstall, isStandalone } = usePWAInstall() const { isTelegram, haptic } = usePlatform() const [showIOSGuide, setShowIOSGuide] = useState(false) + const showFloatingPrompt = !isTelegram && !isStandalone && ((canInstallIOS && !showIOSGuide) || canInstall) + + useEffect(() => { + const root = document.documentElement + if (!root) return + + if (showFloatingPrompt) { + root.style.setProperty('--app-floating-bottom-offset', '112px') + } else { + root.style.removeProperty('--app-floating-bottom-offset') + } + + return () => { + root.style.removeProperty('--app-floating-bottom-offset') + } + }, [showFloatingPrompt]) if (isTelegram || isStandalone) { return null diff --git a/web/src/components/NewSession/ActionButtons.tsx b/web/src/components/NewSession/ActionButtons.tsx index 37f6ef07..00b6b9f8 100644 --- a/web/src/components/NewSession/ActionButtons.tsx +++ b/web/src/components/NewSession/ActionButtons.tsx @@ -13,7 +13,7 @@ export function ActionButtons(props: { const { t } = useTranslation() return ( -
+
-
+
{/* Language section */}