bluesky-social / social-app

The Bluesky Social application for Web, iOS, and Android
https://bsky.app
MIT License
13.36k stars 1.71k forks source link

RTL auto-detection makes PostMeta messy #4529

Closed jgarplind closed 4 months ago

jgarplind commented 5 months ago

Describe the bug RTL auto-detection causes @-character in PostMeta to be misplaced.

To Reproduce

Steps to reproduce the behavior:

See https://bsky.app/profile/pastures.bsky.social for example.

Expected behavior

@-character should always precede the handle, since the handle is inherently LTR-text, event if the display name is RTL-text.

Screenshots

image

Details

Additional context

This behavior appears to be the output of the BIDI algorithm, see this post for a link to the spec and a playground.

I consider this a minor inconvenience considering the overall state of Bluesky RTL support, but have a fix in mind that I will contribute soon.

mary-ext commented 5 months ago

Here's how Signal handles Unicode bidi, I think it's worth taking a look given the processing it tries to do https://github.com/signalapp/Signal-Desktop/blob/ce0fb220411b97722e1e080c14faa65d23165784/ts/util/unicodeBidi.ts#L124

haileyok commented 4 months ago

Merged this in, thank you!