Repository navigation
[No QA] Pass skeletonReasonAttributes to CardRowSkeleton via EmptyStateComponent - #83694
Conversation
|
@QichenZhu 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] |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 51d66822c0
ℹ️ 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".
| const skeletonReasonAttributes: SkeletonSpanReasonAttributes = { | ||
| context: 'EmptyCardView', | ||
| isBankAccountVerified, | ||
| }; |
There was a problem hiding this comment.
Memoize skeleton reason attributes
skeletonReasonAttributes is recreated on every render, and useSkeletonSpan reacts to reasonAttributes identity changes by calling setAttributes and emitting an EVENT_SKELETON_ATTRIBUTES_UPDATE event each time. While this skeleton is visible, normal re-renders (e.g., layout/window changes or other state updates) will generate repeated telemetry updates with unchanged data, adding noise and unnecessary span work; this object should be memoized (or hoisted if static) before passing it down.
Useful? React with 👍 / 👎.
QichenZhu
left a comment
There was a problem hiding this comment.
I believe no C+ review is needed, so I'm approving this to unblock the process. Let me know if I'm wrong.
|
No product review needed |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
|
✋ 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! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/youssef-lr in version: 9.3.31-0 🚀
|
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.3.31-12 🚀
|
Explanation of Change
EmptyStateComponentaccepts aSkeletonComponentprop to render a skeleton UI while data loads. However, there was no way to passreasonAttributes(used for telemetry/tracing) down to that skeleton. This change:CardRowSkeletonto theValidSkeletonsunion type inEmptyStateComponent/types.tsso it is an accepted skeleton.skeletonReasonAttributesprop toEmptyStateComponentand threads it through to the renderedSkeletonComponentasreasonAttributes.CardRowSkeletonusage sites —WorkspaceCompanyCardsFeedPendingPage,WorkspaceCompanyCardsFeedAddedEmptyPage, andEmptyCardView— to pass askeletonReasonAttributesobject with an appropriatecontextstring so telemetry can identify which screen triggered the skeleton.Fixed Issues
$ #83404
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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari