Improve MoneyRequestReportView#58903
Conversation
96e3b43 to
5f01212
Compare
- fix date column size - add basic scrolling to bottom functionality
58136d4 to
0512fc9
Compare
src/components/MoneyRequestReportView/MoneyRequestReportTableHeader.tsx
Outdated
Show resolved
Hide resolved
|
@Kicu could you list out what is done here? Then I can review it first |
* Add totals under table * Move summary row to TransactionList
|
@DylanDylann I will list this and make it much better for reviewing in a few hours todaym, once I finalize a few more things 👍 |
b384ab4 to
22606bc
Compare
|
hey @DylanDylann sorry it took so long, this is quite a complicated view 😅 Here's what I'm expecting to work:
What's expected to NOT work:
You can start reviewing these parts now. I will try to open it tomorrow for review and will ask you before pushing any more changes. Thanks! 🙏 |
|
@Expensify/design feel free to drop any comments with the caveats described here: https://swmansion.slack.com/archives/C07NMDKEFMH/p1742917369637919?thread_ts=1742890386.286389&cid=C07NMDKEFMH |
|
quick demo: rec-demo.mp4 |
|
@DylanDylann @mountiny @luacmartins in here I described why I'm rewriting parts of logic related to scrolling etc for anyone that might think it's weird or unnecessary 😅 |
|
🚧 @luacmartins has triggered a test app build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
@DylanDylann conflicts resolved, I needed to slightly change logic of showing empty state/skeletons.
I can't reproduce this :/ the only thing I can reproduce is that initially smaller amount of transactions load and then after a second all transactions load which looks bad - but I didn't have the case where no transactions were displayed. There is small bug we found in related to this which @jnowakow will fix in his PR. But this change will come in a separate PR |
|
🚧 @mountiny has triggered a test app build. You can view the workflow run here. |
mountiny
left a comment
There was a problem hiding this comment.
Big PR, I expect there will be some new things which pop up after QA testing in staging, but great to move this ahead
| // Single transaction report will open in RHP, and we need to find every other report ID for every sibling to `activeTransaction` | ||
| // we use this data to display prev/next arrows in RHP for navigating between transactions | ||
| const sortedSiblingTransactionReportIDs = sortedData.transactions | ||
| .map((transaction) => { | ||
| const action = getIOUActionForTransactionID(reportActions, transaction.transactionID); | ||
| return action?.childReportID; | ||
| }) | ||
| .filter((reportID): reportID is string => !!reportID); | ||
|
|
||
| setActiveTransactionReportIDs(sortedSiblingTransactionReportIDs); | ||
|
|
There was a problem hiding this comment.
Coul dbe nice to cover this logic with unit test
| headerStyles={[styles.emptyStateMoneyRequestReport]} | ||
| lottieWebViewStyles={styles.emptyStateFolderWebStyles} | ||
| headerContentStyles={styles.emptyStateFolderWebStyles} | ||
| minModalHeight={380} |
There was a problem hiding this comment.
Could we add this as a CONST?
There was a problem hiding this comment.
we could, but I don't think it's that important. This component itself is a specific component dedicated to MoneyRequestReport. Also empty state inside it also uses a specific number as a default:
If I'm to make this a const, I would still keep it inside this file. I don't think is a value that anyone else should read or use. Its a specific height for this specific component
| * By default api returns report actions newest-first, and then older ones on subsequent pagination calls. | ||
| * If this flag is set to true, api will return oldest first starting from the beginning of report. | ||
| */ | ||
| useTableReportView?: boolean; |
There was a problem hiding this comment.
I think it now can be set as true always and basically indicates the client version can handle this new view. in BE we check if the user has the beta and only then we return the reversed order
src/libs/actions/Report.ts
Outdated
|
|
||
| // temporary flag will be removed once ReportScreen supports MoneyRequestReportView - https://github.com/Expensify/App/issues/57509 | ||
| // Permission will be removed before the end of the project | ||
| if (temporaryShouldUseTableReportView && Permissions.canUseTableReportView(allBetas)) { |
There was a problem hiding this comment.
But you do not have to check for the beta anymore, its handled in the BE
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
|
@mountiny I can add some unit tests and fix the permissions check in ~30mins |
|
Great, thank you! |
|
Excited to get this one merged, looking good on my end 👍 |
4eea9f6 to
8d628fe
Compare
|
@mountiny removed the permissions check and added some unit tests for picking reportIDs. It will be used for tests (and stories). So right now the file is a bit messy, but it will be updating it whenever me (or one of the other guys from SWM) will be adding any tests :) |
bb9f6a0 to
739e58d
Compare
| */ | ||
|
|
||
| function setActiveTransactionReportIDs(ids: string[]) { | ||
| // Cleaning previously saved keys because |
There was a problem hiding this comment.
NAB was there an end to this sentence?
| // Cleaning previously saved keys because | |
| // Cleaning previously saved keys because |
There was a problem hiding this comment.
I will fix in another PR 😅
| case undefined: | ||
| return 'Cash'; | ||
| return 'iou.cash'; |
There was a problem hiding this comment.
NAB do we need this specific case? Can't we just use the default?
There was a problem hiding this comment.
will see if default handles it, but most likely we can make improve it
|
✋ 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.22-0 🚀
|
|
🚀 Deployed to production by https://github.com/grgia in version: 9.1.22-10 🚀
|
| shouldDisplaySearchRouter | ||
| shouldShowBackButton={shouldUseNarrowLayout} | ||
| onBackButtonPress={Navigation.goBack} | ||
| linkKey="notFound.noAccess" |
There was a problem hiding this comment.
Coming from #60014. This caused an issue where the This chat doesn't exist message was duplicated, since we're setting both subtitleKey and linkKey. We removed linkKey since it's unnecessary in this context.
| </View> | ||
| )} | ||
| <View style={[styles.dFlex, styles.flexRow, listHorizontalPadding, styles.justifyContentBetween, styles.mb2]}> | ||
| <Text style={[styles.textLabelSupporting]}>{hasComments ? translate('common.comments') : ''}</Text> |
There was a problem hiding this comment.
The comments subheader should have been moved outside the !isEmpty(transactions) condition so that it's displayed for reports with no transactions too.
Coming from #63076
|
|
||
| // Single transaction report will open in RHP, and we need to find every other report ID for the rest of transactions | ||
| // to display prev/next arrows in RHP for navigating between transactions | ||
| const sortedSiblingTransactionReportIDs = getThreadReportIDsForTransactions(reportActions, sortedData.transactions); |
There was a problem hiding this comment.
We need to filter out pending delete transactions to avoid issue of navigating to those transactions.








Work in progress
This adds more updates to
MoneyRequestReportView.Also updates existing header that is displayed for single-transaction view to add navigation to it (< >).
Things fixed:
<>buttons on TransactionReport opened in RHPlist of required followups
Explanation of Change
Fixed Issues
$ #57508
$ #58851
$ #58854
$ #58813
$ #58857
PROPOSAL:
Tests
Offline tests
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))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
MacOS: Desktop