Improve goBack function#26498
Improve goBack function#26498mountiny merged 16 commits intoExpensify:mainfrom adamgrzybowski:@swm/improve-goBack-with-fallback-route
Conversation
|
@sobitneupane 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] |
|
@sobitneupane putting it on hold but please continue with a review and testing please thanks! |
|
🧪🧪 Use the links below to test this build in android and iOS. Happy testing! 🧪🧪
|
|
Hello, are you close to merging this ? |
|
@adamgrzybowski can you please resolve conflicts on this one? |
|
@adamgrzybowski bump on the conflicts |
|
@mountiny done! Thanks for the bump 😄 I completely forgot |
|
@adamgrzybowski jest units failing now, maybe we need to merge main again 🤔 |
|
@mountiny merging main and small adjustments in tests helped. Thanks for noticing the problem! 🙇 |
|
@sobitneupane can you please do the checklist today? |
|
Yes @mountiny. I will review the PR today. |
There was a problem hiding this comment.
Screenshots/Videos
Web
Screen.Recording.2023-09-26.at.14.15.00.mov
Mobile Web - Chrome
Screen.Recording.2023-09-26.at.14.19.20.mov
Mobile Web - Safari
Screen.Recording.2023-09-26.at.14.18.39.mov
Desktop
Screen.Recording.2023-09-26.at.14.28.20.mov
iOS
Screen.Recording.2023-09-26.at.15.05.05.mov
Android
Screen.Recording.2023-09-26.at.15.45.18.mov
sobitneupane
left a comment
There was a problem hiding this comment.
@adamgrzybowski Is it expected that we can navigate to the deleted report by clicking 'go forward' in the browser?
If the transaction report is accessed directly through a deep link, the issue can still be reproduced.
|
Could you please merge main into the branch to hoopefully resolve the reassure tests |
|
@s77rt What is the latest on the bug, what was the resolution on the Pr you ave linked? @WojtekBoman lets merge main again since the reassure tests has been fixed there |
|
The bug is due to the use of |
|
I removed this hook from |
|
@s77rt could you please retest |
|
@mountiny Just did. Still working as expected but the bug on iOS is still present. Should we create a new issue for that bug? |
|
I am partial on this one, the bug seems to be new, it does not happen in such manner in main, right? |
|
After checking further more I think we can adjust the value in this PR and fix the bug.
I don't know how we ended up choosing 64px (cc @roryabraham) but it seems too low. Let's create a new variable and set it to 128px. That should do it. |
|
@WojtekBoman Thanks! This is looking good for me |
|
@mountiny Let's merge this 🚀 |
mountiny
left a comment
There was a problem hiding this comment.
Thanks, I am approving but i would love to see @roryabraham opinion on this before merging
roryabraham
left a comment
There was a problem hiding this comment.
Currently [maintainVisibleContentPosition.autoScrollToTopThreshold is] 64px ...
This was chosen as it's the normal height of a ReportActionItemSingle. When it was added there was a bug when Uploading attachment... was replaced by the image thumbnail. 64px was just enough to fix that bug, and there wasn't any bug with sending IOU requests as far as I remember.
Increasing the autoScrollToTopThreshold to a higher value seems fine to me. But it's not really a perfect solution. ReportActionItem components have non-deterministic height, so if you choose any value, I can write you a message that's taller and if you delete it the same bug will be reproducible. So maybe we could look for a better solution. You don't want to autoScrollToTop if the reportAction in question (at the bottom) is not even visible on the screen. So maybe a reasonable value for autoScrollToTopThreshold is the height of the screen?
|
Thank you!
Given the explanation I think this makes sense, this would have to be dynamic then. @s77rt @WojtekBoman Lets try this out and test if there are any regressions from it. I hink that can be handled in a separate PR though, do you guys agree? |
|
Handling this in a separate PR sounds good |
|
@s77rt ddi you retest after the latest change? |
|
@mountiny Yes (the 128px change - not the height-screen change) |
mountiny
left a comment
There was a problem hiding this comment.
Thanks guys! Lets be on a look out for any regressions in the go back logic
|
✋ 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.99-0 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.99-0 🚀
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.4.0-0 🚀
|
| import * as CollectionUtils from '@libs/CollectionUtils'; | ||
| import variables from '@styles/variables'; | ||
|
|
||
| const AUTOSCROLL_TO_TOP_THRESHOLD = 128; |
There was a problem hiding this comment.
This PR forgot to cover an extra case. More details here #30726
Details
This PR improves
goBackfunction so the fallback could be used for reports screens. Additionally, it allows togoBackwith more than one route for report screens when using a fallback routeFixed Issues
$ #26569
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
web.mov
Mobile Web - Chrome
androidWeb.mov
Mobile Web - Safari
iosWeb.mov
Desktop
desktop.mov
iOS
ios.mov
Android
android.mov