-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Update the transaction report to show skeleton part 2 #66165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update the transaction report to show skeleton part 2 #66165
Conversation
allgandalf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit pics
| /** If this report is a transaction thread report */ | ||
| isReportTransactionThread?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /** If this report is a transaction thread report */ | |
| isReportTransactionThread?: boolean; | |
| /** If the report is a transaction thread report */ | |
| isReportTransactionThread?: boolean; |
src/pages/home/ReportScreen.tsx
Outdated
| policyAvatar: reportOnyx.policyAvatar, | ||
| }, | ||
| [reportOnyx, reportNameValuePairsOnyx, permissions], | ||
| // This is required to get the transaction data from the parent report, to render the optimistic transaction thread |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you elaborate more on what this means , better for future context
src/pages/home/ReportScreen.tsx
Outdated
| const reportIDFromRoute = getNonEmptyStringOnyxID(route.params?.reportID); | ||
| const reportActionIDFromRoute = route?.params?.reportActionID; | ||
| const parentReportIDFromRoute = route?.params?.parentReportID; | ||
| const parentReportActionIDFromRoute = route?.params?.parentReportActionID; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you instead do:
const {reportActionIDFromRoute, parentReportIDFromRoute, parentReportActionIDFromRoute} = route?.params;| }, | ||
| }; | ||
| }), | ||
| [translate, parentReportAction, transaction, reportID, report], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please fix this warning
| const getStatusIcon: (src: IconAsset) => ReactNode = useCallback( | ||
| (src) => ( | ||
| <Icon | ||
| src={src} | ||
| height={variables.iconSizeSmall} | ||
| width={variables.iconSizeSmall} | ||
| fill={theme.icon} | ||
| /> | ||
| ), | ||
| [theme.icon], | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does the following way to write this not work?:
const getStatusIcon = useCallback((src: IconAsset) => (
<Icon
src={src}
height={variables.iconSizeSmall}
width={variables.iconSizeSmall}
fill={theme.icon}
/>
), [theme.icon]);|
@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] |
|
@allgandalf all feedback addressed and PR is ready for review! YOU SHALL PASS this PR 😎 |
|
🚧 @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.
allgandalf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
codewise LGTM, testing now
|
@allgandalf Thanks for review and finding the issue. I added the fix for it. Please have a look now :) fixed-bottom-scrolling.mov |
src/ROUTES.ts
Outdated
| if (parentReportID) { | ||
| queryParams.push(`parentReportID=${parentReportID}`); | ||
| } | ||
|
|
||
| if (parentReportActionID) { | ||
| queryParams.push(`parentReportActionID=${parentReportActionID}`); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WojtekBoman @adamgrzybowski @pac-guerreiro @rinej I think we will need to find a way to handle this differently. Check out the routing philosophy https://github.com/Expensify/App/blob/main/contributingGuides/philosophies/ROUTING.md#--should-not-use-query-parameters
We should not use the query params, and I don't think this is an exception that should apply, as it's quite a common URL.
@rinej can you please summarise why these params are needed in the route? Let's find a different solution for this than the query params.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It won't be a beautiful solution, but according to this rule from the routing philosophy:
- SHOULD NOT use optional parameters
If there are optional parameters, use two separate route definitions instead to be explicit.
we should have 4 different routes based on the available params.
Please remember to correctly extend the screen type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an example of the screen component type that is shared between two routes https://github.com/Expensify/App/blob/main/src/pages/iou/HoldReasonPage.tsx
type HoldReasonPageProps =
| PlatformStackScreenProps<MoneyRequestNavigatorParamList, typeof SCREENS.MONEY_REQUEST.HOLD>
| PlatformStackScreenProps<SearchReportParamList, typeof SCREENS.SEARCH.TRANSACTION_HOLD_REASON_RHP>;There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I analyse it the the parentReportID and parentReportActionID were added to enable immediate display of transaction details even while report actions are still loading, so we have the necessary parent context to load related data upfront via useOnyx (in ReportScreen.tsx).
Without these parameters, we have have to wait through a loading sequence (transaction thread → parent report → parent action → transaction details), so we see the loading screen.
I think it was the fundamental idea of @pac-guerreiro to resolve the initial issue.
@WojtekBoman even if we create separate routes for each available parameter, it still wouldn’t be ideal according to the rules, since we’re supposed to avoid including ANY new parameters there - is that correct?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which rule are you referring to - avoid including ANY new parameters there? I'd like to make sure we're on the same page :) I see this rule can be broken:
- SHOULD use only the minimal necessary information to render the page
Examples:
r/:threadReportID GOOD - threadReportID is all that is needed and all the rest of the page can be derived from that
r/:parentReportID/:threadReportID BAD - the parentReportID is not necessary so it just adds cruft to the URL
On the other hand, if it makes loading faster, I think we can assume it's necessary cc: @mountiny
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I will investigate and try to find another way for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe cache it in sessionStorage or something like that? We wouldn't need to take care of cleaning this information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bump @rinej on comments ^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried another solution that didn’t require passing those parameters, but it ended up breaking the other report screens.
I’m now testing an approach that uses sessionStorage. The idea is to move the parameters from the navigation route into session storage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, lets make sure it works as expected on all platforms
|
@allgandalf @mountiny I left the rest of the code untouched as possible to preserve existing features, such as automatically scrolling to the bottom by default. web-transaciton-v2.mov |
|
@rinej love it, thank you! Are we clearing the sessions storage upon signing out? |
|
🚧 @mountiny 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, Desktop, and Web. Happy testing! 🧪🧪
|
|
Screen.Recording.2025-08-12.at.10.31.42.AM.mov |
|
Screen.Recording.2025-08-12.at.10.23.56.AM.mov |
|
Screen.Recording.2025-08-12.at.10.24.54.AM.mov |
|
Screen.Recording.2025-08-12.at.10.26.30.AM.mov |
allgandalf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please check the ^
…-skeleton # Conflicts: # src/pages/home/report/ReportActionsList.tsx
…-skeleton # Conflicts: # src/components/MoneyRequestReportView/MoneyRequestReportView.tsx
|
@rinej we can close this one 😄 |
Explanation of Change
Fixed Issues
$ #63253
PROPOSAL: #63253 (comment)
Tests
Tests flow after regression detection:
Original issue: #66109
Original issue: #66110
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
Transaction-androidWeb.mp4
iOS: Native
ios-Transaction.mp4
iOS: mWeb Safari
Transaction-iosWeb.mp4
MacOS: Chrome / Safari
Transaction-Web.mp4
MacOS: Desktop
Transaction-Desktop.mp4