fix: mobile keyboard layout — scroll-to-bottom on show, robust dismiss detection

Three bugs fixed in KeyboardHandler:
1. onKeyboardShow() used sessionData.terminal (always undefined) instead of app.terminal
2. Keyboard dismiss threshold (50px) too tight for iOS address bar drift — widened to 100px
3. No terminal refit on keyboard hide — caused black gap below terminal

Also added: dynamic baseline update for initialViewportHeight, safety check in
updateLayoutForKeyboard() that forces dismiss when keyboardOffset <= 0.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-02-16 12:10:44 +01:00
co-authored by Claude Opus 4.6
parent bd6d777294
commit da74ac248b
7 changed files with 1281 additions and 20 deletions
+12 -11
View File
@@ -8782,31 +8782,32 @@ kbd {
display: block;
}
/* Mobile terminal - use native browser scrolling for smooth performance */
/* Mobile terminal - native touch scrolling via xterm-viewport */
.terminal-container {
height: 100%;
min-height: 0;
position: relative;
overflow: hidden;
contain: layout style;
touch-action: pan-y; /* Allow native vertical scrolling */
overflow: visible; /* Must not be hidden — blocks touch scroll on viewport */
touch-action: pan-y;
}
.terminal-container .xterm {
touch-action: pan-y;
}
/* Viewport scroll optimization - use native scrolling */
/* CRITICAL: xterm-viewport must be above xterm-screen for touch scrolling to work */
/* See: https://github.com/xtermjs/xterm.js/issues/5377 */
/* xterm-viewport is the scrollable element inside xterm.js.
It must sit above xterm-screen to receive touch events.
See: https://github.com/xtermjs/xterm.js/issues/5377 */
.terminal-container .xterm-viewport {
position: absolute !important;
z-index: 10 !important; /* Above xterm-screen so touch events hit the scrollable viewport */
top: 0 !important;
left: 0 !important;
right: 0 !important;
bottom: 0 !important;
z-index: 10 !important;
touch-action: pan-y;
-webkit-overflow-scrolling: touch; /* Enable iOS momentum scrolling */
-webkit-overflow-scrolling: touch;
overflow-y: scroll !important;
scroll-behavior: auto !important;
will-change: scroll-position;
}
.terminal-container .xterm-screen {