Skip to content

feat(ime): add companion input and Moto G Play Clear support - #396

Draft
doodlewind wants to merge 3 commits into
mainfrom
distinct-track
Draft

feat(ime): add companion input and Moto G Play Clear support#396
doodlewind wants to merge 3 commits into
mainfrom
distinct-track

Conversation

@doodlewind

@doodlewind doodlewind commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Clear could only edit baked Latin text and had no Moto Android deployment path. This adds application-level Chinese pinyin input on iPod touch 4 and Moto G Play 2024 through paired io.offload, with reusable glyph resources that keep committed text visible during edits.

The device owns keyboard interaction, editor revisions, committed text and a bounded composition transcript. A native worker owns device socket I/O; the Mac companion owns Rime, dictionaries and font rasterization. Reconnect replays the retained transcript, rejects stale replies and applies committed suffixes once. Runtime APIs live under @pocketjs/framework/ime.

The keyboard uses one candidate bar, a compact preedit badge and a mode label on Space. A disclosure opens scrollable candidates; browsing preserves composition and taps select revision-checked absolute indices. Space enters caret mode after 200 ms while retaining its pressed state. Caret steps clamp to raw-input character boundaries, fixing haha wrapping during a continuing left drag. Backspace repeats until release. Icons and rounded keys use density-aware antialiasing.

Framework text resources separate source/layout, shared glyph coverage and retained paint. Resident characters survive edits while disconnected. Glyph changes invalidate their readers, and stable demand sets reuse their admitted resources. Candidate rows retain mounted slots; scrolling uses draw transforms, and covered key layers are culled. The text architecture documents the remaining shaped-run, cluster, bidi and font-fallback work beyond the current scalar cmap path.

The Moto host adds arm64/GLES2 multi-touch at 360×800 logical / 720×1600 physical, sharing native/Java code with the BlackBerry entry point. Commands cover setup, build, exact-device installation with APK hash readback, launch, status, capture and USB pairing.

Validation:

  • All 12 repository test stages passed in 53.7 seconds; TypeScript and real Rime acceptance passed. The focused run passed 26 tests. Rendered regressions cover both viewports, bounded row-crossing text writes, absence of layout-offset writes within a scrolling row, offline pixel continuity and candidate selection.
  • Both devices installed with readback verification and advanced native frame counters. iPod build: ecccbd1b6fd5f42453bf328aee5c8f7d. Moto APK SHA-256: 268c04c91924a37ddd545e63e032af46c4b8381c0dc33ad730756a039937dd99. Native interaction covered composition, caret bounds, scrolling, selection, offline deletion and reconnect.
  • Final iPod ni scrolling delivered a 52.17 FPS median with a 3.91 ms CPU window-mean median. First-pass windows ranged from 43.12–52.95 FPS; reverse windows ranged from 48.65–52.94 FPS. Samples use distinct 60-frame windows during scripted 140-point drags. This does not establish stable 60 FPS or frame-time percentiles.
  • An installer concurrency polling test failed on a preceding attempt; its isolated rerun and the complete suite passed. An earlier remote Linux gpui job was blocked before compilation by Chrome APT Hash Sum mismatch: dependency-install failure.

Scope: Clear's application editor, Mac-dependent conversion, 128-action compositions and the in-memory demo model. Native inputs use GraphicsServices and ADB events; physical-finger timing is a separate check. Rime learning is disabled for replay. Rare candidates can exceed the selected font's coverage. No new BlackBerry device acceptance is claimed.

Setup, controls and reproduction steps · Text architecture

iPod touch 4 scrolled candidates Moto G Play scrolled candidates
iPod touch 4 scrolled candidates Moto G Play scrolled candidates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant