-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Followup/23961 edit request headers #25399
Followup/23961 edit request headers #25399
Conversation
Still not solved: after updating values when offline the headers (amount, description, date) don't change immediately - they change after changing other values or refocusing the screen. Could it be possibly because we're updating only the transaction object and the transaction data is not taken directly from Onyx? The keys we're subscribing to are not changing. |
@allroundexperts 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] |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-08-21.at.2.31.49.PM.movMobile Web - ChromeScreen.Recording.2023-08-21.at.2.35.54.PM.movMobile Web - SafariScreen.Recording.2023-08-21.at.2.38.31.PM.movDesktopScreen.Recording.2023-08-21.at.2.33.37.PM.moviOSScreen.Recording.2023-08-21.at.2.40.01.PM.movAndroidScreen.Recording.2023-08-21.at.2.37.34.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.
Code is looking fine to me. Testing now!
@allroundexperts I think it can be fixed in another follow-up. |
Sounds good. Continuing my testing then! |
I think we could pull the transaction directly from onyx on the component to ensure it rerenders whenever it changes |
Looking good. At this point, only waiting for the android build to complete so I can add its screenshots (its painfully slow lately). |
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.
Finally android build is complete and so is the checklist.
One final comment. On tasks, we are greying out title / description / assignee only when you're offline and someone changes it. On the contrary, here, we are greying it out regardless if someone has edited it out or not. I'm not sure which behaviour is the correct one but we should be consistent between screens.
Noting that Carlos is adding the transaction subscriber to the money request view here https://github.com/Expensify/App/pull/25435/files @allroundexperts @koko57 Thanks for highlighting this, we might not have ben clear, when offline the header should be grey only when you edit it as that symbols the change is optimistic, ie only at your client locally. It should not be grey just because you are offline. |
Right. @koko57 You might want to update the PR to handle this then. Also, please update your test steps and I'll review it again! |
@allroundexperts @mountiny thanks for the review! I'm OOO from today, someone from my team will take it over. Seems that Carlos PR will solve the updating the headers issue here, so the only thing to do is to apply greying out only to edited headers 🙂 I guess that the changes that Carlos made will also be necessary to do that, so we'll probably need to wait for this PR to be merged |
Hey, I'll be picking this up while Agata is OOO. I'll get up to speed on this and work on applying the greying out on the edited headers. |
@allroundexperts @mountiny I've updated the greying out logic, let me know if there's any error or misunderstanding on my part. It should now be working similar to the Task view. This is still dependent on Carlos PR for the re-render of the component when the transaction changes. |
@allroundexperts also shoul be ready once you get time thanks |
@mountiny Blocked on it because of https://expensify.slack.com/archives/C049HHMV9SM/p1692362128396259 |
@BeeMargarida Also, when I edit a request, it becomes greyed out only AFTER I re-focus the tab. Is that expected? |
I think that's related to the fact that this is dependent on Carlos PR, which re-renders the component when the transaction changes. Currently this is not happening. |
Makes sense. Please let me know once this is fixed and I'll re-review. |
@allroundexperts Should be fixed now 👍 |
@BeeMargarida Conflicts 🤯 🤯 |
@allroundexperts Fixed 👍 |
Tests well. Updated the screen recordings. |
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.
Looks good!
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 everyone, really helpful!
✋ 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.3.56-0 🚀
|
@mvtglobally Applause reported this as a QA fail. Not a deploy blocker, but can you provide some more details please? |
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.56-24 🚀
|
shouldShowRightIcon={canEdit} | ||
onPress={() => Navigation.navigate(ROUTES.getEditRequestRoute(report.reportID, CONST.EDIT_REQUEST_FIELD.DATE))} | ||
/> | ||
<OfflineWithFeedback pendingAction={lodashGet(transaction, 'pendingFields.amount') || lodashGet(transaction, 'pendingAction')}> |
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.
Coming from #26235
When adding this, we didn't take into consideration that MoneyRequestView
itself is wrapped in <OfflineWithFeedback>
, which can lead to a cumulated grey-out effect.
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.
Yeah, but in the same commit wrapping the whole component was removed. So it looks like it was restored later and caused the issue
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 missed that! Thank you, I'll update my checklist.
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.
Details
Fixed Issues
$ #23961
PROPOSAL: $ #23961
Tests
Offline styles:
Modified expense message
no old value:
set the [valueName] to [newValue]
no new value:
removed the [valueName] (previously [oldValue])
old and new value
changed the [valueName] to [newValue] (previously [oldValue])
Verify that no errors appear in the JS console
Offline tests
Offline styles:
Modified expense message
set the [valueName] to [newValue]
removed the [valueName] (previously [oldValue])
changed the [valueName] to [newValue] (previously [oldValue])
QA Steps
Offline styles:
Modified expense message
no old value:
set the [valueName] to [newValue]
no new value:
removed the [valueName] (previously [oldValue])
old and new value
changed the [valueName] to [newValue] (previously [oldValue])
Verify that no errors appear in the JS console
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)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android