Add dir="auto" to assistant-message div for RTL language support

Status Open
Maintainer reply None cached
Activity 0 comments · opened Jul 17, 2026

Problem

The assistant response container (data-testid="assistant-message") rendered in the webview does not have a dir attribute set. When the response contains Persian, Arabic, or other RTL text, the browser defaults to LTR, resulting in left-aligned RTL text that looks broken.

Current code

In webview/index.js, the Q8t (or similar memoized component j8t) renders:

E("div",{ref:c,"data-testid":"assistant-message",className:`...`,children:[...]})

No dir attribute is present.

Proposed fix

Add dir:"auto" to the props:

E("div",{ref:c,"data-testid":"assistant-message",dir:"auto",className:`...`,children:[...]})

dir="auto" lets the browser auto-detect text direction from the first strong-directional character — RTL for Persian/Arabic/Hebrew, LTR for English — and renders the content correctly without any manual intervention.

Why this matters

  • Users writing in RTL languages (Arabic, Persian, Hebrew, Urdu, etc.) get poorly-formatted responses
  • The fix is a one-line, zero-risk change
  • dir="auto" has no effect on LTR-only content, so English-only users see no difference

View original on GitHub ↗