Feature request: right-to-left (RTL) support for Arabic documents
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- react, tailwindcss, typescript
- Lĩnh vực
- accessibility, frontend, internationalization
Hướng nghiên cứu
Start in packages/ui/components/BlockRenderer.tsx, which the request names as the place to set a per-block dir; the same treatment is needed in BlockquoteBlock.tsx and TableBlock.tsx. Read the block prop shape there to see where block.content is available, then implement the RTL-vs-Latin counting rule from the issue and swap physical classes for logical ones (marginInlineStart, border-s-2 ps-4, text-start). Done means Arabic lists, blockquotes and tables flip in plan review while English output is byte-for-byte unchanged; there is no test named in the payload, so verify in the annotate and plan-review views.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happens
Plans and documents written in Arabic (and other RTL languages) render left-to-right in annotate and plan review (plannotator 0.28.35, Windows, Claude Code):
- Arabic paragraphs and headings are left-aligned, and their punctuation jumps to the wrong end of the line.
- Bullets and numbers sit on the left of Arabic list items, and nested items indent from the left.
- The blockquote rule is on the left side.
- Table columns run left-to-right, and headers are forced left (
text-left). - The table of contents in the left sidebar has the same problems.
- Inline code inside an Arabic sentence (for example
Use `POST /ingest` herewritten in Arabic) splits the surrounding punctuation.
Agent output in Arabic is common now. The plans we review are mostly Arabic with English identifiers and code mixed in, so this affects every review.
Why dir="auto" is not enough
dir="auto" picks the direction from the first strong character. In mixed documents many Arabic lines start with an English identifier or code, for example a list item that begins with `POST /ingest` and continues in Arabic. Those lines would wrongly come out LTR. Short English-only headings inside an Arabic document (for example "Jev" or "WebSocket") also read better when they follow the document's direction.
Proposed change
-
A direction per block. For each block, take
block.content, drop the inline code spans, and compare the count of RTL letters with Latin letters:- The block is
rtlwhen RTL letters are at least half the Latin count. - The block is
ltrwhen it has only Latin text and at least about 30 letters. - Otherwise it follows the document's majority direction.
Set the result as a
dirattribute on the block root inpackages/ui/components/BlockRenderer.tsx(headings, paragraphs, list items),BlockquoteBlock.tsxandTableBlock.tsx. Then lists, tables and alignment follow from the browser's own bidi handling. - The block is
-
Logical properties instead of physical ones (Tailwind 4 supports them):
- list indent
style={{ marginLeft }}becomesmarginInlineStart; - blockquote
border-l-2 pl-4becomesborder-s-2 ps-4; - table headers
text-leftbecometext-start.
- list indent
-
Code stays LTR. Code blocks get
dir="ltr", and inlinecodegetsunicode-bidi: isolateso punctuation around it stays in place. -
Comments. The comment textarea gets
dir="auto", and the TOC entries use the same direction as their heading.
No text changes, so annotation offsets and quotes are unaffected. It also adds no setting: English documents keep rendering exactly as they do today.
Optional: a textDirection: "auto" | "ltr" | "rtl" setting for people who want to force one.
Workaround in the meantime
I'm using a small userscript that applies the same idea from outside: it sets dir per [data-block-id] and adds a few CSS overrides. It works, but it relies on internal class names and inline styles, so it breaks whenever the markup changes. A built-in fix would be much more robust.
I'm happy to open a PR along these lines if this direction works for you.
- Ngôn ngữ chính
- TypeScript
- Star
- 8.7k
- Fork
- 649
- Merge trung bình
- 11 giờ 16 phút
- Pull request đã merge (30 ngày)
- 585
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của backnotprop/plannotator
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
backnotprop/plannotator#2372 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
backnotprop/plannotator#2317 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
backnotprop/plannotator#2290 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
backnotprop/plannotator#2243 · 1 bình luận · 2 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Annotate documentation omits per-file version history and privacy controlsCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
backnotprop/plannotator#1086 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của backnotprop/plannotator
Issue tương tự
-
bug triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Export the Hemi Earn Router address and the Router and Agent ABIs from `@vetro-protocol/earn`Đang mởhemi-earn
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
vetro-protocol/vetro-monorepo#1043 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
stage 2: bare names resolve against PATH differently from the shell (empty and relative entries)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
STRML/omp-classifier#206 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
atlassian-labs/mermaid-diagrams-viewer#188 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
dashboard enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Olanetsoft/agent-lookout#225 ·
Maintainer thường phản hồi trong vòng 1 ngày