-
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: add proper fallback route for private notes pages #28273
fix: add proper fallback route for private notes pages #28273
Conversation
@NikkiWines 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] |
Will post the video in morning. |
Reviewer Checklist
Screenshots/VideosWeb28273-web.mp4Mobile Web - Chrome28273-mobile-chrome.mp4Mobile Web - Safari28273-mobile-safari.mp4Desktop28273-desktop.mp4iOS28273-mobile-ios.mp4Android28273-mobile-android.mp4 |
@ntdiary Please have it checked thoroughly I am facing some internet issues here. |
Hi, @BhuvaneshPatil, please update the test steps, complete QA steps and upload Android video. : ) |
@ntdiary Updated. I have also updated the QA steps let me know if they are 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.
LGTM. : )
@@ -66,6 +66,7 @@ function PrivateNotesViewPage({route, personalDetailsList, session, report}) { | |||
> | |||
<HeaderWithBackButton | |||
title={translate('privateNotes.title')} | |||
onBackButtonPress={() => Navigation.goBack(ROUTES.PRIVATE_NOTES_LIST.getRoute(report.reportID))} |
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 tricky because we will conditionally show the list page. I was working on this here #28105 but couldn't prioritize it.
In case a user has a single note that they can access we will take them right away to the view page. So you can't always be sure that view page would go back to list page.
Navigaton flow:
Single note: Private notes button
-> view page -> edit page
Multiple notes: Private notes button
-> list page -> view page -> edit page
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.
Navigating them back gets even trickier because you need to know which page they came from(it could be the profile page or the report details page). That's why I sort of just relied on the goBack
default behaviour to sort that out from the navigation stack.
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.
Oh, great catch! So I think it's okay to revert this change. Just like there are also multiple flows for going back from the notes list page to the report detail page.
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.
Right, so we shall only change the PrivateNotesEditPage
as we are sure that user would have came from PrivateNotesViewPage
, right?
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.
No no, have a look at the navigation flow I have mentioned here #28273 (comment)
Navigaton flow:
Single note: Private notes button -> view page -> edit page
Multiple notes: Private notes button -> list page -> view page -> edit page
So it is between the private notes button and the view page.
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 think you misunderstood me here #28273 (comment)
Aaah, yes sorry, I went with negation. Since you are fixing the navigation behaviour here I would say we also want to fix for the View page, can you look into it to see if we have a way?
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 am also sort of confused, why we don't retain the navigation stack when user refreshes the page. Does that happen with all the pages?
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.
Yes, I have seen same behaviour for workspace pages that we have added fallback route.
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.
@techievivek Can you tell me scenarios where I can see multiple private notes. Because currently I can only see one in workspace as 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.
@techievivek I would like to use logic that you have used https://github.com/Expensify/App/pull/28105/files#diff-65c096044d5f69b35bcdec14c99c4fda4580759df9b1a7c36650d58eea276f1dR3569 here.
To check number of reports and based on that navigate. Let me know if this sounds right to you
@ntdiary
|
Nice, this logic itself should be feasible. @techievivek, please feel free to let us know if you have different thoughts. : )
Additionally, regarding the navigation stack, if we directly access the view page via deep link (rather than going through a series of operations to access then refreshing), I believe there would not be a navigation stack. So the navigation stack may also be of no help to this issue. |
@techievivek Please have a look at comments and let us know what you think. |
…d-proper-go-back
IIRC, we do build up the navigation stack for deep-links but I like the above approach that @BhuvaneshPatil has shared. So this is good for now IMO. |
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, thanks for the changes.
if (_.keys(privateNotes).length === 1) { | ||
return ROUTES.HOME; | ||
} | ||
|
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.
NAB: It would have been nice to include some comments for this method.
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
@techievivek Will this be considered eligible for Urgency Bonus? because changes were made before the deadline. It got delayed while merging. |
🚀 Deployed to staging by https://github.com/techievivek in version: 1.3.76-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.76-6 🚀
|
🚀 Deployed to staging by https://github.com/techievivek in version: 1.3.77-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.77-7 🚀
|
@@ -114,6 +114,7 @@ function PrivateNotesEditPage({route, personalDetailsList, session, report}) { | |||
<HeaderWithBackButton | |||
title={translate('privateNotes.title')} | |||
subtitle={translate('privateNotes.myNote')} | |||
onBackButtonPress={() => Navigation.goBack(ROUTES.PRIVATE_NOTES_VIEW.getRoute(report.repotID, route.params.accountID))} |
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.
repotID
lol 😅
we're fixing it here
Details
When we refresh while on Private Notes Edit page, and try to save the note we are redirected to home page instead of Private Notes View
Fixed Issues
$ #28011
PROPOSAL: #28011 (comment)
Tests
Go to private notes edit page
Refresh the page
Add some notes and click on save button
Verify it takes to Private Notes View Page
GO to Private Notes view page
refresh the page
Click on back button in header
Verify user goes to private notes list page
Offline tests
QA Steps
Open notes edit page for an account
Copy the link to that page
paste the link in separate tab and try to edit the notes
when clicked on save user should be taken to notes view page
paste the link again and open the edit page
when clicked on back button user should be taken to notes view page
Copy the notes view page link page, it looks something like -
localhost:8082/r/<reportID>/notes/<accountID>
Paste the link in browser and open
Click on back button in header
User should be take to notes list page
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
Web.MacOS.mov
Mobile Web - Chrome
mobile-chrome.mov
Mobile Web - Safari
Mobile.-.Safari.mov
Desktop
Screen.Recording.2023-09-27.at.10.03.15.AM.mov
iOS
IOS.mov
Android
Android.App.mov