Skip HTML parsing for task report names when content is plain text#83439
Skip HTML parsing for task report names when content is plain text#83439mountiny merged 6 commits intoExpensify:mainfrom
Conversation
|
@hoangzinh 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: 28bad5f554
ℹ️ 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".
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-02-26.at.18.44.57.a.movAndroid: mWeb ChromeScreen.Recording.2026-02-26.at.18.46.26.ac.moviOS: HybridAppScreen.Recording.2026-02-26.at.18.50.13.moviOS: mWeb SafariScreen.Recording.2026-02-26.at.18.48.43.movMacOS: Chrome / SafariScreen.Recording.2026-02-26.at.18.42.54.web.mov |
| return Parser.htmlToText(report?.reportName ?? '').trim(); | ||
| const taskName = report?.reportName ?? ''; | ||
|
|
||
| return Parser.isHTML(taskName) ? Parser.htmlToText(taskName).trim() : taskName.trim(); |
There was a problem hiding this comment.
Is it worth moving the Parser.isHTML check into the Parser.htmlToText method? Or should we maintain the separation of concerns between those methods?
There was a problem hiding this comment.
I think we should always target to maintain the separation of concerns
|
🚧 @mountiny 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! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.3.27-0 🚀
|
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.3.27-8 🚀
|
Explanation of Change
Added a
Parser.isHTML()utility method that checks whether a string contains HTML tags before attempting to parse it. Applied this check in bothReportNameUtils.tsandReportUtils.tswhen resolving task report names — if the name is plain text, we skip thehtmlToTextcall entirely. This avoids unnecessary regex/DOM parsing overhead on every render of a task report name, which is a hot path in the LHN and report header.On Ryan's account with a lot of tasks (all their names masked so it's not HTML) it reduced the time of parsing from 1.4s to ~20ms (time spent on
isHTMLchecks).Fixed Issues
$ #83505
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.mov
Android: mWeb Chrome
iOS: Native
ios.mov
iOS: mWeb Safari
ios-web.mov
MacOS: Chrome / Safari
web.mov