Chat input box lacks bidi support (unicode-bidi:plaintext) — RTL/Hebrew text renders reversed while typing
Summary
Bidirectional (bidi) text renders correctly in message bodies but not in the chat input box. When typing mixed Hebrew/Arabic + English (or numbers/punctuation), each line is reordered against a fixed LTR base direction, so the text reads "half-reversed" while composing. This makes the input painful to use for RTL-language users.
Root cause / evidence
You already fixed this for rendered messages. The webview CSS (VS Code extension, webview/index.css) applies per-paragraph bidi to message content:
.root_… :is(p,li,h1,h2,h3,h4,h5,h6,blockquote,td,th){unicode-bidi:plaintext}
unicode-bidi: plaintext resolves each block's base direction from its first strong character (UBA P2/P3), which is exactly right for mixed content. This rule landed in 2.1.216 and reading messages became correct.
The input never got the same treatment. The composer is two aligned layers, neither of which carries any bidi/direction rule:
.messageInput_cKsPxg— thecontenteditable(transparent text + caret).mentionMirror_cKsPxg— the absolutely-positioned mirror that renders the visible, highlighted text
Both default to direction: ltr; unicode-bidi: normal, so RTL input is misordered.
Proposed fix (one line)
Apply the same treatment you already use for message bodies to both input layers, so they reorder identically and the caret stays aligned with the visible text:
.messageInput_cKsPxg,
.mentionMirror_cKsPxg { unicode-bidi: plaintext; }
(Class names above are from the current minified bundle and are version-specific — the point is the two composer layers, not the exact hashes.)
I verified this locally by appending that rule to webview/index.css and reloading the window: mixed Hebrew+English now reads correctly in the input, caret alignment is preserved, and alignment behavior matches message bodies. The only downside of the local patch is that it's wiped on each extension auto-update — hence this request to make it official.
Environment
- Claude Code VS Code extension
2.1.218(linux-x64), VS Code1.129.1 - Same behavior expected on all platforms (the CSS is shared)
Thanks — the message-body fix already made a huge difference; extending it to the input would complete it for RTL users.