[No QA] Add reasonAttributes to ReportHeaderSkeletonView usage sites#84398
[No QA] Add reasonAttributes to ReportHeaderSkeletonView usage sites#84398sosek108 wants to merge 2 commits intoExpensify:mainfrom
Conversation
|
@mananjadhav 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: 92b9a658a6
ℹ️ 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".
| return ( | ||
| <View style={styles.flex1}> | ||
| <ReportHeaderSkeletonView /> | ||
| <ReportHeaderSkeletonView reasonAttributes={{context: 'MoneyRequestReportView', isLoadingApp: !!isLoadingApp}} /> |
There was a problem hiding this comment.
Memoize reasonAttributes passed to skeleton spans
reasonAttributes is created inline here, so it gets a new object identity on every render while the skeleton is visible. In useSkeletonSpan, the update effect is keyed by reasonAttributes and calls span.addEvent(...) on each change, so this will emit duplicate skeleton attribute-update events for ordinary re-renders (e.g., Onyx updates during app load), which adds telemetry noise and can skew infinite-skeleton diagnostics. Please pass a memoized object (or a stable constant when values are static) so updates only happen when attribute values actually change.
Useful? React with 👍 / 👎.
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Explanation of Change
Wires
reasonAttributesinto every call site ofReportHeaderSkeletonViewso that Sentry skeleton spans include structured context about why the skeleton is showing. Previously, all skeletons emitted identical, anonymous spans; now each usage site passes acontextstring (e.g.'ConciergePage','HeaderView') plus the relevant boolean loading flags, making infinite-skeleton investigations in Sentry dramatically faster.Files changed:
src/pages/ConciergePage.tsx—context: 'ConciergePage', flags:isLoadingReportData,hasConciergeReportIDsrc/pages/TrackExpensePage.tsx—context: 'TrackExpensePage', flags:isLoadingHasSeenTrackTrainingsrc/pages/SubmitExpensePage.tsx—context: 'SubmitExpensePage'src/pages/inbox/HeaderView.tsx—context: 'HeaderView', flags:hasReportID,hasTitlesrc/pages/TransactionDuplicate/Review.tsx—context: 'TransactionDuplicateReview', flags:hasLoadedThreadReportActions,hasLoadedParentReportActionssrc/components/MoneyRequestReportView/MoneyRequestReportView.tsx— updatedInitialLoadingSkeletonto accept and forwardreasonAttributes; passed to both skeleton render pathsFixed Issues
$ #83398
PROPOSAL:
Tests
Offline tests
N/A
QA Steps
N/A — this change only adds telemetry metadata, no behavioral changes
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