Repository navigation
fix(terminal): a key-bar tap on Android leaves a keyboard Back put away down - #3297
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 14 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…lone, More keys included; release on a cancelled touch
|
Review round on bc14944 (omo review BLOCK, Codex: no HIGH). Fixed in 1a1b262:
Re-verified at 1a1b262: Android 15 emulator Chrome (Esc and More keys with the keyboard put away: stays down; grid tap still raises it), |
|
Merge note (merge pass) at head 1a1b262:
|
Refs #3274 (the key-bar half; the connection half waits on the reporter's details, asked on the issue).
Problem
On Android, Back puts the soft keyboard away but leaves the terminal's field (xterm's textarea in Direct typing, the input line otherwise) focused. Chrome on Android raises the keyboard again on any tap while a text field is focused, so every key-bar tap (arrows, Esc, Tab, Ctrl) brought the keyboard back. #1632 had stopped key taps from moving the focus, but the existing regression starts with nothing focused, which misses this case.
Reproduced on an Android 15 emulator (Chrome,
google_apisx86_64 image) against an isolated test server: tap the grid (keyboard up), Back (dumpsys input_method:mInputShown=false, focus still onxterm-helper-textarea), tap Esc or Tab:mInputShown=true.Fix
src/components/KeyBar.tsx: on the touch press of a key that leaves the focus alone (a key, a modifier, More keys; not the mode switch, Paste, Attach or the keyboard control, which move the focus or the keyboard themselves), the focused field carriesinputmode="none"until the tap's click has been handled, then gets its own inputmode back (also at the next press anywhere, when the touch turns into a scroll, or when the field loses the focus). Chrome readsinputmode=noneas "no keyboard", and a keyboard that is up stays up. A field that already asks for none (Settings > Terminal > Keyboard only from the key bar) is left alone.This follows Termux's extra-keys row: a key is input, never a request for the keyboard; only the keyboard control raises it. No new control or setting.
Validation
scripts/keybar-focus-regression.tsgains a touch case with the field focused (the state Back leaves): at the key's click the field must carryinputmode="none", keep the focus, send the key once, and get its inputmode back. It failed on main ([null]vs["none"]) and passes with the fix.adb shell input tap), fixed build: keyboard down + Esc, Tab: stays down (mInputShown=false), field's inputmode restored; a grid tap still raises it; with the keyboard up, Esc and Tab keep it up.herdr-ci-runner:local, standalone clone at this head):bun run check fastgreen (unit: 12986 pass, 0 fail). Browser regressions that name the key bar: throughscripts/ci-browser-parallel.ts9/9 passed (ui-contexts-regression, which runs keybar-focus, command-outcome-demo, key-bar-customization-demo, key-bar-hold-repeat, settings-pages-demo, sticky-modifiers, terminal-autoswitch-demo, terminal-keyboard-demo, terminal-paste-insert-demo); run directly, chat-size, mobile-tabs, terminal-attach, terminal-input and terminal-input-spacing passed.terminal-ipad-ime-regression.tscannot launch there (it wants/opt/google/chrome, which the image lacks); it fails the same way on main and is not inscripts/ci-browser.sh.