Extract LHN alternateText computation into shared ReportAlternateTextUtils - #99061
Conversation
…arity # Conflicts: # src/libs/OptionsListUtils/index.ts
# Conflicts: # src/libs/OptionsListUtils/index.ts # src/libs/SidebarUtils.ts
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
Code Review — LGTM ✅This is a clean, genuinely behavior-preserving refactor. I verified the extraction is safe (byte-for-byte on the moved logic), the parity test is a real guard, and the LHN previews still render on web. No blocking issues found. What this PR doesExtracts the LHN alternate-text (row preview) computation out of Verification1. No behavior drift. The moved bodies ( 2. No circular-import hazard. Dependency direction is one-way ( 3. Re-exports resolve. 4. The parity test is a real guard, not a tautology. Confirmed against the commit graph: the snapshot baseline was captured in a commit where App test (web)Drove the LHN on dev NewDot web to confirm previews still render:
Note: the test account has only one LHN row (Concierge), so varied preview types (attachments, IOU/expense, task previews) weren't exercised interactively — those are covered by the parity snapshots and existing ScreenshotsLHN Inbox list showing Concierge row with preview text, report open in main pane
LHN Inbox preview text unchanged after navigating away to Home and back
Minor observations (non-blocking)
Nice groundwork for the Search-preview follow-up. 👍 |
|
@thelullabyy 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] |
|
@sosek108 conflicts |
# Conflicts: # src/libs/OptionsListUtils/index.ts # src/libs/SidebarUtils.ts # tests/unit/OptionsListUtilsTest.tsx
resolved. I'll check again in few hours |
|
Test failure doesn't cause by this PR |
|
The tests should be fixed on main now. |
|
Thanks for approving! I've merged main so checks should pass. Let's see 👀 |
mountiny
left a comment
There was a problem hiding this comment.
LGTM, mainly moving things around
|
Given this is zero change refactor but with huge surface, I will merge this now to avoid conflicts and risking we miss something. I hope Frank wont be mad |
|
🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
Hi @sosek108. Is it |
|
@IuliiaHerets This PR does not change behavioral part of LHN but I think that it should be tested - compared to staging if there is no change in subtext of LHN entries |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.4.70-0 🚀
|
|
No help site changes are required for this PR, so I did not create a draft docs PR. This is a zero-behavior-change refactor. It moves the LHN alternate-text (row preview) computation out of What I checked
Help site articles document what users do and see. A pure internal module extraction has no surface there. If the planned follow-up PR (making Search previews reuse this pipeline) changes what text users actually see in Search results, that one may well need a docs update — re-run this request on that PR when it opens. @sosek108, no help site PR was created because no changes are needed. Please confirm you agree, or tell me what user-facing behavior you think changed and I'll take another look. |
|
@sosek108 can you please share QA steps then? |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.4.72-0 🚀
|
Help site review: no changes required — no draft PR createdThis PR is a zero-behavior-change internal refactor, so nothing under Why
What I checked in the help siteI searched Because no changes are required, I did not create a draft help site PR, apply the @sosek108, no help site PR was created because this refactor produces identical user-facing text. If you believe a docs update is still needed here, reply with what behavior you want documented and I'll open the draft PR. |
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.4.72-2 🚀
Bundle Size Analysis (Sentry): |


Explanation of Change
Zero-behavior-change refactor. Extracts the entire LHN alternate-text (row preview) computation out of
SidebarUtils.getOptionDatainto a new pure module,src/libs/ReportAlternateTextUtils.ts:getReportAlternateText— the full special-action chain, actor prefixes, and welcome-message fallbacks, moved byte-for-byte out ofSidebarUtils.getLastMessageTextForReportand its dependency closure, moved fromOptionsListUtilsand re-exported there, so no import site had to change.getWelcomeMessage/getRoomWelcomeMessage, moved fromSidebarUtils(still available on its default export).A new 145-case snapshot parity test (
tests/unit/ReportAlternateTextParityTest.ts) guards this: the snapshots were captured against the pre-extraction code in a separate first commit, so CI proves there is zero output diff caused by the extraction itself.This is groundwork for a follow-up PR that makes Search previews reuse this exact LHN pipeline instead of approximating it.
Fixed Issues
$ #98958
PROPOSAL:
Tests
npm run test -- tests/unit/ReportAlternateTextParityTest.ts— 145 snapshot cases pass.npm run test -- tests/unit/SidebarUtilsTest.ts tests/unit/OptionsListUtilsTest.tsx— pass.Offline tests
N/A (pure refactor, no behavior change)
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
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
Side by side comparison (left is branch, right is staging)
Nagranie.z.ekranu.2026-08-26.o.15.29.02.mov