Bug
When composing Japanese text in the chat composer on iOS Safari, confirming an IME conversion can remove an attached Connection capsule from the input.
This is related to, but distinct from, #81: that issue covers Enter incorrectly sending during IME composition, while this issue covers loss of a structured connection token.
Steps to reproduce
- Open Cloudflare OS in iOS Safari.
- Add a Connection capsule to the chat composer.
- Type Japanese text using the system IME.
- Confirm a conversion.
Actual behavior
The Connection capsule can disappear from the composer.
Expected behavior
Confirming IME text should commit only the composed text. Existing Connection capsules must remain attached.
Root cause
Mobile Safari emits controlled-textarea changes while composition is still in progress and can report a stale selection range. The composer currently runs token overlap bookkeeping for every provisional value. A provisional edit can therefore be misclassified as crossing the capsule range, causing the capsule to be removed.
Proposed fix
Track composition explicitly. Continue rendering provisional text, but defer capsule and token bookkeeping until compositionend, then apply the committed edit once against the value captured at compositionstart. Also avoid handling Enter as a composer command while composition is active.
Validation
- Frontend TypeScript build
- Production Vite build
- Manual reproduction on iOS Safari with a Connection capsule and Japanese IME
Bug
When composing Japanese text in the chat composer on iOS Safari, confirming an IME conversion can remove an attached Connection capsule from the input.
This is related to, but distinct from, #81: that issue covers Enter incorrectly sending during IME composition, while this issue covers loss of a structured connection token.
Steps to reproduce
Actual behavior
The Connection capsule can disappear from the composer.
Expected behavior
Confirming IME text should commit only the composed text. Existing Connection capsules must remain attached.
Root cause
Mobile Safari emits controlled-textarea changes while composition is still in progress and can report a stale selection range. The composer currently runs token overlap bookkeeping for every provisional value. A provisional edit can therefore be misclassified as crossing the capsule range, causing the capsule to be removed.
Proposed fix
Track composition explicitly. Continue rendering provisional text, but defer capsule and token bookkeeping until compositionend, then apply the committed edit once against the value captured at compositionstart. Also avoid handling Enter as a composer command while composition is active.
Validation