Repository navigation
fix(workbot): keep the message box above the Android keyboard - #7455
Merged
Merged
Conversation
On Android Chrome with gesture navigation, opening the keyboard left the lower half of the message box behind it. Workbot sizes its page from visualViewport.height, and with the keyboard covering the page (the browser default) that height was about 36px taller than the space the keyboard left on the phone that showed it. Ask Android to resize the page itself with interactive-widget=resizes-content, so the layout viewport, 100dvh and the visual viewport agree and the box sits on the keyboard. Safari ignores the key and keeps the visual viewport path in viewport.ts. The keyboard check in viewport.ts reads window.innerHeight, so it now also reruns on a window resize. scroll-browser.mjs asserts that the message box stays fully in view when the page shrinks for a keyboard. Signed-off-by: Jalil <reachjalil@gmail.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this about?
Workbot in a phone browser on Android: the message box now stays on top of the keyboard while you type.
What problem does it solve?
On Android Chrome, opening the keyboard hid the lower half of the message box, so people could not see what they were typing.
What was the situation before?
With the keyboard open, only the top of the message box showed above it and the typed text was cut off at the keyboard's edge. Seen in Chrome on a phone with gesture navigation.
How is this implemented?
ee/apps/workbot/src/client/index.html: the viewport meta addsinteractive-widget=resizes-content, so Android browsers resize the page for the keyboard instead of covering it. Safari ignores the key and keeps its current path.visualViewport.height, which was taller than the space the keyboard left.ee/packages/workbot-ui/src/viewport.ts: the keyboard check readswindow.innerHeight, so it also reruns on a window resize.What else changed?
ee/apps/workbot/test-fixtures/chat-screen-server.tsserves the same viewport meta as the app.ee/apps/workbot/scripts/scroll-browser.mjsasserts that the whole message box stays in view when the page shrinks for a keyboard.Release note
On Android, the keyboard no longer hides the Workbot message box while you type.
Evidence
No E2E spec: an Android keyboard is not emulated in CI.
ee/apps/workbot/scripts/scroll-browser.mjschecks, in desktop Chromium at phone size, that the whole message box stays above the keyboard when the page shrinks for it. Not yet checked on an Android phone.