Repository navigation
Fix skeleton loader flash on Inbox Unread/To-dos tabs when receiving a message - #93533
Conversation
…ects Co-authored-by: Youssef Lourayad <youssef-lr@users.noreply.github.com>
|
🚧 @youssef-lr has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
@youssef-lr 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
App/src/pages/inbox/sidebar/SidebarLinks.tsx
Lines 86 to 89 in 8299879
When switching accounts/delegate sessions or reauthing after an Onyx clear, the report collection is emptied and openApp() sets IS_LOADING_REPORT_DATA=true; however BaseSidebarScreen suppresses its outer skeleton after the first app load via the module-level hasEverFinishedLoading flag. Now that the inner IS_LOADING_REPORT_DATA && optionListItems.length === 0 fallback has been removed, this branch renders the empty LHN while the new account’s reports are still loading, so users can briefly see “no chats”/“caught up” even though chats are about to populate. Please keep a guarded loading state for the Onyx-cleared/openApp path while avoiding the reconnect flash.
ℹ️ 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".
|
@MelvinBot address this #93533 (review) |
Address Codex review: gate the loading skeleton on the unfiltered report set (orderedReportIDs) being empty rather than the per-tab filtered list, so account switches/delegate sessions/reauth show a loader while reports repopulate, while still avoiding the reconnect flash on Unread/To-do tabs. Co-authored-by: Youssef Lourayad <youssef-lr@users.noreply.github.com>
|
Addressed in 3830a90. Codex is right: removing the inner skeleton entirely also dropped the legitimate loading state for the Onyx-cleared/ Fix: restore a guarded skeleton, but gate it on the unfiltered report set instead of the current tab's filtered list. The distinguishing signal between the two scenarios is whether any reports exist:
This keeps the reconnect flash fixed (the original AI checks run locally on the new commit: |
Co-authored-by: Youssef Lourayad <youssef-lr@users.noreply.github.com>
|
Fixed the failing Spell check check: cspell flagged the non-dictionary word The remaining |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
Valforte
left a comment
There was a problem hiding this comment.
Changes LGTM, can you address the author checklist?
parasharrajat
left a comment
There was a problem hiding this comment.
Reviewer Checklist
- I have verified the author checklist is complete (all boxes are checked off).
- I verified the correct issue is linked in the
### Fixed Issuessection above - I verified testing steps are clear and they cover the changes made in this PR
- I verified the steps for local testing are in the
Testssection - I verified the steps for Staging and/or Production testing are in the
QA stepssection - I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
- I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
- I verified the steps for local testing are in the
- I checked that screenshots or videos are included for tests on all platforms
- I included screenshots or videos for tests on all platforms
- I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
- I verified tests pass on all platforms & I tested again on:
- Android: HybridApp
- Android: mWeb Chrome
- iOS: HybridApp
- iOS: mWeb Safari
- MacOS: Chrome / Safari
- If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
- I verified proper code patterns were followed (see Reviewing the code)
- I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e.
toggleReportand notonIconClick). - I verified that comments were added to code that is not self explanatory
- I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
- I verified any copy / text shown in the product is localized by adding it to
src/languages/*files and using the translation method - I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
- I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
- I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
- I verified the JSDocs style guidelines (in
STYLE.md) were followed
- I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e.
- If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
- I verified that this PR follows the guidelines as stated in the Review Guidelines
- I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like
Avatar, I verified the components usingAvatarhave been tested & I retested again) - I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
- I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
- If a new component is created I verified that:
- A similar component doesn't exist in the codebase
- All props are defined accurately and each prop has a
/** comment above it */ - The file is named correctly
- The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
- The only data being stored in the state is data necessary for rendering and nothing else
- For Class Components, any internal methods passed to components event handlers are bound to
thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor) - Any internal methods bound to
thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick) - All JSX used for rendering exists in the render method
- The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
- If any new file was added I verified that:
- The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
- If a new CSS style is added I verified that:
- A similar style doesn't already exist
- The style can't be created with an existing StyleUtils function (i.e.
StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
- If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
- If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like
Avataris modified, I verified thatAvataris working as expected in all cases) - If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
- If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
- If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
- I verified that all the inputs inside a form are aligned with each other.
- I added
Designlabel and/or tagged@Expensify/designso the design team can review the changes.
- If a new page is added, I verified it's using the
ScrollViewcomponent to make it scrollable when more elements are added to the page. - For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
- If the
mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps. - I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.
15.06.2026_19.39.30_REC.mp4
🎀 👀 🎀 C+ reviewed
|
@MelvinBot Update the PR description with this. |
|
@Valforte All set. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 @youssef-lr 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! 🧪🧪
|
Fix skeleton loader flash on Inbox Unread/To-dos tabs when receiving a message (cherry picked from commit f5e2a4d) (cherry-picked to staging by puneetlath)
📱 Mobile QA — PR #93533 · PASS ✅Reproduced the bug on
What the bug isOn the Inbox Unread / To-dos tabs (where the filtered list is legitimately empty → "You're all caught up"), a brief skeleton loader painted over the empty state whenever What the diff does
How I triggered it (note)The issue's literal trigger is "receive a message from another account". I instead toggled the device offline → online (airplane mode) while parked on the Unread tab with an empty list. This drives a Side-by-side (same reconnect moment, ~same timestamp)Left = Before —
|
| All caught up (before reconnect) | Skeleton flash on reconnect (BUG) |
|---|---|
![]() |
![]() |
main (~28s, two offline→online reconnects, compressed)
After — PR branch (fixed) ✅
Same Unread tab, same reconnect — empty state stays put, no skeleton.
| All caught up (before reconnect) | After reconnect (no skeleton — FIXED) |
|---|---|
![]() |
![]() |
Verdict
✅ PASS. On main, a reconnect while on the Unread "all caught up" tab flashes the OptionsListSkeletonView over the empty state (Actual = the reported bug). On the PR branch, the identical flow keeps the empty state with no skeleton flash (Expected). The size of the captured GIFs reflects it too — main 819 KB (animated skeleton) vs PR 108 KB (static empty state).
Caveats
- Android only — matches the issue's single reproduced platform; web/mWeb/iOS not in scope here.
- Bug triggered via a network-reconnect toggle rather than a literal inbound message (same
isLoadingReportDatacode path; see note above). - Fix applied by checking out the PR's two changed files (
SidebarLinks.tsx,SidebarLinksData.tsx) onto the test branch and reloading the JS bundle (the change is JS-only). - The "Fast Refresh disconnected" banner is a dev-bundle (Metro HMR) artifact, unrelated to the app's backend connectivity or this behavior.
🤖 Automated mobile QA run (Argent) — reproduced on main, verified on the PR branch, Android native simulator.
|
🚀 Cherry-picked to staging by https://github.com/puneetlath in version: 9.4.7-4 🚀
Bundle Size Analysis (Sentry): |
|
🤖 No help site changes required. This PR is an internal bug fix: it re-gates a transient skeleton loader in the Inbox sidebar ( There is no change to any customer-facing feature, setting, label, navigation, workflow, billing, or integration behavior — only a transient loading overlay was corrected. Nothing in |
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.4.7-4 🚀
|
|
🚀 Cherry-picked to staging by https://github.com/puneetlath in version: 9.4.8-0 🚀
Bundle Size Analysis (Sentry): |
Help site review: no changes requiredI reviewed the changes in this PR against the help site articles under Conclusion: No help site updates are required. Why:
Since no documented behavior changes, I did not create a draft help site PR. @youssef-lr, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
🚀 Cherry-picked to staging by https://github.com/puneetlath in version: 9.4.8-0 🚀
Bundle Size Analysis (Sentry): |
Help site review: no changes requiredI reviewed the changes in this PR against the help site articles under Why: This is a purely internal rendering fix. It changes the gating condition for the Inbox sidebar loading skeleton ( If anything, the fix brings the actual behavior into line with what the docs already describe. The existing articles correctly state that an empty section means "you're caught up":
These descriptions remain accurate; the skeleton flash was a transient visual bug that contradicted them, and removing it makes the UI consistent with the docs. @youssef-lr, no linked help site PR was created because the changes are internal-only and don't affect any documented behavior. If you believe a customer-facing article does need updating, let me know which one and I'll draft it. |
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.4.8-3 🚀
|







Explanation of Change
On the Inbox Unread / To-dos tabs, a brief skeleton loader + empty-state flash appeared whenever a new message arrived (DeployBlockerCash from #92146).
There are two independent skeletons in the Inbox sidebar:
BaseSidebarScreen— the cold-load skeleton, correctly guarded by a module-levelhasEverFinishedLoadingflag so it is shown only once on first load and never again, even whenisLoadingAppbriefly flips back totrueduring a reconnect.SidebarLinks— a second, unguarded skeleton that rendered wheneverisLoadingReportData && optionListItems.length === 0.PR #92146 changed
optionListItemsfrom the full report list to the filtered tab list (SidebarLinksDatanow passesfilteredReports). On the Unread/To-dos tabs that list is legitimately empty when there's nothing to show, so the second condition was constantly satisfied. When a new message arrived, a partialReconnectAppflippedisLoadingReportDatatotruewhile the filtered list was momentarily still empty — so the unguardedSidebarLinksskeleton painted on top of the empty state until the new report synced.Because
BaseSidebarScreenonly mountsSidebarLinksDataafter the first load completes (and already owns the cold-load skeleton with the proper guard), the innerSidebarLinksskeleton could effectively only ever fire in this reconnect-flash scenario. This PR removes that now-redundant skeleton (and its now-unused imports/variables). The "You're all caught up" empty state still renders correctly underneath while the incoming chat streams in — with no skeleton flash.Fixed Issues
$ #93531
PROPOSAL: #93531 (comment)
Tests
// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review"
Suggested manual test:
Offline tests
N/A — change only removes a transient loading overlay.
QA Steps
// TODO: The human co-author must fill out the QA tests you ran before marking this PR as "ready for review".
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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
🤖 Generated by MelvinBot from the approved proposal on #93531. AI checks run locally:
lint-changed✅,prettier✅, react-compilercheck(no regression vsmain— file was already in the non-compiling set) ✅,SidebarTest✅,UnreadIndicatorsTest✅.typechecksurfaced only pre-existing, unrelated errors insrc/libs/API/types.ts(untouched by this PR).