Repository navigation
ci: type on real Gboard against the workspace editor on an Android emulator - #3511
christianhg wants to merge 4 commits into
Conversation
…e workspace editor `apps/android-ime` holds a driver that types on real Gboard in an Android emulator into a page in Chrome and reads the text and the composition events back over the DevTools protocol. It is TypeScript run directly by Node 24 with type stripping, so the tsconfig allows erasable syntax only. adb goes through `child_process`, the screen through the uiautomator2 on-device server, CDP over the global `WebSocket`. The driver, the device script, the Japanese keyboard setup and the unit tests come over unchanged in behavior: every retry, wait and log line, and the `RESULT` line format. Comments that pointed at an earlier Python driver or an issue number now describe the present. The test page is built with Vite, which every other app here uses, from the workspace `@portabletext/editor` instead of a published version. The plain `contenteditable` page stays as the control. `build:page` is not a `build` script, so root `pnpm build` and turbo never pick it up. Knip gets the scripts the shell runs and the page Vite builds as entries. The app declares no React types of its own: a new importer with `@types/react` resolves to a newer version than the root pins and moves unrelated entries in the lockfile.
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Bundle Stats✅ No significant changes. All scenario measurements (37)🗺️
Significant means at least 1.0 KB and 1% gzip, or at least 5 ms and 10% import time. |
…he run `scripts/cases.ts` names each case by page, language and prefix, with the text a correct editor ends up with and optional `nested`, `compositionstart` and second word counts. A case can be marked expected-to-fail with a one-line reason. The Japanese empty-block case is: Gboard restarts the composition after the first character, so the published editor leaves `k` behind and converts the first word without it, `'k用今日'` with one nested `compositionstart`. `run-on-device.sh` reads its cases for `IME_LANG` from the table instead of a fixed list. The driver still asserts nothing about the editor, so its one retry per case can only cover a driver fault. `scripts/report.ts` parses the `RESULT` lines from `drive.log`, the `RETRY` lines from `phases.log`, and writes a markdown table to `$GITHUB_STEP_SUMMARY` with a verdict per case: pass, fail, expected fail or unexpectedly passing, the last one called out above the table since it means the mark should go. It exits 1 only when the run broke, the Japanese setup failed or a case printed no `RESULT` line, never on an editor verdict.
…ulator Two jobs, `ja` and `en`, on an API 36 `google_apis_playstore` x86_64 emulator with the same options and the same single boot retry as before: the second run starts only when the first never logged `BOOTED`. Each job builds the editor packages the test page needs with `turbo build --filter='android-ime^...'`, builds the page, runs the cases and uploads `out/`. It runs on pull requests that touch the editor's input handling or the app, nightly against `main`, and on dispatch. It reports and does not gate: the job summary holds the case table, and a job is red only when the run broke, never on an editor verdict.
9a63c07 to
ccbda14
Compare
Composition bugs on Android only show up with a real keyboard. Synthetic
beforeinputand composition events in browser tests don't reproduce what Gboard sends, so changes to the input pipeline have shipped with no Android signal at all.This adds
apps/android-ime, which builds a test page from the workspace editor and types into it with real Gboard on an Android 16 emulator (API 36, Chrome 133, Gboard 15.1). Japanese exercises composition and English exercises plain typing, since current Gboard no longer composes English. A plaincontenteditablecontrol runs next to the editor so a keyboard change can be told apart from an editor regression. The driver is plain Node 24 TypeScript with no runtime dependencies. It talks to the device over adb, to the keyboard through uiautomator2 and to the page through the Chrome DevTools Protocol.The workflow runs on pull requests that touch the input handling paths, nightly on
mainand on dispatch, as one Japanese and one English job. It reports and does not gate. Each case is checked against the table inapps/android-ime/scripts/cases.tsand the verdicts go to the job summary. A job turns red only when the run itself broke (no boot, failed setup, or a case with no result after its retry), never because of an editor result. The Japanese case that types into an empty block is marked expected to fail, because Gboard restarts the composition after the first character there today, which leaves a straykin front of the converted words. When a fix lands it shows up as an unexpected pass above the summary table.Each case gets one retry, and since the driver never asserts editor output, a retry can't hide an editor result. Measured on this branch over 16 runs (the pull request run plus 15 dispatches), all 32 jobs went green, 5 of 96 cases needed their retry, and the Japanese empty-block case left the stray
kin all 16 runs. The plain controls vary on their own: Japanese Gboard sometimes commits the words as kana before converting them (9 of 16 runs), and Chrome once dropped the trailing non-breaking space in English, so those two cases accept either text. The README covers running it, reading the summary and adding a case.Note
Low Risk
New CI and test-only app under
apps/android-ime; no production editor runtime changes, and editor verdicts do not fail the workflow.Overview
Adds
apps/android-ime, an end-to-end harness that types “kyou kyou” through real Gboard in Chrome on an API 36 emulator, against Vite-builtplain.htmlandPortableTextEditabletest pages. A Node 24 driver (adb, a TypeScript uiautomator2 client, CDP) records final text and composition metrics;scripts/cases.tsdefines expectations, including a Japanese empty-editor case markedexpectedToFailfor the known stray-k/ nested-composition bug.Introduces
.github/workflows/android-ime.yml: matrix jobs forjaanden, PR path filters on editor input code, nightlymain, and workflow_dispatch. The workflow reports viascripts/report.tsto the job summary and does not gate on editor mismatches—jobs fail only when boot/setup/driver breaks or a case prints noRESULT. Also wiresknip.jsonentries for the new app.Reviewed by Cursor Bugbot for commit ccbda14. Bugbot is set up for automated code reviews on this repo. Configure here.