-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@usernames should not determine bidi direction #870
Comments
Would you be able to do a quick mockup showing what that screenshot should look like if things are working correctly? That'll help me verify any changes are working correctly. Note to self: https://developer.android.com/reference/android/text/BidiFormatter |
Oh, I just noticed that the behavior is already (almost) correct in the main timeline (or my timeline with replies), but not when entering the post or its parent. |
Though, the @ symbol should appear to the left of a username in either case. Effectively, it seems like it's doing this: When it should be doing this: And of course, this should apply to each username mention individually, even in the middle of a post. |
Previous code didn't set the textDirection for the status content, so the first para of RTL text might be rendered incorrectly. In addition, mentions and tags weren't BIDI wrapped, so would appear as "foo@" and "foo#" in RTL statuses, instead of "@foo" and "#foo". Fix both of these issues. Fixes #870
) Previous code didn't set the textDirection for the status content, so the first para of RTL text might be rendered incorrectly. In addition, mentions and tags weren't BIDI wrapped, so would appear as "foo@" and "foo#" in RTL statuses, instead of "@foo" and "#foo". Fix both of these issues. Fixes #870
Describe the bug
For users in Hebrew, Arabic or Persian (I think) which are written right to left, the @mentions at the start of a reply cause the entire first paragraph to be rendered left to right. This causes it to be less readable.
If this were HTML, I'd suggest you wrap any mention in a bdi tag: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/bdi (or use CSS which can also do that).
To Reproduce
Steps to reproduce the behavior:
@whoever שיהיה לך יום טוב.
Expected behavior
The paragraph should be rendered in RTL, aligned right, and the punctuation mark should be on the left at the end of the text.
Screenshots or video
![Screenshot_20240806_044530_Pachli](https://private-user-images.githubusercontent.com/2400026/355284173-9f007f12-1a2e-4300-a8a7-09e07f1d1d17.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNjA4MzgsIm5iZiI6MTczOTM2MDUzOCwicGF0aCI6Ii8yNDAwMDI2LzM1NTI4NDE3My05ZjAwN2YxMi0xYTJlLTQzMDAtYThhNy0wOWUwN2YxZDFkMTcuanBnP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTJUMTE0MjE4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MTk4OTUyMmE3NDU2NzJjYTIwNDJlMmJhMjdhMGZjNDFmMDMyMDNmMDIxYjUwMzlhYmFiMjA3ZDc0NzAyMDAzYiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.SQV4_i-wXTOg29ZgGedMMfhIj4ZAoBbGvF75dzELQs0)
Links
https://fosstodon.org/@neatnit/112912082714265949
Versions
Pachli 2.7.0, Android 14, OneUI 6.1, Samsung Galaxy S22+.
Affirmation
I did not check for other issues, sorry. Feels like the kind of issue that would be resolved soon after it's brought up.
The text was updated successfully, but these errors were encountered: