Repository navigation
fix(web): keep the start of long usernames in right-to-left admin lists - #4783
Conversation
In Arabic, a long left-to-right username on the admin users list, the dashboard Users widget, and an access group's member list and Add users dialog was cut at its start, because the line inherited the page's direction. Each username now takes its direction from its own text, so a cut name keeps its beginning in either script. Where the line would stretch, it is sized to its text so a short name stays on the page's start side. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 37 minutes. View limit details
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
| name inside keeps its start when cut, in either script, and w-fit keeps | ||
| a short one on the page's start side. */} | ||
| <span className="min-w-0 flex-1"> | ||
| <span dir="auto" className="block w-fit max-w-full truncate font-medium"> |
There was a problem hiding this comment.
S1 (P3) Preserve long numeric prefixes on English pages
At 393 px in an English component fixture, 1018273645536271809019283746556677889999محمد kept its first digit on the base revision. With dir="auto", the Arabic letters make the span RTL, but the long digit run still reads left to right. Chromium, Firefox, and WebKit now clip the first digit in this row, the Users widget, the member list, and the Add users dialog. Where the digit run alone exceeds the available width, use LTR truncation to retain the prefix. Add this case to the fixture matrix.
There was a problem hiding this comment.
The mechanism is right. In 1018…9999محمد the first strong character is Arabic, so the line reads right to left, and a digit run wider than the box loses its first digits. On main, an English page kept them.
I've left the markup as it is. This is the same mixed-run trade-off the PR already describes, and every fixed rule I can see moves the cut somewhere else:
- Treating a leading digit as left-to-right keeps this case. It cuts
2024_محمد_عبدالله_…on the Arabic page instead: "2024_" plus the end of the Arabic part, wheremainand this PR show "2024_محمد_عبدالله…". - Keeping the page's direction for any name with mixed runs (tried in this PR and dropped) cuts
support_team_account_محمدto "…team_account". - Measuring whether the digit run alone overflows would need layout measurement for an edge case no single rule fixes.
Single-script and digits-only names, which are the case this PR is about, keep their start in all three engines. 7ccf3a8 corrects the README and the PR body so they no longer say that dir="auto" always keeps a name's first characters. I'm leaving this thread open so the maintainer can weigh the trade-off.
🤖 Claude Code (claude-opus-5-5)
It follows the first strong character, which can be right-to-left punctuation as well as a letter, and a part of a mixed name that runs the other way, such as a long digit prefix, can still lose its start. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
… rule The username rule from #4783 said not to use .bidi-text because plaintext drops the "…" in Firefox and cuts the start in WebKit. That holds only for .bidi-text without dir="auto". Say so, and put the metadata rule next to it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…fari in right-to-left languages (#4853) * fix(web): keep the start and ellipsis of cut titles in Firefox and Safari in right-to-left languages Metadata text styled with .bidi-text takes its paragraph direction from its own text, but the element's direction stays the page's. Firefox and WebKit cut the text and draw the "…" at the end of that direction, so in Arabic a long English card title lost its "…" in Firefox and its first letters in Safari, and clamped overviews put the "…" at the start of their last line. Give every .bidi-text element that is cut with truncate or line-clamp dir="auto" (card titles, episode titles, audiobook authors, cast names and roles, the home hero, episode and detail overviews, and the bounded detail title). .bidi-text still lines the box up with the page, so short titles stay on the page's start side and links keep their width. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(web): say .bidi-text needs dir="auto" in the username truncation rule The username rule from #4783 said not to use .bidi-text because plaintext drops the "…" in Firefox and cuts the start in WebKit. That holds only for .bidi-text without dir="auto". Say so, and put the metadata rule next to it. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(web): note the mixed-direction limit on the metadata truncation rule Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(web): keep .bidi-text and dir="auto" together on the detail title DetailTitle set dir="auto" while its caller passed .bidi-text, so a caller that left the class out would align an English title to the wrong edge in Arabic. DetailTitle now adds the class itself. Also note on DetailOverview that one direction can't suit every paragraph of a clamped multi-paragraph description. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(web): say what Firefox and WebKit show without dir="auto" Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Problem
Related issue: N/A
Validation tasks: changes #1197 C1
Other clients: N/A (user management is web-admin only in the 1.0 definition, #1195; Apple, Android and Roku have no user list, access group or dashboard screens)
In a right-to-left language such as Arabic, a long left-to-right username is cut at its start on three web admin screens:
The admin sees "…rtholomew_reynolds" instead of "aaron_bartholomew_…" and loses the part that identifies the person. On an English page, a long Arabic username is cut at its start the same way.
Each username inherited the page's direction.
text-overflow: ellipsiscuts the end of the line in that direction, and for a name written the other way, that end is where the name begins.With this change, each username reads in the direction of its own text. A long name in either script keeps its start and ends in "…", and short names stay where they were.
Approach
dir="auto", which follows the name's first strong character (a letter, or right-to-left punctuation such as؟). A name with none, such as one made only of digits, reads left to right.w-fit max-w-full), so a short Latin name stays on the page's start side. This applies to the users list row and the member list. In the users list row, a wrapper takes the free space so the badges stay at the row's end.web/src/i18n/README.mdrecords the rule for the next truncated name.Rejected alternatives:
.bidi-text(unicode-bidi: plaintext) withtruncatedrops the "…" in Firefox and cuts the name's start in WebKit.ltrUnlessRightToLeft, keeps the page's direction for right-to-left text, so a long Arabic username on an English page would still lose its start.qa_فاطمة_…on the Arabic page. It breaks the mirror case instead:support_team_account_محمدbecomes "…team_account". No fixed rule keeps the start of every part of every mixed name.Validation
maindf37bfc), Arabic, 393 px: seven username lines had their first character outside the visible box, in both Chromium and Firefox. WebKit's captures show the same cut ("…artholomew_reynolds").format:check,buildandbudget:checkpass, run on Node 24.make test-web: 3079 of 3080 tests pass.PdfBundleCompatibilityfails the same way onmainon the test host (DOMMatrix is not defined).make lint-changed,verify-local-paths,verify-bidi,verify-case-collisionsandverify-size-ratchetpass.Evidence
Surface and build: web admin (Users list below
lg, dashboard Users widget, Access groups → members and Add users), Arabic and English, at 393, 834 and 1440 px, in Chromium, Firefox and WebKit. Before onmain(df37bfc), after on this branch.Evidence: https://evidence.siloserver.org/r/silo-server/admin-username-rtl-truncation/
Risks
None identified. The change sets the text direction and width of four username lines on admin screens.
qa_فاطمة_…on the Arabic page now shows "qa_" and the end of its Arabic part. On an English page, a digit run too long for the box before Arabic letters loses its first digits. No singlediravoids this for every mixed name.Out of scope, each being fixed separately:
.bidi-textwithtruncate, which lose the "…" or their start in Firefox and WebKit.Checklist
Council review
Background review: 1 round, reviewed d838775.
Fixed: the README now says
dir="auto"follows the first strong character, which can be right-to-left punctuation (Sol S2, 7ccf3a8). Left for the maintainer: a long digit prefix before Arabic letters loses its first digits on an English page (Sol S1). It is the mixed-run trade-off under Risks, and the thread explains why no fixed rule avoids it.Visual review: 2 rounds on the final captures. Gemini's first launch hit a provider quota; its retry reviewed every pair from both rounds.
Answered:
main.AI Disclosure
dir="auto". A two-round, three-model visual review checked the captures, and a background review runs on the PR. See Council review.🤖 Generated with Claude Code
Note
Fix truncated username display in right-to-left admin lists
Long usernames in admin UI lists cut off the start of the name when the browser renders them with right-to-left direction. This PR switches username spans to automatic text direction (
dir="auto"behavior) so truncation keeps the beginning of the name visible, matching the direction of the username's first strong character..bidi-textfor this caseMacroscope summarized 7ccf3a8.