feat: Add logic for better bottom SafeArea handling + Enable translucent Android NavBar#57128
Conversation
|
Unverified commits |
weird thanks, i'll check that |
…apply to more components
76ac324 to
fbb4e37
Compare
|
|
lakchote
left a comment
There was a problem hiding this comment.
LGTM! Thanks @chrispader for your work on this one
mountiny
left a comment
There was a problem hiding this comment.
Thanks for all the changes
|
@chrispader Ping us in slack when this is ready @hungvu193 could you please do some more testing on this one tomorrow just in case |
|
|
1 similar comment
|
|
|
Fortune favours the brave |
|
@mountiny looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
Not emergency, the eslint failures are from optional changes and this was very large PR already |
…tom-safe-area-padding-base-pr fix: lint pipeline failing after #57128
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.1.13-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.1.13-5 🚀
|
| </View> | ||
| </FocusTrapForModal> | ||
| </ModalContent> | ||
| <NavigationBar /> |
There was a problem hiding this comment.
Came from this issue
We had an issue when grey navigation bar covers content when keyboard opens in modal window
Fix here
@mountiny @lakchote
Explanation of Change
MOBILE-EXPENSIFY: https://github.com/Expensify/Mobile-Expensify/pull/13455
Based on the plan laid out in #53186 (comment).
New props
This PR introduces a
enableEdgeToEdgeBottomSafeAreaPaddingprop to multiple components, that should be removed after all screens have been fully migrated to edge-to-edge bottom safe area handling. There are also some other additional props, that will be kept, since they can be used to enable logic for bottom safe area handling in generic components on per screen/component individually.This PR introduces the following flags/props to these components:
ScreenWrapperenableEdgeToEdgeBottomSafeAreaPadding: Temporary; Used to disableincludeSafeAreaPaddingBottomlogic, renderbottomContentonly when it's set and apply the bottom padding styles correctly.shouldKeyboardOffsetBottomSafeAreaPadding: Explained below. Passed forward toKeyboardAvoidingView.KeyboardAvoidingViewshouldOffsetBottomSafeAreaPadding: Can be used to let theKeyboardAvoidingViewoffset the bottom safe area padding. TheKeyboardAvoidingViewwill basically setkeyboardVerticalOffset={-paddingBottom}, to compensate for the bottom safe area, when the keyboard is open.ModalenableEdgeToEdgeBottomSafeAreaPadding: This disables (extra) bottom safe area in theModal. Once all modals have migrated to handling bottom safe area padding locally, we can remove this prop.ScrollViewaddBottomSafeAreaPadding: Used to trigger theuseContentContainerStyleWithBottomSafeAreaPaddinglogic and applycontentContainerStylewith bottom padding on theSectionListcontentContainerStyle:contentContainerStyleprop can still be used; ifpaddingBottomis set, the padding will be added to the one fromaddBottomSafeAreaPadding.SelectionListaddBottomSafeAreaPadding: This flag will apply the padding incontentContainerStyleof the nestedSectionList, as well as on theFixedFootercomponent, rather than on the container view.shouldFooterContentStickToBottom: Explained below. Passed forward toFixedFooterSectionListaddBottomSafeAreaPadding* Same as inScrollView. TriggersuseContentContainerStyleWithBottomSafeAreaPaddingcontentContainerStyle: Same as inScrollVIew.contentContainerStyleprop can still be usedFormProvider(andFormWrapper)addBottomSafeAreaPadding: This flag gets passed forward toScrollViewand enables padding handling there.shouldSubmitButtonStickToBottom: This flag enables logic which moves theSubmitButtoncomponent out of the scrollable content and places it sticking at the bottom. This is especially useful on screens that have scrollable content, a submit button at the bottom and an input that triggers the keyboard. When the keyboard opens, we still want to see the submit button, e.g. on theWorkspaceInvitePage.FixedFooteraddBottomSafeAreaPadding: If set, the fixed footer will add bottom padding for the safe area inset.shouldStickToBottom: Passed down fromSelectionList. If set, a the footer will stick to the bottom with padding applied bybottom: paddingBottom + styles.pb5.paddingBottom. This works hand in hand with theaddBottomSafeAreaPaddingflag.enableEdgeToEdgeBottomSafeAreaPaddingprop:InteractiveStepWrapperConnectionLayoutProps marked bold props will get removed after the migration, as they are just temporary.
useContentContainerStyleWithBottomSafeAreaPadding: This hooks contains logic around mergingcontentContainerStyleprop (e.g. onScrollViewandSectionList) with additional bottom safe area padding. The style sheet will get flattened and ifpaddingBottomis already set, it will be added to the bottom safe area padding.Follow-up PRs
These are the follow-up PRs that use the flags introduced here:
Fixed Issues
$ #53186
PROPOSAL: #53186 (comment)
Tests
This PR introduces new logic that is not enabled by default. Therefore, there should be no changes in app behaviour.
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
No QA needed.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.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
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop