From 92da0534463bb4ec8cdf387bfa0372853899cbb3 Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Thu, 30 Apr 2026 17:36:28 -0400 Subject: [PATCH] Fix mobile WebView bottom row cutoff and one-finger scroll getting stuck Subtract 1 row from measureFitDimensions to prevent the last terminal line from being hidden behind the accessory bar overlay. Widen the pinch-zoom snap-to-1 threshold from 1.05 to 1.15 so users don't get trapped in pan mode after a slight zoom. Co-authored-by: Orca --- mobile/src/terminal/TerminalWebView.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mobile/src/terminal/TerminalWebView.tsx b/mobile/src/terminal/TerminalWebView.tsx index e2461ce8180..152c195787f 100644 --- a/mobile/src/terminal/TerminalWebView.tsx +++ b/mobile/src/terminal/TerminalWebView.tsx @@ -309,7 +309,11 @@ const XTERM_HTML = ` var vpWidth = window.innerWidth; var vpHeight = window.innerHeight; var cols = Math.floor(vpWidth / cellWidth); - var rows = Math.floor(vpHeight / cellHeight); + // Why: subtract 1 row so the bottom terminal line is never covered + // by the accessory bar. The WebView's innerHeight can slightly + // overstate the visible area due to layout timing or safe-area + // insets, causing the last row to render behind the overlay. + var rows = Math.max(8, Math.floor(vpHeight / cellHeight) - 1); notify({ type: 'measure-result', cols: cols, rows: rows }); } @@ -430,7 +434,7 @@ const XTERM_HTML = ` if (ts.isPinching && e.touches.length < 2) { ts.isPinching = false; - if (userScale < 1.05) { + if (userScale < 1.15) { userScale = 1; panX = 0; panY = 0; updateTransform(); }