Skip to content

fix(mobile): keep the telling part of long account emails in Accounts - #52227

Merged
AmoabaKelvin merged 1 commit into
mainfrom
accounts-email-middle-truncation
Nov 29, 2026
Merged

AmoabaKelvin merged 1 commit into
mainfrom
accounts-email-middle-truncation

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

Long account emails on the phone's Accounts screen were cut off at the end, so two accounts on the same long domain could look the same and you never saw the domain. Now the part that tells them apart, the name before "@", stays whole and the domain is shortened in the middle.

Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​14 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​14
Prod 8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​213 $\color{#cf222e}{\Huge{\mathbf{−}}}$​52 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​161

What Changed

Before: Claude, Codex and Antigravity account rows cut long emails at the end ("bartholomew.fitzgerald@northwind-industr…").

After: those row titles cut in the middle. For an email, the name before the last "@" stays whole and the domain loses its middle ("bartholomew.fitzgerald+claude-team@n…om" vs "bartholomew.fitzgerald@northwi…mple.com"). If the name alone doesn't fit, it falls back to an even middle cut. Screen readers still get the full email.

How:

  • Desktop's middleEllipsis(text, fits) (used by the run-target picker) moves to src/shared/text/middle-ellipsis.ts, takes the locale as a parameter, and gains emailEllipsis.
  • The phone gets one MiddleEllipsisText: on the page it measures the line (canvas, against the text's laid-out width) and caches cuts; native text uses the platform's own middle ellipsis.
  • ListRow gains titleEllipsis: 'middle' | 'email'.

Toasts are unchanged: they wrap, so "Signed in as …" already shows the whole email.

Why

The phone's page can only end-truncate text, which drops exactly the part of a long email that differs. Reusing desktop's measured middle cut keeps one implementation. An even middle cut alone wasn't enough: two logins on one domain often differ right after the start of the name (e.g. "+claude-team"), which an even cut removes, so emails keep the name and shorten the domain.

Linked Issue

No issue; follow-up to #51701 (the approved Accounts design called for middle truncation of emails).

Visual Proof

Two Claude accounts on northwind-industries-holdings.example.com, iOS simulator, against a serve built from this branch (before = main's page):

Before After
Dark (screenshot removed: contained real product data) (screenshot removed: contained real product data)
Light (screenshot removed: contained real product data) (screenshot removed: contained real product data)

Toast after adding an account (unchanged, wraps to show the full email): (screenshot removed: contained real product data)

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below
  • Every added test fails without this change and avoids the test anti-patterns

Added both accounts through the phone's sign-in sheet on an iOS 27 simulator (OTA page) and checked dark and light. One test pins the email rule: two long emails on one domain stay distinct at the same width (fails with an even middle cut). Desktop's run-target picker still uses the moved helper (typecheck and the render-path ratchet pass).

Performance

Only Accounts rows whose titles ask for it pay anything. On the page each such title reads its computed style and width once per mount or font change and runs a short binary search of canvas measurements only on a cache miss; cuts are cached by text/font/width (1,024 entries), so unchanged renders and remounts (e.g. a row going busy during a switch) do no canvas work.

Risk

Low. Visible only in account rows on the phone and in desktop's run-target picker (same algorithm, now shared). If measurement isn't available, the text falls back to today's end truncation. Plain revert backs it out.

Level: Low

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Page-only on the phone (ships with the computer's page update); no store build needed.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Long Claude, Codex and Antigravity account emails were cut at the end, so two logins on one
long domain could read the same and the domain was lost. Rows now cut long titles in the
middle: an email keeps its name before "@" whole (what tells accounts on one domain apart)
and its domain loses its middle. Desktop's middleEllipsis moves to src/shared and gains this
email variant; the phone's page measures with it (native text cuts evenly itself). Toasts
already wrap, so they keep showing the whole email.
@greptile-apps

greptile-apps Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The PR appears safe to merge; no actionable issues were found.RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no actionable issues were found.

Summary

Accounts rows now keep the email name visible and shorten the domain when space allows.

  • Phone account rows keep the email name visible while shortening the domain.
  • The desktop picker still shortens long run-target labels in the middle.

Reviews (1) · Last reviewed commit: "fix(mobile): keep the telling part of lo..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds shared middle- and email-ellipsis helpers and uses the shared middle-ellipsis helper in the renderer. Mobile text rendering now supports single-line middle truncation, with a measured and cached web implementation. Account rows request email-style title truncation through ListRow.

Merge Risk: Minimal · up to 92fa1

Long account emails on the phone Accounts screen now truncate in the middle so the distinguishing part stays visible. No concrete regression was found, and the change is easy to revert.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: long account emails on the phone's Accounts screen now keep the identifying part (the name before @) visible instead of being cut at the end. The title uses the fix(mo…
Description check Passed The description follows the repository template. It includes ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk with level, AI Disclosure, Review, Agent skill boundary, No…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: long account emails on the phone's Accounts screen now keep the identifying part (the name before @) visible instead of being cut at the end. The title uses the fix(mobile) prefix and is specific. It matches the objectives, which describe middle truncation with the name kept whole for emails.

Full details: Description check

Explanation

The description follows the repository template. It includes ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk with level, AI Disclosure, Review, Agent skill boundary, Notes, and Checklist. It explains the before and after behavior and the mechanism, and it gives the reason for the approach. The Linked Issue section cites #51701 as a follow-up but does not use a 'Fixes #' issue link, and the template says outside contributors must link an actual issue. The author does not indicate whether they are a maintainer. The lint, typecheck, test, and build checklist item is unchecked, and the AI Disclosure and Review sections are empty.

Resolution

Optional: state whether the author is a stablyai maintainer, since the Linked Issue section cites a follow-up to #51701 and does not link a 'Fixes #' issue. Complete or explain the AI Disclosure and Review sections if they apply. Check off the lint, typecheck, test, and build item once those commands pass, or note that CI covers them.

Finishing Touches

Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2ec420ad-de08-476d-89e6-65dcdcb79f9c
Commits

Reviewing files that changed from the base of the PR and between ca2f6c1 and 92fa1f0.

Files selected for processing: 9

  • mobile/src/accounts/MobileAccountsScreen.tsx
  • mobile/src/accounts/antigravity-account-section.tsx
  • mobile/src/components/list/ListGroup.tsx
  • mobile/src/components/text/MiddleEllipsisText.tsx
  • mobile/src/components/text/MiddleEllipsisText.web.tsx
  • src/renderer/src/components/new-workspace/run-target/MiddleEllipsisLabel.tsx
  • src/renderer/src/components/new-workspace/run-target/middle-ellipsis.ts
  • src/shared/text/middle-ellipsis.test.ts
  • src/shared/text/middle-ellipsis.ts
Files with no reviewable changes: 1

  • src/renderer/src/components/new-workspace/run-target/middle-ellipsis.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

@AmoabaKelvin
AmoabaKelvin merged commit 8640840 into main Nov 29, 2026
100 of 102 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant