Repository navigation
[No QA] Add reasonAttributes to SearchRowSkeleton usage sites - #83697
youssef-lr merged 3 commits into
Conversation
|
@Krishna2323 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] |
|
Will start reviewing in 10mins. |
|
Reviewing... |
| const skeletonReasonAttributes = useMemo<SkeletonSpanReasonAttributes>( | ||
| () => ({ | ||
| context: 'EmptySearchView', | ||
| hasResults, |
There was a problem hiding this comment.
@sosek108 we should also pass the type so we know which search tab the empty state appeared on.
There was a problem hiding this comment.
Done — added searchType: type to skeletonReasonAttributes in EmptySearchView. Now each Sentry trace will show which tab (expense, invoice, trip, chat, etc.) was active.
| () => ({ | ||
| context: 'Search', | ||
| shouldShowLoadingState, | ||
| isDataLoaded, |
There was a problem hiding this comment.
I think we should pass root conditions instead of derived ones. shouldShowLoadingState and shouldShowLoadingMoreItems are compound booleans — they tell "it's loading" but not why. We can break them into individual flags like isOffline, isDataLoaded, isCardFeedsLoading, isSearchLoading, etc. This was agreed in the Slack discussion.
There was a problem hiding this comment.
Fixed — replaced the compound booleans with all the root-level flags that compose them:
{
context: 'Search',
isOffline,
isDataLoaded,
isCardFeedsLoading,
isSearchLoading: !!searchResults?.search?.isLoading,
hasEmptyData: Array.isArray(searchResults?.data) && searchResults?.data.length === 0,
hasErrors,
hasPendingResponse: searchRequestResponseStatusCode === null,
shouldUseLiveData,
}Same for the footer skeleton — replaced shouldShowLoadingMoreItems with isSearchLoading + searchOffset.
| const loadMoreSkeletonReasonAttributes = useMemo<SkeletonSpanReasonAttributes>( | ||
| () => ({ | ||
| context: 'Search.ListFooter', | ||
| shouldShowLoadingMoreItems: !!shouldShowLoadingMoreItems, |
There was a problem hiding this comment.
Replace derived compound booleans (shouldShowLoadingState, shouldShowLoadingMoreItems) with the individual root conditions that compose them, so Sentry traces show exactly why the skeleton is visible (isOffline, isDataLoaded, isCardFeedsLoading, isSearchLoading, hasEmptyData, hasErrors, hasPendingResponse, shouldUseLiveData, searchOffset). Also add searchType to EmptySearchView reasonAttributes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
PR doesn’t need product input as a performance tooling PR. Unassigning and unsubscribing myself. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariMonosnap.screencast.2026-03-02.19-08-32.mp4 |
|
@sosek108 we have conflicts |
|
✋ 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
This PR adds structured
reasonAttributesmetadata to allSearchRowSkeletonusage sites so that Sentry performance spans carry context about why a loading skeleton is currently visible.Previously, skeleton spans were started without any contextual metadata, making it difficult to understand in Sentry traces why a particular loading state was shown (e.g. initial load vs. loading more results vs. empty state). Now each skeleton usage passes a
reasonAttributesobject with acontextstring and relevant boolean flags:Searchcomponent (initial loading state): passescontext: 'Search',shouldShowLoadingState, andisDataLoadedSearchcomponent (load-more footer): passescontext: 'Search.ListFooter'andshouldShowLoadingMoreItemsEmptySearchView: passescontext: 'EmptySearchView'andhasResultsThe
EmptyStateComponentwas also updated to accept and forward askeletonReasonAttributesprop to its innerSkeletonComponent.Fixed Issues
$ #83408
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