Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
There was a problem hiding this comment.
Two bidi issues in ChatMarkdown.tsx where the new dir="auto" does not actually produce the direction the CSS rules assume.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8e7f514. Configure here.
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR changes the layout and scrolling behavior of rendered chat markdown across paragraphs, lists, alerts, blockquotes, tables, and code, with additional RTL handling in a shared scroll-area component. The bidi and browser-layout interactions are non-trivial, while automated coverage is limited to the direction-detection helper. You can add or adjust custom eligibility rules. Learn more. |
There was a problem hiding this comment.
One new finding on the RTL scroll-viewport change: the dir now on ScrollArea makes the DOM viewport RTL, but Base UI's ScrollArea reads direction from DirectionProvider, not the dir attribute, so the scrollFade overflow vars are computed with LTR assumptions. Details inline.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
One finding on the RTL alert layout; the rest of the bidi work (DirectionProvider on the table viewport, logical properties in index.css, the rtl: mask swap against Base UI's logical --scroll-area-overflow-x-* vars) looks consistent.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
One finding: the new text-align: start in the .chat-markdown bidi rule clobbers author-provided alignment in sanitized raw HTML (PR descriptions, README previews). Details inline. The rest of the bidi work checks out — Base UI's --scroll-area-overflow-x-start/end are indeed logical (scrollLeftFromStart/scrollLeftFromEnd, negated for RTL) and are computed from useDirection(), so the DirectionProvider + dir pairing on the table ScrollArea and the rtl: mask swap in scroll-area.tsx line up with the primitive's contract; the alert label's dir="ltr" on the <span> (not the row) is correctly skipped by the container's dir="auto" resolution while the row still follows the container's direction.
Posted via Macroscope — UI Consistency
Every leaf block in .chat-markdown resolves its own base direction from its first strong character (unicode-bidi: plaintext + text-align: start), and lists / blockquotes / tables get dir="auto" so markers, the quote bar and column order land on the content's side. Physical paddings/borders on those containers become logical. Code stays LTR. No global flip: a mixed English/Hebrew message renders block by block.
- GitHub alerts: the injected English label was the first strong character, so dir="auto" on the container never resolved RTL. Give the label dir="ltr" so the auto algorithm skips it and the body decides the side of the bar/padding. - Tables: put dir on the ScrollArea root rather than only the <table>, so an overflowing RTL table opens scrolled to its first (rightmost) column.
Resolve the table's direction from its text (first strong letter) instead of dir="auto", pass it to the ScrollArea and to Base UI's DirectionProvider so the viewport's scroll-edge math matches the rendered direction, and swap the scroll-fade mask sides under rtl since Base UI's overflow vars are logical while the mask utilities are physical.
…RTL scripts - dir="ltr" now sits on the alert label text only, not the flex title row, so in a Hebrew alert the icon + label follow the bar and body to the right. - firstStrongDirection recognises the astral RTL blocks (U+10800–U+10FFF, U+1E800–U+1EFFF: Phoenician … Adlam).
start is the initial value, so the declaration only ever overrode the HTML align presentational hint that raw-HTML surfaces (PR bodies, README previews) rely on. unicode-bidi: plaintext alone aligns each block to its own start edge.
983c40b to
94394cd
Compare
Dismissing prior approval to re-evaluate 94394cd
|
Note 🤖 GPT-5.6 Sol responding on behalf of Theo We're closing this PR as we clean up the T3 Code backlog. Thank you for taking the time to put this together. We are keeping OPEN #7466 as the review path for right-to-left chat text. The focused markdown tests here remain useful reference. If you believe we closed this in error, please reopen the PR and leave a comment explaining what we missed. |

What changed
Hebrew / Arabic (and any other RTL script) in chat messages rendered left-to-right: punctuation jumped to the wrong end of the line, list markers sat on the left, the blockquote bar was on the wrong side, table columns flowed LTR. This makes every markdown block in
.chat-markdownresolve its own direction from its content — no global flip, no setting:index.css: leaf blocks (p, li, h1–h6, td, th, dt, dd) getunicode-bidi: plaintext; text-align: start— the browser picks the base direction per block from its first strong character.pre/codestay LTR. Physicalpadding-left/border-left/text-align: leftonul/ol/blockquote/td/thbecome logical (padding-inline-start, …).ChatMarkdown.tsx:ul,ol,blockquote,table(and the GitHub-alertdiv) getdir="auto", so list markers, the quote bar and column order land on the content's side.The composer already works: Lexical stamps
dir="auto"on root paragraphs.Why
Mixed-language threads are common for non-Latin users; this is the standard per-block approach (same idea the Claude.ai / Claude Code markdown renderer uses — per-block first-strong direction) done with native
dir="auto"+ CSS instead of JS. English content is unaffected: an LTR block resolves exactly as before.Diff: +45 / −11, two files, no new deps.
Before / after
Test plan
vp test(web unit, markdown suites),tsgo --noEmit,vp lint,vp fmt --check— greenNote
Low Risk
Presentation-only bidi/CSS changes in chat markdown and scroll-fade masks; no auth, data, or API behavior.
Overview
Hebrew/Arabic (and other RTL) chat markdown now follows per-block first-strong direction instead of always rendering LTR. Mixed-language threads stay mixed: English blocks are unchanged, code stays LTR.
Lists, blockquotes, GitHub alerts, and tables get
dir="auto"(tables viafirstStrongDirection+DirectionProvideron the scroll viewport) so markers, quote bars, and column order sit on the content’s start edge. Overflowing RTL tables open on the first/rightmost column, and scroll-fade masks swap physical left/right underdir="rtl".CSS switches list/quote/cell padding, borders, and alignment to logical properties, with
unicode-bidi: plaintexton leaf text blocks. Unit tests cover first-strong detection including astral RTL scripts.Reviewed by Cursor Bugbot for commit 94394cd. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Render Hebrew/Arabic chat markdown right-to-left in
ChatMarkdownfirstStrongDirectionandhastTextContentutilities inChatMarkdown.tsxto detect text direction from the first strong Unicode letter in a node.blockquote,alert,ol, andulmarkdown renderers to usedir="auto". Tables compute their direction and pass it to theMarkdownTablecomponent.padding-inline-start) inindex.cssand setunicode-bidi: plaintexton leaf blocks. Code blocks remain LTR.ScrollAreafade masks to align with RTL scroll edges.Macroscope summarized 94394cd.