Repository navigation
Fix: reuse each web chart's lazy component so remounts skip the spinner - #105283
luacmartins merged 3 commits into
Conversation
|
@sharabai any update here? |
|
Sergei is sick, so no update here :( |
|
@MelvinBot review |
|
@codex review |
|
@MelvinBot find regressions |
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. |
|
🤖 Web test steps verification results: Web verification was blocked: the account has no expenses, Concierge returned no chart, and the production spinner fix remains unverified. Code review found no actionable regressions; all 35 tests across five focused Jest suites passed.
|
|
🤖 Web test steps verification results: Browser verification was blocked by missing expenses and chart replies, so production spinner behavior remains unverified. No actionable regressions were found in the lazy-cache/retry logic or reveal lifecycle: 97 existing tests passed, plus 11 temporary adversarial tests covering concurrent loading, failures, remounts, and prop changes.
|
|
Codex Review: Didn't find any major issues. Another round soon, please! 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". |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
JmillsExpensify
left a comment
There was a problem hiding this comment.
No product review required
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / Safariweb-resize.mp4 |
|
🚧 luacmartins 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/luacmartins in version: 9.5.36-0 🚀
|
|
No help site update needed — this PR only fixes loading-spinner flicker when reopening previously loaded charts; it adds no feature or workflow and makes no existing article sentence incorrect. |
|
No FullStory changes needed — this PR only fixes spinner flicker when reopening previously loaded web charts, without adding new user-facing functionality or sensitive content. |
|
Hi @sharabai. QA team couldn’t test Test 2, step 2.
Could you either explain exactly how to do it, or verify this scenario internally? |
|
Thanks @IuliiaHerets! Here's test 2 recorded on the ad hoc build with DevTools open: pr-105283-test-2-failed-chart-loads-on-next-mount-devtools.mp4Request conditions is in DevTools' ⋮ menu (top right of DevTools) under More tools, and it opens in the bottom drawer. Click + in its toolbar, type |
|
@sharabai The QA team tested this in staging, not in the ad hoc build. |
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.5.36-0 🚀
Bundle Size Analysis (Sentry): |






Explanation of Change
WithSkiaWebcreates a newReact.lazyon every mount, and a new lazy suspends on its first render even when the chart's code and CanvasKit are already loaded. Production React commits the Suspense fallback for that render, soChartRevealheld its spinner over every chart remount. Concierge chart replies have noChartReveal, so each time one opened, its bare fallback box showed for about 300 ms, the least time production React keeps a committed fallback on screen. Dev React replays the resolved lazy first, so a dev build never shows it.SkiaWebChartnow callsLoadSkiaWebitself and keeps one lazy per chart loader, so a remount renders without suspending.getLazyChartdrops a lazy whose load failed. A top-levellazywould keep that failure for the session and break the next-mount retry that theload-skia-web-fail-closedpatch from #102138 relies on. Native uses theindex.native.tsxentry points and is unchanged.Fixed Issues
$ #105285
PROPOSAL: N/A
Follow-up to #103210
Tests
Preconditions:
pr-testing.expensify.comlink in the test build comment), in Chrome on desktop.Tests 1 and 3 exercise the fix. Test 2 is regression coverage for the retry after a failed load.
1. Switching between chart views that already loaded shows no spinner (Account A, web)
Confirm the flash on main
2. A chart that failed to load loads on its next mount (Account A, web)
/canvaskit-0.41.0.wasm, press Enter, then reload the page.canvaskit-0.41.0.wasmpattern.3. Reopening a Concierge reply with a chart shows no loading box (Account A, web)
/conciergepage. If the chat opens on "Ask me anything!", click View chat history under it. Under the message that got the chart reply, click 1 Reply. Verify that the chart appears. A box with a spinner can show the first time.Confirm the flash on main
Offline tests
N/A: the change only decides whether a chart that already loaded suspends again when it remounts, and network state adds no path to that.
QA Steps
Same as tests, on staging, without the "Confirm the flash on main" blocks.
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
N/A: native charts render through the
index.native.tsxentry points, which this change does not touch.Android: mWeb Chrome
iOS: Native
N/A: native charts render through the
index.native.tsxentry points, which this change does not touch.iOS: mWeb Safari
MacOS: Chrome / Safari
pr-105283-test-3-reopening-concierge-chart-reply-shows-no-loading-box-on-staging-main.mp4
pr-105283-test-3-reopening-concierge-chart-reply-shows-no-loading-box.mp4
pr-105283-test-2-failed-chart-loads-on-next-mount.mp4
pr-105283-test-1-switching-between-chart-views-shows-no-spinner-on-staging-main.mp4
pr-105283-test-1-switching-between-chart-views-shows-no-spinner.mp4