-
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
Fix: Background report changes to Tags page after clicking Custom tag name in RHP #50416
Conversation
Signed-off-by: GitHub <noreply@github.com>
Signed-off-by: GitHub <noreply@github.com>
Signed-off-by: GitHub <noreply@github.com>
@paultsimura 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] |
@paultsimura there is an additional bug in this flow that when we refresh the page and then press back button the RHP will get dismissed, this is reproducible on production as well. I think we can fix it too in this PR, should we ask for a bounty increase for this issue ? |
Please add a recording – I cannot reproduce from this description. |
@koko57 sorry for bothering you here – I just know you are well familiar with routing in the App. Could you please briefly look across this PR and see if it makes sense to you, or we could simplify it by somehow only changing a part of the Screens config 🙏 It honestly looks a bit bulky for me to duplicate every existing tag-related route just because we want to show it in RHP in one flow, and the main window in another flow. |
Screen.Recording.2024-10-08.at.11.45.43.PM.movShould be reproducible on staging (not in this PR as i already included the fix for that (not part of our PR though, just for demonstration) |
@paultsimura yeah, I agree it's a bit bulky. But if it's already implemented this way for categories, I cannot argue with this approach. Same for Expensify Card - I wonder if we should also implement it this way. |
Thanks @koko57, maybe we'll come to some grand routing refactoring at some point that will allow supporting both full-page and RHP pages seamlessly. |
@stitesExpensify we have noticed a couple of semi-related bugs here: Bug 1:
Expected: the user is navigated back to the previous page in the RHP with the possibility to continue the money request submission Bug 2:
Expected: the changes are persisted and the user is navigated back to the previous page in the RHP with the possibility to continue the money request submission Also, most scenarios we've fixed in this PR for Tags are still happening for Categories. Like refreshing the page on some steps, or clicking "Import spreadsheet" etc. Would you be up to bumping the bounty to $500 here and let us take care of these flows more holistically? |
Yep @paultsimura let's double it to $500 and get those fixed! CC @Christinadobrzyn |
@twilight294 all yours again! |
Signed-off-by: GitHub <noreply@github.com>
@paultsimura can you review the updated code once? I will update the recordings after you have reviewed the code once |
@twilight294 please test the Categories flow as well and fix where needed - it also misses some screens and I promised we'll fix them for the increased bounty. |
It's a little late here, I will add categories tomorrow, can you review for tags in the meantime ? thanks 😄 |
It's midnight for me as well, will review tomorrow 👍 |
Signed-off-by: GitHub <noreply@github.com>
Signed-off-by: GitHub <noreply@github.com>
Fixed @paultsimura |
@paultsimura missed to remove that extra param, thanks, I have updated the code, let me know if you have any more concerns |
Actually @twilight294 this is gonna sound like a little more work, but it would be much better for the code clarity – it's quite confusing when we use the ternary operator like this: Navigation.navigate(backTo ? route_1 : route_2) Let's introduce a new variable on all these pages (isEmpty from 'lodash/isEmpty'): const isQuickSettingsFlow = !isEmpty(backTo); And use it instead of Navigation.goBack(isQuickSettingsFlow ? ROUTES.SETTINGS_TAGS_SETTINGS.getRoute(route?.params?.policyID, backTo) : ROUTES.WORKSPACE_TAGS_SETTINGS.getRoute(route?.params?.policyID)); |
Signed-off-by: GitHub <noreply@github.com>
thanks for the suggestions @paultsimura , implemented the changes |
Signed-off-by: GitHub <noreply@github.com>
Signed-off-by: GitHub <noreply@github.com>
I'm sorry @twilight294 – I've double checked and it would be sufficient to use this instead of lodash: const isQuickSettingsFlow = !!backTo; This is the last change request, hopefully 🙏 |
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.
+1 missed change.
@@ -126,7 +129,7 @@ function ImportedTagsPage({route}: ImportedTagsPageProps) { | |||
> | |||
<HeaderWithBackButton | |||
title={translate('workspace.tags.importTags')} | |||
onBackButtonPress={() => Navigation.goBack(ROUTES.WORKSPACE_TAGS_IMPORT.getRoute(policyID))} | |||
onBackButtonPress={() => Navigation.goBack(backTo ? ROUTES.SETTINGS_TAGS_IMPORT.getRoute(policyID, backTo) : ROUTES.WORKSPACE_TAGS_IMPORT.getRoute(policyID))} |
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.
Here as well, i guess:
onBackButtonPress={() => Navigation.goBack(backTo ? ROUTES.SETTINGS_TAGS_IMPORT.getRoute(policyID, backTo) : ROUTES.WORKSPACE_TAGS_IMPORT.getRoute(policyID))} | |
onBackButtonPress={() => Navigation.goBack(isQuickSettingsFlow ? ROUTES.SETTINGS_TAGS_IMPORT.getRoute(policyID, backTo) : ROUTES.WORKSPACE_TAGS_IMPORT.getRoute(policyID))} |
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.
missed it sorry
Signed-off-by: GitHub <noreply@github.com>
I updated the code @paultsimura , got rid of the lodash |
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.
This is quite a big PR, I hope we didn't miss any test cases 🤞
LGTM ✔️
bump for review @stitesExpensify |
I have been OOO but am working my way through this. Lots of changes! |
@stitesExpensify any progress with this one? It's likely to accumulate conflicts over time because there are a lot of changes. |
✋ 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/stitesExpensify in version: 9.0.53-0 🚀
|
🚀 Deployed to staging by https://github.com/stitesExpensify in version: 9.0.53-0 🚀
|
Hey all, it seems like this PR might have introduced a small issue with Tag pages navigation |
Looking..... |
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.0.53-1 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.0.53-1 🚀
|
@twilight2294 what are your findings on this? |
Sorry, it's weekend so didn't reply early, found a fix, i will raise PR tomorrow |
Details
Fixed Issues
$ #49883
PROPOSAL: #49883 (comment)
Tests
Verify that
The report in the background will remain after clicking Custom tag name
Verify that in general the whole flow tests well and we are navigated to the correct pages.
Verify that following the same steps above for categories, we are navigated correctly on category pages
Offline tests
N/A can't test offline
QA Steps
Verify that
The report in the background will remain after clicking Custom tag name
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.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 and/or tagged@Expensify/design
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-10-07.at.8.45.54.PM.mov
Android: mWeb Chrome
Screen.Recording.2024-10-07.at.8.48.45.PM.mov
iOS: Native
Screen.Recording.2024-10-07.at.8.44.21.PM.mov
iOS: mWeb Safari
Screen.Recording.2024-10-07.at.8.43.29.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2024-10-07.at.7.58.45.PM.mov
MacOS: Desktop
Screen.Recording.2024-10-07.at.8.03.38.PM.mov