Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Changes from 3 commits
501e003
ba36c13
78a6926
b5a7437
0a36072
7077466
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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
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 pageMultiple notes:
Private notes button
-> list page -> view page -> edit pageThere 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 fromPrivateNotesViewPage
, 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.
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