Repository navigation
Studio: keep the chat composer typing after a send on WebKitGTK Wayland - #13222
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Member
Author
|
@codex review |
1 similar comment
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This was referenced Oct 10, 2026
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.
Fixes #10012
Problem
On Unsloth Desktop under a Wayland session (WebKitGTK), the chat composer stops taking typed characters after the second send in a conversation. Paste still works and brings typing back, and so does switching conversations.
GTK_IM_MODULE=gtk-im-context-simpleorGDK_BACKEND=x11avoid it.The cause is the sent-text guard added in #8849. After a send it refuses an IME composition write that lands on an empty composer until a keydown or a
compositionstartshows the user is typing again, so that a composition still open at the send cannot finalise and put the sent prompt back.WebKitGTK breaks the assumption behind that rule. When the GTK input method commits text outside its key filter (the Wayland
text-inputpath), WebKit delivers each keystroke as a confirmed composition:key: "Unidentified",keyCode: 229(NativeWebKeyboardEventGtk.cpp,handledByInputMethod = true)Editor::confirmComposition(text)viaWebEditorClient::didDispatchInputMethodKeydown, which firesinputwithinputType: "insertFromComposition"andisComposing: true, thencompositionendThere is never a
compositionstart, and the 229 keydown takes the IME branch ofonKeyDown, which returns before it records user input. So every typed character is refused as a stale composition. A paste is a deliberate write and retires the guard, which is why paste restores typing.The first send in a new chat is unaffected because the chat has no thread id yet when the guard is armed, so the guard does not own the thread afterwards. From the second send on it does, which matches the report.
Fix
The guard now records whether an IME composition was actually open when the message was sent (
imeSessionOpenRef, set bycompositionstartand cleared bycompositionend/ blur). A composition write is only treated as a stale finalise when one was open. With none open, it can only be the user typing, so it is applied and the guard retires. That includes retyping a one-character prompt such as?, which the equality rule would otherwise swallow on every press.Unchanged:
insertReplacementText) on an empty composer is still refused.No UI or flow changes.
Verification
I used a local vite harness rendering the real
Threadcomposer with a local runtime that replies straight away, and drove it in Playwright. Each keystroke replays the WebKitGTK sequence above, and the runtime'scomposer.textis read back after each step.abcabchellohellohellohellohelloP, then IM typingxyP,Pxy(paste restores, as reported)helloP,helloPxyplainplainy, then IM typingyyyyBefore and after match on Chromium and Playwright WebKit.
tests/composer-send-guard.test.tsgains 4 tests. 3 of them fail onmain(a composition write with none open at the send is applied,retyping a one-character prompt applies with no composition open at the send,the composer arms the guard with whether an IME session was open).main.tscis clean. eslint and biome report the same counts asmainon the touched files.Not verified: a real Fedora Wayland session with WebKitGTK and an IBus input method. The event sequence comes from WebKit's source and was replayed in the browser rather than produced by a real input method.