From c5489d7ad6346ac77954c65a54a1d2871deaac83 Mon Sep 17 00:00:00 2001 From: sravan Date: Sat, 18 Jul 2026 01:19:49 +0530 Subject: [PATCH] fix(mobile): scale keyboard lift by measured 0.52 (plugin over-reports ~2x) Measured from device screenshot: composer at ~678pt from bottom vs 351pt keyboard = 2x overshoot. Scale the reported height by 0.52 so the composer sits flush on the keyboard. Single tunable const. Build marker -> 2026-07-18-batch103. Co-Authored-By: Claude Opus 4.8 --- server/public/home.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/public/home.html b/server/public/home.html index 144f9f1..bef100a 100644 --- a/server/public/home.html +++ b/server/public/home.html @@ -1112,7 +1112,7 @@ - // The plugin reports that height in DEVICE PIXELS on some builds, but CSS wants points — so a raw value // bigger than the screen's point height is divided by devicePixelRatio. This normalization makes it land // exactly on the keyboard regardless of unit. - function bzKbHeight(raw){ raw=raw||0; var dpr=window.devicePixelRatio||1; return Math.round(raw > window.innerHeight ? raw/dpr : raw); } + // Measured on-device: the plugin's reported height puts the composer ~2x too high, so scale it. This is + // a single tunable number — if the composer isn't flush on the keyboard, nudge KB_FACTOR up/down. + var KB_FACTOR=0.52; + function bzKbHeight(raw){ raw=raw||0; var dpr=window.devicePixelRatio||1; var norm = raw > window.innerHeight ? raw/dpr : raw; return Math.round(norm*KB_FACTOR); } var KB=C.Plugins&&C.Plugins.Keyboard; if(KB && KB.addListener){ KB.addListener('keyboardWillShow', function(info){ var h=bzKbHeight(info&&info.keyboardHeight); r.style.setProperty('--kb', h+'px'); document.body.classList.add('kb-open'); var b=document.getElementById('msgs'); if(b) requestAnimationFrame(function(){ b.scrollTop=b.scrollHeight; }); });