desktop: Chinese IME composition loses trailing characters in the prompt composer
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 72/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- react, typescript
Rechercherichtung
Start with packages/app/src/composer/editor/editor.tsx, focusing on the input, keyup, effect, and renderComposerEditor() paths described in the issue. Reproduce with the iFlytek Chinese IME in the OpenCode desktop app and confirm which DOM or selection update aborts composition. The change is done when the composer remains inert during active composition, while normal input and cursor synchronization still work.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Description
Summary
Typing Chinese with 讯飞输入法 (iFlytek IME) in the OpenCode desktop prompt composer intermittently loses the trailing characters that are still in the IME composition buffer. After typing a segment and continuing, the last few pinyin/candidate characters disappear before they are selected or committed. Previously committed text remains. This happens often enough to make Chinese input unusable.
Expected behavior
The IME composition stays active until a candidate is selected/committed; no composing characters are discarded.
Actual behavior
The trailing characters of the active composition vanish. The composition is aborted and the uncommitted pinyin/candidate text is lost; earlier committed text is not affected.
Root cause analysis
This matches the known V2 composer IME issue: the contenteditable editor handles every input/key event during composition and can rewrite its DOM mid-composition.
packages/app/src/composer/editor/editor.tsxrunsonInputfor every input event, including composition updates, and writes the parsed DOM into the composer store.onKeyUpsyncs the cursor on every key, including composition keys.- A
createEffectcompares the DOM with the store and callsrenderComposerEditor()(editor.replaceChildren(...)) when they differ. - Mutating the DOM or selection during an active IME composition makes the browser abort the composition and discard the uncommitted text.
Related
- #39632: IME composition breaks on the first keystroke in the v2 prompt input
- #38674: CJK IME composition aborted mid-input (DOM rewrite during composition)
- #55295: fix(app): keep the composer editor inert during IME composition (closed unmerged; commit f59b00c is not in 2.4.2)
Workaround
Typing Chinese in an external editor and pasting it into the composer works; pasting bypasses IME composition.
Notes
- Hex voice input is not installed/running on this machine, so its Ctrl+Space hotkey is not involved.
- No relevant errors in the logs; this is a DOM/IME lifecycle issue, not a server error.
Plugins
superpowers@git+https://github.com/obra/superpowers.git
OpenCode version
2.4.2 (desktop app; bundled CLI 2.4.2)
Steps to reproduce
- Open a new session in the OpenCode desktop app (2.4.2).
- Focus the prompt composer and switch 讯飞输入法 (iFlytek IME) to Chinese mode.
- Type and commit a short phrase.
- Continue typing another phrase without confirming the IME candidates.
- After a few more keystrokes, the trailing characters in the composition disappear before candidate selection. Earlier committed text remains.
Intermittent but frequent; longer compositions trigger it more often.
Screenshot
No screenshot available (intermittent text loss; textual reproduction above).
Operating System
Windows 10.0.19045 (win32 x64)
Terminal
OpenCode Desktop app (not a terminal client)
- Vorherrschende Sprache
- TypeScript
- Sterne
- 230k
- Forks
- 31.3k
- Ø Merge
- 5 Std. 32 Min.
- Gemergte PRs (30 T.)
- 453
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus anomalyco/opencode
-
area/desktop platform/macos status/repro-plausible type/bug version/v2
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
anomalyco/opencode#67064 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 82/100
anomalyco/opencode#67009 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
area/web type/feature version/v2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
anomalyco/opencode#67001 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
skills: a Claude-compatible SKILL.md that fails to parse is dropped without any logEvtl. vergeben @liwenjie200543 hat das vor 2 Tagen übernommen. Offenarea/plugins platform/linux reproduced type/bug version/v2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
anomalyco/opencode#66970 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
tui: Mermaid renderer displays <b>/<strong> tags literally and ignores \n line breaksEvtl. vergeben @argszero hat das vor 2 Tagen übernommen. Offenarea/tui platform/wsl status/repro-simulated type/bug version/v2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
anomalyco/opencode#66773 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in anomalyco/opencode
Ähnliche Issues
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
ci
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
ClickHouse/clickhouse-js#1248 ·
Maintainer antworten meist innerhalb von 1 Tag
-
E2E: Darlehen-Test wartet auf die gebuchte Auszahlung, bevor er zur Liquiditätsvorschau wechseltOffentechnik
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
SR5-FoundryVTT/SR5-FoundryVTT#2162 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
AhmedNAgy25/analysor#25 ·
Maintainer antworten meist innerhalb von 1 Tag