-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Improve goBack function #26498
Improve goBack function #26498
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 |
3efefd9
to
0644669
Compare
@mountiny done! Thanks for the bump 😄 I completely forgot |
6926e71
to
881dc84
Compare
@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. |
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 🚀 |
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, I am approving but i would love to see @roryabraham opinion on this before merging
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.
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) |
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 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 🚀
|
@@ -4,7 +4,8 @@ import {FlatList as NativeFlatlist, View} from 'react-native'; | |||
import _ from 'underscore'; | |||
import FlatList from '@components/FlatList'; | |||
import * as CollectionUtils from '@libs/CollectionUtils'; | |||
import variables from '@styles/variables'; | |||
|
|||
const AUTOSCROLL_TO_TOP_THRESHOLD = 128; |
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 PR forgot to cover an extra case. More details here #30726
Details
This PR improves
goBack
function so the fallback could be used for reports screens. Additionally, it allows togoBack
with more than one route for report screens when using a fallback routeFixed Issues
$ #26569
PROPOSAL:
Tests
Offline tests
QA Steps
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.mov
Mobile Web - Chrome
androidWeb.mov
Mobile Web - Safari
iosWeb.mov
Desktop
desktop.mov
iOS
ios.mov
Android
android.mov