From 0d0107f10ab83b760d82862512280a0e477e9f2b Mon Sep 17 00:00:00 2001 From: cmliu Date: Wed, 5 Aug 2026 16:53:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E6=A0=8F=E7=9A=84=E5=8F=AF=E8=A7=81=E6=80=A7?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BB=85=E5=9C=A8=E8=A7=A6=E6=91=B8?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=92=8C=E7=A7=BB=E5=8A=A8=E8=A7=86=E5=8F=A3?= =?UTF-8?q?=E5=AE=BD=E5=BA=A6=E4=B8=8B=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/index.html | 4 ++-- frontend/src/main.ts | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index 1b0247b..d7062e9 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -392,8 +392,8 @@
- - + + diff --git a/frontend/src/main.ts b/frontend/src/main.ts index e1155ba..b4a8150 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -2356,10 +2356,9 @@ let mobileToolbarReady = false; function updateMobileToolbarVisibility(): void { const toolbar = document.getElementById('mobile-toolbar'); if (!toolbar) return; - // CSS media query already gates visibility via display:none, but we - // add a JS check for pointer:coarse as a defence against browsers - // that report coarse for mice/stylus (uncommon, but safe). - const isTouchDevice = window.matchMedia('(pointer: coarse)').matches; + // Show toolbar only on touch devices within mobile viewport width. + // Aligned with the CSS media query (pointer: coarse) and (max-width: 768px). + const isTouchDevice = window.matchMedia('(pointer: coarse) and (max-width: 768px)').matches; const shouldShow = isTouchDevice && connectionState === 'connected'; toolbar.hidden = !shouldShow; const panel = document.getElementById('mobile-toolbar-panel');