Repository navigation
Conversation
…lhn-name-computation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@aimane-chnaif 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 85f4d28e17
ℹ️ 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".
|
|
||
| // eslint-disable-next-line @typescript-eslint/no-deprecated | ||
| const reportName = getReportName({report, policy, invoiceReceiverPolicy, isReportArchived, conciergeReportID}); | ||
| const reportName = getReportNameFromDerived(report, reportAttributesDerived); |
There was a problem hiding this comment.
Preserve non-derived fallback for LHN report titles
This change makes getOptionData() depend entirely on reportAttributesDerived for display names and otherwise falls back to raw report.reportName, which is often empty for optimistic chats (for example buildOptimisticSelfDMReport sets reportName: '' in src/libs/ReportUtils.ts). In states where ONYXKEYS.DERIVED.REPORT_ATTRIBUTES is not populated yet (initial hydration, optimistic updates), LHN entries can now render blank titles; the previous ReportUtils.getReportName(...) call computed participant/policy-based names and avoided that regression.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
The fallback is already handled. getReportName in ReportNameUtils.ts (line 943) returns reportAttributesDerivedValue?.[report.reportID]?.reportName ?? report.reportName ?? '', so when derived data isn't populated yet it falls back to report.reportName.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-03-10.at.11.11.50.am.mov |
|
ESLint check is failing |
|
The ESLint check is failing on main as well |
|
|
||
| // eslint-disable-next-line @typescript-eslint/no-deprecated | ||
| const reportName = getReportName({report, policy, invoiceReceiverPolicy, isReportArchived, conciergeReportID}); | ||
| const reportName = getReportNameFromDerived(report, reportAttributesDerived); |
There was a problem hiding this comment.
Yes, this PR changes the code path for roomName (line 920). The old getReportName from ReportUtils would fall back to full name computation when derived data wasn't ready, while the new getReportNameFromDerived falls back to report.reportName. In normal flow (derived populated) both return the same value. The @ prefix difference comes from what's stored in derived vs what the legacy computation produced.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 85f4d28e17
ℹ️ 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".
|
|
||
| // eslint-disable-next-line @typescript-eslint/no-deprecated | ||
| const reportName = getReportName({report, policy, invoiceReceiverPolicy, isReportArchived, conciergeReportID}); | ||
| const reportName = getReportNameFromDerived(report, reportAttributesDerived); |
There was a problem hiding this comment.
Fall back when derived report name is unavailable
This call now relies entirely on reportAttributesDerived, but that value is optional and can be temporarily missing/partial during hydration or right after report updates. In those windows getReportNameFromDerived() falls back to report.reportName, which is often empty for DM/group chats, so the LHN row text can render blank until a later derived recompute. The previous ReportUtils.getReportName(...) path computed a display name immediately from report participants/policy data, so this is a user-visible regression in sidebar labeling.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
same as above
…lhn-name-computation
|
🚧 @JS00001 has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/JS00001 in version: 9.3.35-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.3.35-1 🚀
|


Explanation of Change
getOptionDatainSidebarUtils.tswas calling the deprecatedgetReportNameutility (which recomputes the report name from scratch on every call) in two places during LHN render. This PR replaces both call sites withgetReportNamefromReportNameUtils, which reads the pre-computed name from thereportAttributesDerivedOnyx derived value that is already passed intogetOptionData. The derived value is populated once per Onyx update cycle, so renderItem no longer pays the computation cost on each call. Local measurement shows ~15ms improvement in theManualNavigateToInboxSpanmetric.Fixed Issues
$ #77175
PROPOSAL:
Tests
Offline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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