Part 2 - Audit usage of Str.removeSMSDomain - #98870
Conversation
|
@shubham1206agra Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 091369606a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Explanation of Change
Six selection-list and pill components displayed user names and logins through
Str.removeSMSDomain, which only strips the@expensify.smssuffix without formatting the number. A user whose login is a phone number and who has never set a display name therefore rendered as+15551234567in these rows, while the same user appears correctly formatted everywhere that already usesformatPhoneNumber.Each of those call sites now uses
formatPhoneNumberfromuseLocalize(), so the value is reactive to the viewer's country code. Fields that hold a login (item.alternateText,item.login) are formatted directly, sinceformatPhoneNumberreturns non-phone strings untouched. Fields that hold a display name (item.text,displayName) are guarded withStr.isSMSLoginfirst, becauseformatPhoneNumberreplaces spaces with non-breaking spaces and would otherwise stop ordinary names from wrapping.Fixed Issues
$ #97957
PROPOSAL: N/A — issue owner
Tests
Precondition: account A with a phone login (
+1555…@expensify.sms) and no display name set. Log in as a second account that shares a workspace with it.(555) 123-4567and not+15551234567or+15551234567@expensify.sms.Offline tests
Same as tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
2026-08-18.15-45-53.mp4