Update the transaction thread report loading to show skeleton#65744
Conversation
…action-thread-report-loading-to-show-skeleton-for-report-actions-only-if-transaction-data-available
…action-thread-report-loading-to-show-skeleton-for-report-actions-only-if-transaction-data-available # Conflicts: # src/components/MoneyRequestReportView/MoneyRequestReportTransactionList.tsx # src/components/MoneyRequestReportView/MoneyRequestReportTransactionsNavigation.tsx # src/pages/home/ReportScreen.tsx # src/pages/home/report/ReportActionsView.tsx
…action-thread-report-loading-to-show-skeleton-for-report-actions-only-if-transaction-data-available # Conflicts: # src/pages/home/ReportScreen.tsx # src/pages/home/report/ReportActionsList.tsx # src/pages/home/report/ReportActionsView.tsx
…action-thread-report-loading-to-show-skeleton-for-report-actions-only-if-transaction-data-available
…action-thread-report-loading-to-show-skeleton-for-report-actions-only-if-transaction-data-available
…action-thread-report-loading-to-show-skeleton-for-report-actions-only-if-transaction-data-available
…action-thread-report-loading-to-show-skeleton-for-report-actions-only-if-transaction-data-available
…action-thread-report-loading-to-show-skeleton-for-report-actions-only-if-transaction-data-available
|
@allgandalf 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] |
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
src/pages/home/ReportScreen.tsx
Outdated
| const [reportMetadata = defaultReportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportIDFromRoute}`, {canBeMissing: true, allowStaleData: true}); | ||
| const [policies = getEmptyObject<NonNullable<OnyxCollection<OnyxTypes.Policy>>>()] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {allowStaleData: true, canBeMissing: false}); | ||
| const [parentReportAction] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${getNonEmptyStringOnyxID(reportOnyx?.parentReportID)}`, { | ||
| const [policies = getEmptyObject<NonNullable<OnyxCollection<OnyxTypes.Policy>>>()] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {allowStaleData: true, initialValue: {}, canBeMissing: false}); |
There was a problem hiding this comment.
I think @VickyStash is in process of removing the initialValue
There was a problem hiding this comment.
Yeah, it looks like something went wrong during the conflicts resolution. No need in initialValue: {}
There was a problem hiding this comment.
yes thats right, I will remove it
| ), | ||
| [reportActions, isOffline, canPerformWriteAction, reportTransactionIDs], | ||
| isReportTransactionThread | ||
| ? reportActions |
There was a problem hiding this comment.
I think we still want the same logic as this for report transaction thread though:
(isOffline || isDeletedParentAction(reportAction) || reportAction.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || reportAction.errors) &&
shouldReportActionBeVisible(reportAction, reportAction.reportActionID, canPerformWriteAction) &&
Why is it removed?
There was a problem hiding this comment.
I wasn't in the initial implementation, so had to double check, but I tested and I agree that we do need that filter there. I will revert it. (I think it was initially added for some render optimization, but didn't notice any impact)
| const handleDeleteModalConfirm = useCallback(() => { | ||
| setIsDeleteModalVisible(false); | ||
| if (!parentReportAction || !transaction) { | ||
| throw new Error('Data missing'); |
There was a problem hiding this comment.
How will this look like in prod?
| // Parse Fullstory attributes on initial render | ||
| useLayoutEffect(parseFSAttributes, []); | ||
|
|
||
| const ListComponent = isTransactionThread(parentReportAction) ? FlatList : InvertedFlatList; |
There was a problem hiding this comment.
I do not understand why we bringing this change here and it was not needed before? Feels quite significant change
There was a problem hiding this comment.
It was added to fix the content shifting issue in when switching between transaction reports
Without that change:
Shifting.mp4
With that change:
NoShifting.mp4
I agree that it is the significant change (even though it is only for TransactionThread).
I will revisit it, maybe I will be able to find some better solution to fix it
There was a problem hiding this comment.
When I compared it with main, the behaviour is similar as on first video, so that shifting is already on main (so the changes on this branch didn't caused it)
Maybe we don't need it or it is not in the scope of this ticket?
@mountiny Let me know your thoughts, I will revert that logic then.
There was a problem hiding this comment.
@rinej I am not sure about this change right now, could we revert it please?
There was a problem hiding this comment.
Sure, understand we don't wont to add to much changes in one PR, I reverted it ✅
If by any change we would like that logic, we can create separate issue for it
Screen.Recording.2025-07-10.at.16.24.39.mp4Also noting the receipt flickering, but NAB here |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
|
@allgandalf can you please retest again? thanks |
…-to-show-skeleton
|
I will but jest is failing can we fix that please |
…-to-show-skeleton
|
I'm on it |
|
I found some flaky test in ReportUtilsTest.ts, so it is not related to the changes in the PR. In the We are creating random report and test the It works well for all of report types, exept when When we have that type the logic inside the The tests where added 5 days ago. The fix is quite easy, just make sure that when we create the random report for tests, do not include @mountiny @allgandalf |
| parentReportIDFromRoute && parentReportActionIDFromRoute | ||
| ? ({ | ||
| ...reportOnyx, | ||
| reportID: reportIDFromRoute, | ||
| parentReportID: parentReportIDFromRoute, | ||
| parentReportActionID: parentReportActionIDFromRoute, | ||
| policyID: parentReport?.policyID, | ||
| type: CONST.REPORT.TYPE.CHAT, |
There was a problem hiding this comment.
Can you please leave more comments around this to explain why we do it?
| // Parse Fullstory attributes on initial render | ||
| useLayoutEffect(parseFSAttributes, []); | ||
|
|
||
| const ListComponent = isTransactionThread(parentReportAction) ? FlatList : InvertedFlatList; |
There was a problem hiding this comment.
@rinej I am not sure about this change right now, could we revert it please?
mountiny
left a comment
There was a problem hiding this comment.
Thank you, @pac-guerreiro @rinej can you please proactively check for new deploy blockers that might be related to this as with the memozation I would imagine there might be some issues popping up
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.1.81-0 🚀
|
|
I had to revert this because of https://expensify.slack.com/archives/C05LX9D6E07/p1752552404895209, as the flatlist changes been reverted, we did not retest the transaction thread and system messages been showing above the transaction details |
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.1.81-7 🚀
|
Explanation of Change
The PR was copied, because I need the write permission to modify it
Original PR -> #64211
Fixed Issues
$ #63253
PROPOSAL: #63253 (comment)
Tests
Transactions-Web.mp4
Offline tests
QA Steps
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))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
Transaction-android.mp4
Android: mWeb Chrome
Transactions-mWebAndroid.mp4
iOS: Native
Transactions-iOS.mp4
iOS: mWeb Safari
Transaction-mWebiOS.mp4
MacOS: Chrome / Safari
Transactions-Web.mp4
MacOS: Desktop
Transaction-Desktop.mov