-
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
Fix for Update Global Offline Indicator #10140
Conversation
…ew behavior to fix issues on android
Code seems good, but I'm having trouble following all of the issues that came up with our first go at this. Can you summarize those issues and how to test them so we can make sure we've got it right this go around? |
@arosiclair got it! Will update the OP |
@arosiclair There seems to be a bug on Android that I found on https://expensify.slack.com/archives/C03TQ48KC/p1659115536665949 |
This is a big PR and it's blocking a lot so I thought I would jump in and help review. Please fix those merge conflicts first. |
@neil-marcellini merge conflicts resolved! |
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 reviewed all the files and left 2 comments. Now I'm going to test all the pages that were changed, on all platforms. I'll also test out the offline indicator. Please add test and QA steps to the issue.
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.
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's what I get when offline on iOS, the spacing isn't fixed. It looks like the min height is getting set correctly, so something else must be causing it.
Aha, so if we show the recipient local time then we also apply this style that has minHeight: 90
. That condition is probably why you didn't see the problem.
<View style={[shouldShowReportRecipientLocalTime && styles.chatItemComposeWithFirstRow, this.props.isComposerFullSize && styles.chatItemFullComposeRow]}> |
Lines 1341 to 1343 in 2518e21
chatItemComposeWithFirstRow: { | |
minHeight: 90, | |
}, |
Sorry to bring up another headache, but the full screen composer no longer works properly on iOS after these changes. On your branch: jaspers.mp4On main: main.mp4 |
Also just wanted to confirm that we don't get any screen bouncing when the offline indicator shows up and disappears? Ideally this takes up the exact same space/spot as the "User is typing" indicator. |
Ah there is a very slight amount of jumping, I'll make sure to get rid of it. |
@neil-marcellini fixed the issues you mentioned! thanks for being so thorough with this review I really appreciate it also @shawnborton made sure that there isn't any jumping happening: Untitled.mp4 |
Awesome, thank you! |
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.
Tested this nad looks good to me, the only problem I had was testing on iOS where it took a long while before the offline indicator showed up and then it kinda randomly dissappeared twice, probably not sure if the device is offline or not.
Not sure what is the best way to set the ios simulator offline. Styling wise it looks good to me!
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 for the changes, it's working really well now! I think it's good to go.
NAB:
It would be nice to move the mobile ReportTypingIndicator
to the right side so that it doesn't stack on top of the offline indicator. It would also match the web / desktop behavior. Doing that might be kind of tricky, and I doubt many people hit the max comment length, so I think we can do it later.
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
We can always make an issue for later? @neil-marcellini It's definitely going to be kinda tricky because the OfflineIndicator for mobile is going to be in the ScreenWrapper which is higher up in the component hierarchy than the ReportTypingIndicator so we'd have to figure out some way to apply flex styling to them both. |
🚀 Deployed to staging by @neil-marcellini in version: 1.1.88-0 🚀
|
paddingStyle, | ||
]} | ||
> | ||
<KeyboardAvoidingView style={[styles.w100, styles.h100]} behavior={this.props.keyboardAvoidingViewBehavior}> |
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.
FYI, this caused the regression in #10905 because the FAB (floating action button) also has a keyboardAvoidingView in it, so this caused the code to have nested keyboardAvoidingViews.
I am tagging this PR to highlight an issue fixed here. All conditions in ternary expressions or left-hand operands on conditional renders, should be boolean. This PR is one of the PRs that uses conditional render with string operands, hence I am tagging it here for the contributors to check. We've also updated the item in the checklist with this PR to avoid this issue in the future. |
NOTE TO REVIEWER: Recommend viewing diff without whitespace changes for more succinct review
We previously had this PR which was merged, but was later reverted due to a number of layout issues associated with the new KeyboardAvoidingView usage in the ScreenWrapper. This PR adds back everything that was reverted, and fixes the behavior of the ScreenWrapper in a number of places on Android. See linked issues in the old PR and the issue below for more context.
There were two main issues that we were running into that were causing bizarre gaps to form between the keyboard and the actual content. At times these gaps would push up the content so high that it would get cut off:
'padding'
passed into thebehavior
prop instead of'height'
. It's known that KeyboardAvoidingViews can have unexpected behavior if you don't use'height'
.https://user-images.githubusercontent.com/93399543/180846058-039d8bd0-d5e5-4d94-8ae1-9cb8e6c818bd.mp4
I've addressed both of these issues in this PR, primarily by refactoring the ScreenWrapper component (which houses the KeyboardAvoidingView).
Details
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/218715
Tests
See QA steps
PR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
displayName
propertythis
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)PR Reviewer Checklist
The Contributor+ will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
have been tested & I retested again)/** comment above it */
displayName
propertythis
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)QA Steps
Screenshots
Web
Mobile Web
Desktop
iOS
Android