Repository navigation
fix(web): keep the start of emails and folder paths in right-to-left admin lists - #4735
Conversation
…admin lists In Arabic, the admin users list, an access group's member list and the dashboard's Users widget cut a long email at its start, and the Libraries cards put a library's folder paths on the card's far side. The email lines and each folder path now read left to right in any language, so a cut email keeps its start and ends in "…". They are sized to their text so they stay 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 36 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:
|
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (gpt-6.2-sol, reviewed bdfa0b1)
The layout works for ASCII addresses and folder paths. Right-to-left addresses lose their beginning when truncated. 8/10.
Validated features
The diff changes how the compact list presents account emails in #1197 C1. In #1200 C1/C2, the row-selection display can change, and the View As action and impersonation flow use the same handlers. I traced those paths in source and reproduced the text rendering in browser fixtures.
Forcing the email lines left to right kept the start of a Latin address on a right-to-left page, but cut the start of one written in Arabic script, which the account email validator accepts: the Arabic run's first letter sits at its right end, where the ellipsis goes. An email line now reads left to right only when its first letter is from a left-to-right script. An Arabic or Hebrew address keeps the page's direction, as before this branch, so it keeps its start too. Left-to-right pages are unchanged. 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:
|
An email whose name part is Adlam digits lost its start in Arabic: the helper only looked at letters, so the Latin domain forced it left to right. One whose name part is ASCII digits before an Arabic domain lost its first digit, because the domain set the direction. emailDir now reads only the part before the @, treats right-to-left digits like right-to-left letters, and reads left to right when that part has only ASCII digits or punctuation. 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:
|
…part emailDir took the first letter or non-ASCII digit of the name part. It skipped right-to-left punctuation such as the Hebrew maqaf, so a name part made of it read left to right and lost its start. And it counted every non-ASCII digit as setting the direction: Persian digits before a Latin domain kept the page's direction and lost their first digit, and a fullwidth digit before an Arabic name forced it left to right. It now counts letters, the right-to-left punctuation and digits that set direction (bidi class R), and Arabic-Indic digits, and skips other digits and punctuation. 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:
|
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (gemini-4-neon, reviewed a757b42)
The four component layout changes and folder-path alignment hold in RTL and LTR across Chromium, Firefox, and WebKit, and the earlier Arabic, Adlam-digit, and ASCII-digit truncation issues are fixed; one edge-case regression remains in emailDir for Arabic-Indic and Extended Arabic-Indic (Persian/Urdu) digits.
Score: 8/10
emailDir counted Arabic-Indic digits as right to left, so an address such as "١٢٣[email protected]" kept a right-to-left page's direction and lost the start of its Latin name, the bug this branch fixes for Latin addresses. Those digits (bidi class AN) don't set direction. The name part's first strong character (a letter, or right-to-left punctuation or digits of bidi class R) now decides. A name part of Arabic-Indic digits alone follows the domain's first strong character, so one before an Arabic domain still keeps the page's direction. A table test covers each case reviewers raised. 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:
|
…runcation # Conflicts: # web/src/components/admin/access-groups/AccessGroupMembers.tsx # web/src/lib/direction.ts
Problem
Related issue: N/A
Validation tasks: none
Other clients: N/A (web admin only: Apple, Android and Roku have no user, access group, dashboard or library management screens)
In a right-to-left language such as Arabic, three web admin screens cut a long email at its start:
The admin sees "…" followed by the last few letters of the name part and the domain, so the part that identifies the person is gone. On the Libraries cards (phones and tablets), a library's folder paths sit against the card's far edge instead of under the folder count. English is not affected.
This change makes those email lines read left to right in every language, so a long email keeps its start and ends in "…". The email lines and the folder list now sit on the page's start side.
The email lines inherited the page's direction. In a right-to-left page,
text-overflow: ellipsiscuts the left side of the line, and that is where a left-to-right email begins. The folder list already read left to right, but as one block spanning the card's full width, so its paths started at the card's left edge.Approach
w-fit max-w-full). A short email still starts under the username, and a long one still truncates.@) starts in a right-to-left script keeps the page's direction, as before. The account email validator accepts such addresses. Forcing them left to right would cut their start instead, because the first character of a right-to-left run sits at its right end, where the ellipsis goes.emailDirinweb/src/lib/direction.tsmakes the choice. Unlikedir="auto", it never turns an email right to left on a left-to-right page.dir="auto"and the.bidi-texthelper were rejected for the reasons fix(web): keep the start of emails and folder paths in right-to-left restore rows #4711 found.dir="auto"reverses an email whose name part starts with Arabic letters, and.bidi-textloses or misplaces the ellipsis in Firefox and WebKit.Validation
Not reproduced on a live server, because no test server could be started. Instead, a temporary dev-only page rendered the four real components with the app's styles, fonts and Arabic text, in Chromium at 393, 834 and 1440 px. The page was removed before commit.
On
main, the first character of a long email fell outside its line:Folder paths started up to 748 px from the card's start edge.
With this change:
main;mainit was clipped);English captures are identical before and after, apart from the "Last scanned" clock.
Firefox and WebKit were not run for this change. fix(web): keep the start of emails and folder paths in right-to-left restore rows #4711 checked the same
dir="ltr"truncation in all three engines.A table test for
emailDir(web/src/lib/direction.test.ts) covers each address case above. It fails on the PR's previous head477261dcat the Arabic-Indic-digit cases, and passes now.Web checks pass:
pnpm run lint,format:check,buildandbudget:check, and the access groups page tests.Repository checks pass:
make lint-changed,verify-bidi,verify-local-paths,verify-size-ratchetandverify-case-collisions.Evidence
Surface and build: web admin (Users list, Access groups → members, dashboard Users widget, Libraries cards), Arabic and English, at 393, 834 and 1440 px. Before on
main(262ac3d), after onb8811b67.Evidence: https://evidence.siloserver.org/r/silo-server/admin-email-rtl/
Risks
None identified. The change sets text direction and width on four elements of admin screens. In a left-to-right page nothing moves.
Out of scope, each being fixed separately:
Checklist
Council review
Rounds: 3, last reviewed
a757b425bdfa0b1b)f848b2cb)a757b425)Visual review: 2 rounds, final captures from
bdfa0b1b. Round 2 covered the Libraries cards.Fixed:
An email written in Arabic script lost its start when cut short, because the branch's first version forced every email left to right. Such an address now keeps the page's direction, as on
main(Sol S1, background round 1, f848b2c).Two numeric name parts still lost their start in Arabic. A name part of Adlam digits lost its start because the helper only looked at letters, so the domain decided (a regression from
main). A name part of ASCII digits before an Arabic domain lost its first digit (also clipped onmain). The direction now comes from the name part only, and right-to-left digits count like right-to-left letters (Sol S2 and S3, background round 2, a757b42).Three more name parts got the wrong direction:
The rule now counts only characters that set a line's direction (Sol S4 and S5, background round 3, 477261d).
477261d counted Arabic-Indic digits as right to left, so
١٢٣.alice…@example.testlost its Latin start. Only strong characters decide now. A name part of Arabic-Indic digits alone follows its domain, and a table test covers each case (Gemini G1, background round 3, b8811b6).Round 3 was the last background round, so the fixes in 477261d and b8811b6 had no review round of their own. They were checked with the table test and in Chromium.
Answered:
mainas well, and it is being fixed separately (all three, round 1).break-all, which is unchanged frommain. A wrapped path's second line starts from the left, as wrapped left-to-right text does (round 2).AI Disclosure
🤖 Generated with Claude Code
Note
Fix email and folder-path direction in right-to-left admin lists
Adds an
emailDirhelper in direction.ts that sets left-to-right direction on emails unless their local part (or domain, when the local part has only Arabic digits) starts right-to-left, in which case direction stays inherited. Covers this behavior with parameterized tests in direction.test.ts.startsRightToLeftnow uses a renamed regex with unchanged matching; only email direction and path-item layout change.Macroscope summarized 072644c.