Repository navigation
perf: mark the revealed Inbox report read after the tap paints - #106843
Conversation
|
🚧 JS00001 has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
@DylanDylann 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] |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@MelvinBot test |
|
🤖 Web test steps verification results: Verified a wide desktop viewport on dev NewDot web. Testing was blocked by unsupported right-click, prohibited reload, and unavailable offline/online and console inspection capabilities; these are verification blockers, not confirmed app defects.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 941e8ce7c3
ℹ️ 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/VideosScreen.Recording.2026-11-17.at.15.19.35.mov |
|
@BartekObudzinski All good. But I noticed a bug on staging that can block the test step
Screen.Recording.2026-11-17.at.15.22.09.mov |
|
@BartekObudzinski Actually, I’m not sure this is a bug. Since it’s not related to our change, please update step 10 to avoid it.
|
|
Updated step 10 so it checks the LHN row without going back into the chat. Thanks! |
|
🚧 JS00001 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! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/JS00001 in version: 9.5.41-0 🚀
|
|
No help site update needed — this PR improves performance by briefly deferring automatic read-state updates without changing the user workflow or making existing article guidance incorrect. |
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.5.41-2 🚀
Bundle Size Analysis (Sentry): |

Explanation of Change
The Inbox tab is preloaded in the background, and
useMarkAsReadholds the mark-as-read of the open report until the tab is shown. On the tap that shows it, the report is marked read inside the same commit. That write recomputes the derived report attributes and sorted actions and re-sorts the LHN, all before the sidebar finishes its first layout, which is whereManualNavigateToInboxTabends. With window focus it even runs twice, once from the initial pass and once from the report-change pass.This PR keeps the read but holds it until the main thread is idle (
Scheduler.scheduleWhenIdle, the existing idle helper insrc/libs/Scheduler) when the tap on the Inbox tab is what reveals the report. All of it lives in a new hook,useMarkReadAfterReveal.useMarkAsReadonly routes its two reveal reads through it and cancels a held read from its other read paths. Every other read is unchanged, including the reveal of a wide submit pre-mount. To keep the outcome the same as an immediate read:readTimeparam onreadNewestAction), so a message that arrives while it waits stays unreadlastReadTimechanged since the reveal (a comment, an expense, "Mark as read" from the context menu, or a "Mark as unread" synced from another tab)Why it matters: in production, preloaded Inbox taps that open a report get slower the longer the user was away (Windows wide p50 179ms under 1 minute, 239ms after more than 1 hour; Mac 101ms to 151ms). The longer the user is away, the more likely the last report has unread messages, so the tap pays for marking it read. Taps where the report is already read never reach this path, so they are unchanged.
Local A/B of
ManualNavigateToInboxTab(web, production build, 2x CPU throttling, window focus emulated, last report unread, 8 interleaved taps per arm):Scheduler.scheduleWhenIdle)requestIdleCallback, for comparisonIn the profiles, the
readNewestAction, OnyxDerived recompute and LHN re-filter time between the tap and the span end drops to zero.The only visible difference: the open report's LHN row can stay bold for about 100 to 150ms after the tap before it switches to read.
Fixed Issues
$ #106860
PROPOSAL: N/A
Tests
Offline tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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
Chrome, production build, scripted against the local server with window focus emulated. Final read state taken from Onyx storage, 2 runs per build, same result on main and this PR:
🤖 Generated with Claude Code