Repository navigation
fix(web): show an invited account's email once on the restore Choose step - #4928
Conversation
…step An invited account's username is its email address, and the restore preview labels an account with its username (or its email when it has no username). AccountRow still added the email to the contact line, so the row showed the address twice. Leave the email out when it matches the label, ignoring case as sign-in does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
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:
|
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. |
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (claude-opus-5-5, reviewed 87ca800)
One nit, inline. Nothing blocking. The new comparison is correct for every way an account's label is built: internal/backup/users_plan.go sets it to the username, or to the email when the username is empty, and nothing rewrites it later for account items. Search (matchesFilter in restoreGroups.ts) still matches on the email, so hiding it from the row doesn't make the account harder to find. The checkbox's accessible name and the label's title stay item.label. The dir="ltr" reasoning in the contact-line comment still holds, because when there's no pending summary the line is either the email or absent. No other web page shows a restore account's email, and the report step shows labels only.
Reviewed with Claude Opus 5.5 (claude-opus-5-5) in Claude Code.
| // without regard to case, so a case-only difference is still the same address. | ||
| const contact = [ | ||
| pending, | ||
| account.username !== item.label ? account.username : null, |
There was a problem hiding this comment.
Nit (simplification, existing code next to this change): this username entry can never add anything. users_plan.go:216-220 makes the label the username whenever the username is non-empty, so account.username !== item.label is true only when the username is "", and .filter(Boolean) then drops that empty string. The comment this PR adds describes exactly that case, which makes the dead entry more confusing than before.
Suggested repair: drop the entry so the array is [pending, account.email.toLowerCase() !== item.label.toLowerCase() ? account.email : null]. This changes no output.
There was a problem hiding this comment.
I'm leaving this line alone. It predates this PR, the PR doesn't change it, and dropping it wouldn't change any output, so it belongs in a separate cleanup. The email entry now uses the same exact comparison, so the two lines read alike.
🤖 Claude Code (claude-opus-5-5)
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (gpt-6.2-sol, reviewed 87ca800)
AI disclosure. Codex in T3 Code reviewed the pinned diff and traced the restore paths. It checked text direction with FriBidi and identifier equality with PostgreSQL 18.6 via PGlite.
…ail shown Compare the email to the row's label exactly. Lowercasing in the browser could hide an email the database treats as a different sign-in name, such as one whose case differs in a Greek final sigma. An invited account's username and email are the same string, so exact equality still drops the repeat. Isolate the name with <bdi> so it reads in its own direction: on a right-to-left page an address that starts with digits no longer shows its domain first, now that no contact line repeats it in order. 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 (claude-opus-5-5, reviewed 51841e6)
One new finding, a nit, inline. The exact email comparison and the duplicate-email fix are correct. The label is the exact username, or the email when there is no username (internal/backup/users_plan.go), so the equality holds on every account path that reaches AccountRow. Omitted accounts have no account and render elsewhere. Search (restoreGroups.ts), the checkbox's aria-label, title, and the details panel read item.label or the raw fields, so the change doesn't affect them.
My round-1 finding O1 (the username entry in the contact array can't add text) is resolved: it predates this PR, changes no output, and is out of scope.
AI disclosure
Review written by Claude Opus 5.5 (claude-opus-5-5) in Claude Code.
Problem
Related issue: N/A
Validation tasks: none
Other clients: N/A (web admin only; the Apple, Android, and Roku apps have no backup restore screen)
On the backup restore Choose step, an account created from an invitation shows its email twice: once as the row's name and again as the muted contact line beside it. On a one-line row the repeated line also keeps the name capped at 45% of the row, so two invited accounts whose addresses differ only after the
@are both cut short and read the same. This change shows the address once, and the name then uses the whole row.An invited account is created with its username and email set to the same address (
internal/invitations/service.go), and the restore preview names an account by its username, or by its email when it has none (internal/backup/users_plan.go).AccountRowleft the username out of the contact line when it matched the name, but always added the email.Approach
AccountRowleaves the email out of the contact line when it is exactly the row's name. The comparison is exact on purpose: the browser and the database don't lowercase every letter the same way, so a case-insensitive match could hide an email the database treats as a different sign-in name. The name's text is also isolated in<bdi>, so on a right-to-left page an address that starts with digits reads in order now that no contact line repeats it. Since #4788 the 45% cap applies only when the contact line is non-empty, so these names now get the whole row. Rows whose email differs from the name are unchanged, and a matched account keeps its pending summary ("40 plays · 3 ratings to add") without the repeated address. The Choose step's search still matches the email.Validation
main. The accounts cover two invited accounts whose addresses differ only in the domain, an account with a separate username and email, a matched invited account with data to add, an email that differs from its username only in case, an account with no username, and an invited address that starts with digits. A second list covers invited addresses too long for one line, a long matched account, a merge into a differently named account, and an admin. Before, at a 680 px row, both invited names and both repeated lines are cut short and read the same. After, every name shows in full at 680, 720, 786, 800, and 880 px, in English and Arabic; an address too long for the row wraps instead. The digit-first address reads in order in Arabic, and the case-only email still shows. On the phone, below the one-line switch, and at extra-large text, only the repeated line goes. No page scrolls horizontally at any size. A dev deployment wasn't available for this run, so the captures don't come from a full restore flow. The temporary page isn't part of this change.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/restore-invited-email/
Risks
None identified. The change only affects which text the row shows; selection, the restore request, and the server are untouched.
Follow-ups
<bdi>dropped on a cut-short name.Checklist
Council review
Background review: 2 rounds, last reviewed 51841e6
Visual review: 2 rounds. Round 1 compared the change on
mainbefore #4788 merged; round 2 compared it on #4788's final head. The captures were retaken on this head, including the two rows the review fixes change, which the members didn't review again.Fixed: round 1 of the visual review found that, without #4788, removing the repeat left invited names cut short beside empty space; the change was then verified on top of #4788, which has since merged. Sol's background review found an address that starts with digits reading out of order in Arabic once its in-order copy was gone (S1), and a case-insensitive match hiding an email the database treats as different (S2); both are fixed in 2e1534a. Answered: Opus noted that the username entry in the contact list can never add text (O1); it predates this PR, and dropping it changes no output. Open after merge: Opus's round 2 found that WebKit drops the "…" when a name cut short beside a contact line sits in the
<bdi>(O2), confirmed in Playwright WebKit; #5007 fixes it, together with #4837, by giving the name its own direction instead of the<bdi>. The remaining visual notes predate this change: acomleft on its own line when a phone wraps a long address, and a capped Latin name losing its start in Arabic, which is tracked in #4837. The Arabic contact line aligning away from its name was fixed onmainby #4878.AI Disclosure
🤖 Generated with Claude Code