diff --git a/server/public/home.html b/server/public/home.html index 6336e29..045139a 100644 --- a/server/public/home.html +++ b/server/public/home.html @@ -26,7 +26,7 @@ /* Safe-area insets. The native app enables edge-to-edge via the @capacitor-community/safe-area plugin, which populates env(safe-area-inset-*) with real values on every device (notch, Dynamic Island, home indicator). On the web these resolve to 0. All layout below pads with var(--sat)/var(--sab). */ - :root{--sat:env(safe-area-inset-top,0px);--sab:env(safe-area-inset-bottom,0px);} + :root{--sat:env(safe-area-inset-top,0px);--sab:env(safe-area-inset-bottom,0px);--kb:0px;} body{font-family:'Segoe UI',system-ui,sans-serif;background:var(--bg);color:var(--ink);margin:0;display:flex;flex-direction:column;height:100vh;height:100dvh;overflow:hidden;position:fixed;inset:0;width:100%;} /* ---- Top bar ---- */ @@ -1069,9 +1069,11 @@ directly above the keyboard (no nav sandwiched between the text box and the keyboard). The panel then only needs to clear the home indicator. */ body.chat-open .rail{display:none;} - /* Composer clears the home indicator; when the keyboard opens, @capacitor/keyboard resize:native - shrinks the WebView so this bottom edge ends up right on top of the keyboard — no JS needed. */ - body.chat-open .content .panel{bottom:var(--sab);} + /* Composer clears the home indicator; when the keyboard opens, we lift it by the exact keyboard height + (--kb, set by the Keyboard plugin listener) so it sits right on top of the keyboard. There's no home + indicator while the keyboard is up, so --sab collapses to 0. */ + body.chat-open .content .panel{bottom:calc(var(--sab) + var(--kb));transition:bottom .2s ease;} + body.kb-open{--sab:0px;} /* Native-style push/pop: the conversation slides in from the right when opened and slides back out when you go back, so navigation has a clear direction (like Teams/WhatsApp). */ @keyframes bzConvoIn{from{transform:translateX(100%);}to{transform:translateX(0);}} @@ -1110,7 +1112,7 @@ - // juggling here — we only tag so CSS can make small native-only tweaks if needed. (function(){ try{ var C=window.Capacitor; if(!C||!C.isNativePlatform||!C.isNativePlatform()) return; var p=(C.getPlatform&&C.getPlatform())||''; var r=document.documentElement; r.classList.add('native-app'); if(p) r.classList.add('native-'+p); - // Keyboard is handled NATIVELY by @capacitor/keyboard (resize:native resizes the WebView so the composer - // sits on the keyboard) — no JS height juggling here. We only keep the thread pinned to newest on show. + // Keyboard: native resize is a no-op here (the safe-area plugin's edge-to-edge overrides it), so we lift + // the composer ourselves by EXACTLY the keyboard height the plugin reports — a single, deterministic + // mover (config sets resize:none + offsetForKeyboardInsetBug:false so nothing else touches the layout). var KB=C.Plugins&&C.Plugins.Keyboard; - if(KB && KB.addListener){ KB.addListener('keyboardDidShow', function(){ var b=document.getElementById('msgs'); if(b) b.scrollTop=b.scrollHeight; }); } + if(KB && KB.addListener){ + KB.addListener('keyboardWillShow', function(info){ var h=(info&&info.keyboardHeight)||0; r.style.setProperty('--kb', h+'px'); document.body.classList.add('kb-open'); }); + KB.addListener('keyboardDidShow', function(){ var b=document.getElementById('msgs'); if(b) b.scrollTop=b.scrollHeight; }); + KB.addListener('keyboardWillHide', function(){ r.style.setProperty('--kb','0px'); document.body.classList.remove('kb-open'); }); + } }catch(_){} })();
Biz Connect
Loading…