fix(mobile): sent messages no longer stay in the iOS composer after IME input #22843
main fromrefs/pull/22843/head·opened View on GitHubProblem#
On iOS, sending a message while the keyboard still has uncommitted IME text (for example Japanese kana that has not been converted yet) delivers the message but leaves the text in the composer. The leftover text is saved as the draft, so it is still there after leaving and reopening the thread.
Repro on the Japanese kana keyboard: type 「たかな」 without committing it, tap Send. The message appears in the thread, the composer still shows 「たかな」, and Send stays enabled.
Change#
#17614 made applyControlledDocument skip every controlled update while marked text exists, so that rebuilding the attributed string does not tear down an active composition. Send clears the draft in JS, but that clear arrives during the composition and is skipped. When the composition commits later, the editor emits the old text back and it becomes the draft again.
The editor now only defers while JS echoes the text being composed, which is the case #17614 protects (re-rendering pills next to the composition). A different value is a deliberate replacement such as the send clear: the editor commits the composition with change events suppressed and applies the value. Android replaces the text during composition already and is not affected.
Scope and approval#
A small, focused fix for an obvious iOS-only regression from #17614, in one function of the iOS composer editor.
Verification#
| Before (main) | After |
|---|---|
![]() | ![]() |
Both shots were taken after sending uncommitted kana, going back to the thread list, and reopening the thread. iOS 27 simulator with the dev client and the Japanese kana keyboard, using the same build with and without this change. Also checked on the fixed build:
- Converting kana, committing the candidate, and continuing to type still works.
- Sending committed text and sending while a turn is running still clear the composer.
Not checked: the original #17614 case (Chinese input right before a skill pill). That case echoes the composing text, which still takes the deferred path.
Done with Claude Opus 5.5 in Claude Code (via T3 Code).
🤖 Generated with Claude Code
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
Approvability#
Verdict: Approved at
7960ce8Macroscope's review found this PR approvable — This is a focused iOS composer bug fix that preserves IME composition updates while ensuring deliberate controlled replacements, such as clearing after send, take effect immediately. It is limited to one function and introduces no schema, configuration, security, or deployment changes.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
9f8c0aa7-ed99-432e-ae1f-2a826c1815a6
📥 Commits
-
Reviewing files that changed from the base of the PR and between 96f09c6558b098f05ad0c027afa3846209c03d4f and 7960ce8a6a669034ab71d6590a87db2a13025f45.
📒 Files selected for processing: 1
-
apps/mobile/modules/t3-composer-editor/ios/T3ComposerEditorView.swift
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
📝 Walkthrough
-
During IME composition,
applyControlledDocumentdefers rebuilding when the serialized text matches the controlled value. When the values differ, it ends the composition and applies the controlled update.Changes: Controlled document updates
Layer / File(s) Summary Composition-aware controlled updates
apps/mobile/modules/t3-composer-editor/ios/T3ComposerEditorView.swiftWhen composed text matches the controlled value, rebuilding remains deferred and forced-rebuild state is preserved. When the values differ, the editor ends composition and applies the controlled update. Priority: ➖ Normal
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers:
ilyaliao
Merge Risk: ⚪ Minimal · up to
7960c-
Sending composed text should clear the composer and its draft; no actionable merge risk was found in the changed path.
Pre-merge checks:
4-
Check name Status Explanation Title check The title clearly describes the primary iOS IME composer fix and follows the repository's conventional commit style. Description check The description explains the problem, change, scope justification, verification steps, screenshots, and unverified case. It is complete and relevant. Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
Closing in favor of #26452. Device logging showed the leftover text in #20982 comes from the composition being committed by the post-send blur, after the clear, not from a clear arriving mid-composition. Committing the composition when the send reads the editor state fixes it: https://github.com/pingdotgg/t3code/pull/26452#issuecomment-6488566166
nabettu(GitHub profile, opens in a new tab) closed this
Heads-up on overlap: I opened #26504 for the same #20982 symptom before realizing this PR was already open. My branch (fork
IzonIcy:fix/ios-composer-ime-send-clear) carries the same core idea for the document path, plus two additions this PR does not have: the replacement is gated on the controlled-document path only, so theme, font, layout, and icon repaints keep the unconditional deferral from #17614, and a fail-safe defers instead of writing attributed text ifunmarkText()does not clear the mark, with a pending-replacement flag so a failed commit cannot re-emit the sent text into the draft (that last part came out of review).Triage on #26504 asked for coordination on the superseded overlap, so: happy to rebase the extra gating onto this PR if it lands first, or fold this PR's additions here, whichever the maintainers prefer. The device evidence situation is the same for both branches; a recording on whichever build lands would cover the shared core.
Thanks for the heads-up. #22843 stays closed, so there's nothing to coordinate on this branch.
One thing to check before you record: #22843 took the same approach as #26504, and I closed it because device logging showed a different order. The post-send blur commits the composition before the cleared document reaches the view, so by the time the clear arrives there is no marked text left for that path to handle, and the commit's change event has already refilled the draft. I haven't run #26504 on a device, so please confirm against that ordering.
Committing the composition when the send reads the editor state avoided it in my testing: https://github.com/pingdotgg/t3code/pull/26452#issuecomment-6488566166. Your gating and the fail-safe for a failed
unmarkText()both look worth keeping if they apply on top of that.
Sign in to join this conversation.


macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes