-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Display total and money request in offline #36657
Conversation
@abdulrahuman5196 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] |
@abdulrahuman5196 Hello! What is your ETA for the checklist? thank you! |
Hi @mountiny , Working on it. Would be completing a day. |
Reviewing now |
@@ -245,6 +248,50 @@ function ReportActionsView(props) { | |||
} | |||
}, [hasCachedActions]); | |||
|
|||
const reportActionsToDisplay = useMemo(() => { |
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.
@dukenv0307 Can we add clear comments here?
Like What are we doing here?
and Why are we doing this?
and link the decision GH comments as required.
Since this is not a straightforward approach and would be helpful for people seeing this at future
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.
Updated a comment.
Did some initial testing. i was able to test the displaying of total. But unable to complete the skeleton loading part. Will update here once done. |
Seems like BE always returns the money request action in |
@dukenv0307 Could you provide more info on this? And lint rule is failing. |
@abdulrahuman5196 That is my prediction. |
Fixed lint. |
@dukenv0307 Kindly add videos of iOS and Android native on the author's checklist? |
Updated the screenshot
I can't face this case because |
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.
@dukenv0307 , could you kindly check on these comments?
props.report.total && | ||
_.filter( | ||
props.reportActions, | ||
(action) => action.actionName === CONST.REPORT.ACTIONS.TYPE.IOU && action.originalMessage && action.originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.CREATE, |
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.
Why are we checking if create action is present or not to display the skeleton view?
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 understand in the discussion, we will add a money request action if there is no money request action in the action report. Have I misunderstood? Is it true that we will add 1 more request action if the current number of actions is not equal to the total number of requests?
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.
Is it true that we will add 1 more request action if the current number of actions is not equal to the total number of requests?
Yes. Exactly. We are checking if there is report action with CONST.IOU.REPORT_ACTION_TYPE.CREATE
type right? Or kindly correct me if I misunderstood the logic of the code.
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.
We are checking if there is report action with CONST.IOU.REPORT_ACTION_TYPE.CREATE type right
(action) => action.actionName === CONST.REPORT.ACTIONS.TYPE.IOU && action.originalMessage && action.originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.CREATE,
We are checking the report action is an created iou report action
const actions = [...props.reportActions]; | ||
|
||
if (!ReportActionsUtils.isCreatedAction(_.last(props.reportActions))) { | ||
const optimisticCreatedAction = ReportUtils.buildOptimisticCreatedReportAction( |
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.
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.
@abdulrahuman5196 I updated to fix this case.
(action) => action.actionName === CONST.REPORT.ACTIONS.TYPE.IOU && action.originalMessage && action.originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.CREATE, | ||
).length === 0 | ||
) { | ||
const optimisticIOUAction = ReportUtils.buildOptimisticIOUReportAction( |
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 to test this case locally by removing the if checks, the skeleton comes. But it is not animating like other skeletons do.
Screen.Recording.2024-02-21.at.4.25.47.PM.mov
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.
@abdulrahuman5196 The reason is MoneyRequestSkeletonView
has backgroundColor
and foregroundColor
are the same, no animation appears.
App/src/components/MoneyRequestSkeletonView.tsx
Lines 16 to 17 in 3e77445
backgroundColor={theme.borderLighter} | |
foregroundColor={theme.border} |
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 to use the same color as we do for another skeleton in the App and here is the result, do we agree with this color cc @mountiny
backgroundColor={theme.skeletonLHNIn}
foregroundColor={theme.skeletonLHNOut}
Screen.Recording.2024-02-22.at.10.37.59.mov
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.
The reason is MoneyRequestSkeletonView has backgroundColor and foregroundColor are the same, no animation appears.
Is it even previously we didn't have animation where the money request skeleton was display? 🤔
I think I remember seeing animation, not sure though
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.
Checked and it's also happening on main. Maybe it happens after we migrate theme.
@@ -245,6 +248,55 @@ function ReportActionsView(props) { | |||
} | |||
}, [hasCachedActions]); | |||
|
|||
// When we offline before opening a money request 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.
// When we offline before opening a money request report, | |
// When we are offline before opening a money request report, |
@mountiny , We are trying to test the case where all the report actions of a money report is not loaded and we show a single skeleton report action view as per here #26424 (comment). But I had created 51 money requests but still, all of the report actions are loaded before I go to the view itself. Do we have a limit on number of report actions of money requests returned from Screen.Recording.2024-02-21.at.4.33.51.PM.mov |
@abdulrahuman5196 Can you confirm with the OpenApp response that the reportActions collection is returned? I think that what you are seeing might be the case because of all the IOU report actions being parent report actions for the transaction threads and we do return all of those on OpenApp. So if that is what you are seeing it might be the case We do not return them for IOU reports though so you could make IOU p2p requests and test there |
@abdulrahuman5196 We can test skeleton case for p2p request, I tried. |
I think I have already looked into the code. I will work on platform videos in my morning. |
Sorry for the delay working on review videos now. |
checking again since we made a merge from live |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-03-23.at.11.20.07.PM.mp4Android: mWeb ChromeScreen.Recording.2024-03-23.at.11.25.43.PM.mp4iOS: NativeScreen.Recording.2024-03-23.at.11.12.51.PM.mp4iOS: mWeb SafariScreen.Recording.2024-03-23.at.11.17.41.PM.mp4MacOS: Chrome / Safari1.1.mp42.1.mp4MacOS: DesktopScreen.Recording.2024-03-23.at.10.19.14.PM.mp4 |
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.
Changes looks good and works well. Reviewers checklist is also complete.
All yours. @mountiny
🎀 👀 🎀
C+ Reviewed
@mountiny Please review the PR when you have a chance, thanks. |
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.
@abdulrahuman5196 @dukenv0307 in the videos here
shouldnt there be a skeleton? It is on web/desktop
Co-authored-by: Vit Horacek <36083550+mountiny@users.noreply.github.com>
Co-authored-by: Vit Horacek <36083550+mountiny@users.noreply.github.com>
@mountiny Maybe @abdulrahuman5196 uploaded the old video by mistake when I hadn't added the case optimistic transacion yet. I tested again and it works well. |
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.
Alright, thanks for the update, lets get this merged now
✋ 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: 1.4.58-0 🚀
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.4.58-8 🚀
|
Details
Display total and money request in offline
Fixed Issues
$ #26424
PROPOSAL: #26424 (comment)
Tests
Offline tests
Precondition: Steps 1-3 in online
Steps 4-6
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Screen.Recording.2024-02-21.at.17.50.44.mov
Android: mWeb Chrome
Screen.Recording.2024-02-16.at.11.38.45.mov
iOS: Native
Screen.Recording.2024-02-21.at.17.23.47.mp4
iOS: mWeb Safari
Screen.Recording.2024-02-16.at.11.33.02.mov
MacOS: Chrome / Safari
Screen.Recording.2024-02-16.at.11.31.33.mov
MacOS: Desktop
Screen.Recording.2024-02-16.at.11.47.30.mov