-
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
Update Global Offline Indicator #9895
Conversation
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 great, but seems on mobile the indicator has too much space on top of it, is there something we can do to reduce that?
@iwiznia @arosiclair Ah, it's because of this view at the bottom of If we want to display the OfflineIndicator in the The space does look kinda weird, but the offline indicator isn't actually cut-off on mobile (it just looked that way because of my bad screenshot skillz). That red space underneath the text input is the aforementioned view. You can see that on bigger screens we render the One solution I'm thinking of is to just not render that view in Any other ideas? |
The
hmmm like where?
I don't know, it does not look great... can we see how it looks in other pages? Like the LHN or settings page? |
@iwiznia @arosiclair I honestly think that extra vertical padding makes sense, because it leaves us space to show the |
Maybe...
|
I would try adding some padding around the indicator in the ScreenWrapper so it doesn't look so squished at the bottom. Aside from that, I do think there is an issue with the safe area since the indicator appears below the iOS home bar and the safe area should account for that. Or did you already fix that? |
Ah I see what you mean! I do think this should be fixed, let me take a look. |
Yup, the safe area insets are definitely messed up.. the offline indicator looks different on almost every page. I figured it would have been handled by this, but it appears that that doesn't actually work: Changing this View to a SafeAreaView fixes all the problems, which is making me wonder why we're even setting the SafeAreaInsets manually via a the SafeAreaInsetConsumer. Asked about it in #expensify-open-source here. |
It appears the safe area insets don't get applied whenever we have a With the I figured out that you can actually avoid this if you reverse the nesting of the ScreenWrapper and KeyboardAvoidingView. The only thing is, there are already sooo many components (20+) that already have the KeyboardAvoidingView nested inside of the ScreenWrapper. If we want the offline indicator to appear correctly on these pages, we'll need to reverse the nesting for all of them. |
@iwiznia Something else just came to my attention, we actually have another component called the FormAlertWrapper that also handles showing an offline indicator. That means on pages like the Payments Page which include both a ScreenWrapper and FormAlertWrapper, 2 offline indicators appear: If we're globalizing the offline indicator to the screen wrapper, we should get rid of the offline indicator in the FormAlertWrapper, right? |
Yes, either I missed that usage or it was added after I looked. As for the other issue, seems like you got the solution figured out, 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.
We need some spacing around the offline indicator. It looks good in the report action compose section, but the global indicator elsewhere doesn't have any spacing and looks squished. See the below screenshots
We should match the spacing on the ReportActionCompose indicator for consistency and to give it some breathing room that'll make it easier to read.
@arosiclair I've added the same amount of padding that's being used on the ReportActionCompose component to the OfflineIndicator in the ScreenWrapper: |
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 and tests well. Thanks for the changes!
@arosiclair looks like this was merged without passing tests. Please add a note explaining why this was done and remove the |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Tests passed I dunno what the deal is with this Emergency label behavior |
🚀 Deployed to staging by @arosiclair in version: 1.1.86-0 🚀
|
🚀 Deployed to production by @yuwenmemon in version: 1.1.86-5 🚀
|
See issue for more context.
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/218715
Tests
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