From 703cf1fcf093d15e42af8976af54919bae82cc42 Mon Sep 17 00:00:00 2001 From: sravan Date: Sat, 19 Sep 2026 18:00:47 +0530 Subject: [PATCH] TEMP: keyboard diagnostics for the Android repeat-open gap Behavior-neutral console logging on keyboard show/hide (kb height, innerHeight, clientHeight, visualViewport height, --kb) to determine whether the Android WebView resizes (interactive-widget) or relies on the manual --kb lift, and to spot any residual between the first and second open. Remove once fixed. Co-Authored-By: Claude Opus 4.8 --- server/public/home.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/public/home.html b/server/public/home.html index 32a9ab9..1c31838 100644 --- a/server/public/home.html +++ b/server/public/home.html @@ -1330,6 +1330,12 @@ function twemojify(_el){ /* native emoji: nothing to do */ } KB.addListener('keyboardWillShow', function(info){ var raw=(info&&info.keyboardHeight)||0; var kb = raw>window.innerHeight ? raw/(window.devicePixelRatio||1) : raw; setKb(kb); }); KB.addListener('keyboardWillHide', function(){ setKb(0); }); KB.addListener('keyboardDidHide', function(){ setKb(0); }); // belt-and-suspenders: some close paths only fire Did* + // TEMP kbdiag (remove after diagnosing the Android repeat-open gap): logs the metrics that tell us whether + // the WebView resizes (interactive-widget) vs relies on --kb, and any residual across open #1 vs #2. + var _kbn=0, _cs=function(){ return getComputedStyle(document.documentElement).getPropertyValue('--kb').trim(); }; + KB.addListener('keyboardWillShow', function(info){ _kbn++; console.log('[kbdiag] willShow#'+_kbn+' kbH='+((info&&info.keyboardHeight)||0)+' innerH='+window.innerHeight+' clientH='+document.documentElement.clientHeight+' vvH='+(window.visualViewport?Math.round(window.visualViewport.height):'-')+' preKb='+_cs()); }); + if(KB.addListener){ KB.addListener('keyboardDidShow', function(info){ console.log('[kbdiag] didShow kbH='+((info&&info.keyboardHeight)||0)+' innerH='+window.innerHeight+' clientH='+document.documentElement.clientHeight+' vvH='+(window.visualViewport?Math.round(window.visualViewport.height):'-')+' curKb='+_cs()+' kbOpen='+document.body.classList.contains('kb-open')); }); } + KB.addListener('keyboardDidHide', function(){ console.log('[kbdiag] didHide innerH='+window.innerHeight+' clientH='+document.documentElement.clientHeight+' vvH='+(window.visualViewport?Math.round(window.visualViewport.height):'-')+' curKb='+_cs()); }); } }catch(_){} })(); // Browser / iOS home-screen PWA (NO Capacitor Keyboard plugin): lift the composer above the on-screen