Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): add bidirectional text support for RTL languages #2128

Closeddarkyeg(GitHub profile, opens in a new tab)wants to merge 5 commits intomain fromrefs/pull/2128/headopened View on GitHub

What Changed

  • Added dir="auto" and unicode-bidi: plaintext to chat messages, composer, question panels, thread titles, plan sidebar, and plan cards
  • Replaced margin-left, text-left, border-left with logical properties (text-start, gap-x, border-inline-start)
  • Code blocks and tables isolated as LTR so they don't flip

Why

RTL text like Arabic and Hebrew was unreadable when mixed with English. Punctuation jumping around, words in wrong order. dir="auto" lets the browser figure out direction per element from the first strong character, which is the standard fix for this.

Addresses #1771

UI Changes

Before

https://github.com/user-attachments/assets/5b35ccca-5259-45fe-95be-12b3e030a89f

After

https://github.com/user-attachments/assets/0bfcc85f-29e4-4714-a7d6-f84ee67bc137

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Low Risk Presentation-only CSS and HTML attributes with no auth, data, or API changes; main risk is minor layout regressions in edge LTR cases.

Overview Improves readability of mixed RTL/LTR content (e.g. Arabic, Hebrew with English) by letting the browser infer text direction per block instead of forcing LTR everywhere.

dir="auto" is added on chat markdown, the composer ContentEditable, plan sidebar copy (explanations, steps, titles), thread titles in the sidebar and header, pending user-input questions/options, plan banners/cards, and archived thread titles in settings.

index.css adds unicode-bidi: plaintext on chat markdown prose and on .user-message-text / .composer-editor-bidi for per-line direction in pre-wrap text; keeps pre / code / table LTR with unicode-bidi: isolate. List/blockquote/table styling switches to logical properties (padding-inline-start, border-inline-start, text-align: start).

A few controls use text-start instead of text-left so alignment follows layout direction in RTL.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 3cc50decb1ae8ab26f7e2f11325a3e911e49c721. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Add bidirectional text support for RTL languages across chat UI components

  • Adds dir="auto" to text-bearing elements across chat components (ChatMarkdown, ComposerPromptEditor, PlanSidebar, ChatHeader, sidebar thread titles, plan cards, and archived thread settings) so each element auto-detects RTL/LTR direction from its content.
  • Updates index.css with bidi-aware CSS: sets unicode-bidi: plaintext on text elements in .chat-markdown for per-paragraph direction detection, forces direction: ltr on code blocks and tables, and switches list/blockquote spacing to logical CSS properties (padding-inline-start, border-inline-start).
  • Changes a text-left class to text-start in PlanSidebar for logical alignment in bidi contexts.
📊 Macroscope summarized 3cc50de. 10 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted

🗂️ Filtered Issues

No issues evaluated.

    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro

      Run ID: 5100bd3b-100e-45c7-90e0-7b7010a36136

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands and usage tips.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Needs human review

      1 blocking correctness issue found.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. darkyeg(GitHub profile, opens in a new tab) changed the title

    5. Cursor Bugbot has reviewed your changes and found 1 potential issue.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot). Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit e2f066b3386a1dd1b0b8fd2d916eafa75f5634a4. Configure [here](https://www.cursor.com/dashboard/bugbot).
    6. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium

      https://github.com/pingdotgg/t3code/blob/3cc50decb1ae8ab26f7e2f11325a3e911e49c721/apps/web/src/index.css#L449-L456

      The task list checkbox uses physical margin: 0 0.35em 0.15em -1.25rem, which pulls the checkbox left with negative margin. In RTL contexts (now enabled by unicode-bidi: plaintext on li elements), the checkbox misaligns because -1.25rem remains left-bound instead of following the inline-start direction. Use margin-inline-start: -1.25rem with separate inline-end and block margins so the negative margin adapts to text direction.

      .chat-markdown li.task-list-item input[type="checkbox"] {
      -  margin: 0 0.35em 0.15em -1.25rem;
      +  margin-block: 0 0.15em;
      +  margin-inline: -1.25rem 0.35em;
         vertical-align: middle;
       }
      🤖 Copy this AI Prompt to have your agent fix this:
      In file @apps/web/src/index.css around lines 449-456:
      
      The task list checkbox uses physical `margin: 0 0.35em 0.15em -1.25rem`, which pulls the checkbox left with negative margin. In RTL contexts (now enabled by `unicode-bidi: plaintext` on `li` elements), the checkbox misaligns because `-1.25rem` remains left-bound instead of following the inline-start direction. Use `margin-inline-start: -1.25rem` with separate inline-end and block margins so the negative margin adapts to text direction.
    7. Closing as part of backlog cleanup: this PR is stale, currently conflicting with main, has no approval, and has not had active remediation for 30+ days. If the change is still relevant, please rebase onto current main and request reopening or submit a focused current diff. Thank you for the contribution.

    8. juliusmarminge closed this

Sign in to join this conversation.