fix: RTL text layout support in web UI (issue #16875)#22088
Closed
uriva wants to merge 1 commit intoanomalyco:devfrom
Closed
fix: RTL text layout support in web UI (issue #16875)#22088uriva wants to merge 1 commit intoanomalyco:devfrom
uriva wants to merge 1 commit intoanomalyco:devfrom
Conversation
- Convert hardcoded physical CSS properties to logical properties (padding-left → padding-inline-start, margin-left → margin-inline-start, text-align: left → text-align: start, border-left → border-inline-start) - Expand RTL locale detection beyond Arabic to include Hebrew (he), Persian/Farsi (fa), and Urdu (ur) - Add shared @opencode-ai/util/rtl module for RTL direction detection - Add isRtl() export alongside dir() in console language utility - Preserve direction:rtl truncation-trick comments for clarity Fixes RTL text appearing wrongly indented and disconnected in the web/console UI. TUI (terminal) layer still needs OpenTUI bidi support (separate effort).
Contributor
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Potential duplicate found:
|
Contributor
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
he), Persian/Farsi (fa), and Urdu (ur) in the consoledir()functionisRtl()export alongsidedir()in the console language utility@opencode-ai/util/rtlmodule with a comprehensive RTL language detection utility for use across packagesdirection: rtlCSS truncation-trick usages to distinguish them from actual RTL layoutChanges by file
packages/console/app/src/lib/language.tsdir()to use RTL locale set; addisRtl()exportpackages/util/src/rtl.tspackages/ui/src/components/markdown.csspackages/ui/src/components/message-part.csspackages/ui/src/components/card.csspackages/ui/src/components/message-nav.csspackages/ui/src/components/tool-error-card.csspackages/ui/src/components/dialog.csspackages/ui/src/components/file.csspackages/ui/src/components/session-turn.csspackages/ui/src/components/session-review.cssWhat this does NOT address
The TUI (terminal) layer uses OpenTUI which has zero RTL/Bidi support — all
paddingLeft/paddingRightprops, text alignment, and word-wrapping assume LTR. Proper TUI RTL support requires adding a Bidi algorithm to the OpenTUI Zig renderer, which is a separate effort.Closes #16875
Related: #14257, #22076, #21676