Fix of wrong alignment with mixed RTL and LTR text#743
Fix of wrong alignment with mixed RTL and LTR text#743sinasadeghi83 wants to merge 4 commits intoSableClient:devfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses display issues when message content contains a mix of RTL and LTR text by ensuring text direction is resolved from the actual characters rather than inherited container direction, and by adjusting how the message text block aligns within its layout.
Changes:
- Applied
unicode-bidi: plaintextto message body styling so mixed-direction text is rendered with correct bidirectional behavior. - Applied
unicode-bidi: plaintextto the reply previewTextcomponent to keep reply content directionally correct. - Added
align-self: startto the main message text body recipe to stabilize content alignment in mixed RTL/LTR scenarios.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/app/components/message/Reply.tsx | Adds unicode-bidi: plaintext to reply preview text rendering to improve mixed RTL/LTR display. |
| src/app/components/message/layout/layout.css.ts | Updates the message text body recipe to use unicode-bidi: plaintext and align-self: start for better mixed-direction formatting/alignment. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hey, thanks for contributing! Could you write a changeset as described here? |
|
Just as a user who needed this feature a lot, first I want to say thank you. |
|
I like @AmirAref's suggestion |
It's against proximity principle in visual design. Texts can't be too far from profile name and profile image because then you have to roll your eyes all to the left to see who sent the message. Think about this scenario when you are reading a chain of messages from Alice then suddenly Bob sends a new message, then at first you may assume that Alice is the sender because you haven't seen the sender name or profile image yet. Then after reading the whole message to the end, you find out that Alice couldn't be the sender. You roll your eyes to the left and see that oh it's Bob! |
You're welcome. It's done. |
Yeah, you're right. I think this would be handled greatly by changing message layout to Bubble and enable Right Aligned Bubbles in General settings of Sable. |


Description
This PR resolves formatting and alignment issues with mixed RTL (Right-to-Left) and LTR (Left-to-Right) text within messages. Previously, mixed text direction caused display inconsistencies in the main message body and the reply content area.
Changes made:
dir="auto"to the base messageTextcomponent, allowing the browser to automatically determine the base text direction according to the first strongly-typed character of the message.unicode-bidi: plaintextto the message content CSS and theTextcomponent inside the reply content. This ensures the browser dynamically evaluates and handles the text direction based on the actual characters used rather than inheriting the container's direction.align-self: starton the message content. This ensures that even for RTL messages, the content block anchors appropriately to the left side (start) of the view, while still preserving the correct internal text direction.Type of change
Checklist:
AI disclosure: