-
Notifications
You must be signed in to change notification settings - Fork 3.5k
fix: apply safe area padding for workspace screens #54285
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: apply safe area padding for workspace screens #54285
Conversation
|
@paultsimura 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] |
|
Thanks @kirillzyusko, I will review it soon. Could you please fix the lint issues in the meantime? |
|
@paultsimura they are coming not because of my changes (I think recently new eslint rule was introduced and it hasn't been fixed yet). Not sure if I should fix it in this PR (or should I fix it at all?..) |
This is the same as it was with the |
Ah, okay, cool, thanks for clarifications - will do that soon! |
|
@paultsimura I believe PR is ready for review. One remaining failure will be added to exception list in #54288 (comment) |
src/libs/PolicyUtils.ts
Outdated
| function getWorkspaceAccountID(policyID: string) { | ||
| function getWorkspaceAccountID(policyID?: string) { | ||
| if (!policyID) { | ||
| return 0; |
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.
Please use CONST.DEFAULT_NUMBER_ID here and in 2 other places in this function instead of 0.
src/libs/PolicyUtils.ts
Outdated
| } | ||
|
|
||
| function getWorkspaceAccountID(policyID: string) { | ||
| function getWorkspaceAccountID(policyID?: string) { |
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.
Please use string | undefined to always enforce passing the policyID but allow undefined.
A rule of thumb should be: if a function is useful without a param, make it optional using param?. If not – make it required with a possible undefined value: param: T | undefined.
@VickyStash please correct me if I'm wrong on this approach.
| function getWorkspaceAccountID(policyID?: string) { | |
| function getWorkspaceAccountID(policyID: string | undefined) { |
src/libs/ReportUtils.ts
Outdated
| * Attempts to find a policy expense report in onyx that is owned by ownerAccountID in a given policy | ||
| */ | ||
| function getPolicyExpenseChat(ownerAccountID: number, policyID: string): OnyxEntry<Report> { | ||
| function getPolicyExpenseChat(ownerAccountID: number, policyID?: string): OnyxEntry<Report> { |
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.
Same here:
| function getPolicyExpenseChat(ownerAccountID: number, policyID?: string): OnyxEntry<Report> { | |
| function getPolicyExpenseChat(ownerAccountID: number, policyID: string | undefined): OnyxEntry<Report> { |
src/libs/actions/Policy/Policy.ts
Outdated
| } | ||
|
|
||
| function clearPolicyErrorField(policyID: string, fieldName: string) { | ||
| function clearPolicyErrorField(policyID?: string, fieldName?: string) { |
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.
And here.
|
@kirillzyusko could you please share what emulator device did you use, and how I cane add one? All I tried had no buttons on the screen |
I tested on a real phone and enabled 3 button navigation. You just need to go to Setting -> search for "navigation mode" and select "3 button navigation" instead of "gesture navigation". Or test on Android 9 for example (there is only one type of 3 button gesture navigation available) |
|
Now with all these changes it looks like the majority of |
|
It looks like now, with Here's some before/after:
Do we really want to proceed this way? |
Just for an additional context - we already did the same fix for "Search" screens group (and it was accepted) 👀 |
And
If UX team is happy with a proposed approach in this PR then I'll change |
|
I agree with you that it looks pretty shoddy on iOS. I'm also not as familiar with standard Android patterns though. |
|
What is the plan here then? 🙂 |
|
@Julesssss or @dubielzyk-expensify - do you know what is expected for Android? Should those buttons have a background behind them, or should they float on top of the content like we'd expect on iOS? |
My 2 cents: most Android phones nowadays also use the iOS-like gesture control with a dash at the bottom. This safe area padding will affect them as well |
|
I agree that with iOS its better without the padding The problem with android with the buttons is that its bad ux imho when you show interactive elements under the android navigation buttons it leads to confusion as you can see two buttons overlayed - hence i think in that case we should definitely include safe area |
From what I see, there is no way to include the safe area only in some specific case. So we'll have it on iOS as well. |
|
We could make it android specific, right @kirillzyusko |
Yes, we can make it platform specific. Moreover on Android I think we can also make those padding transparent if it's gesture-navigation bar, and for 3 button navigation - we can apply a padding. However such refactoring may introduce some problems. Let me explain my concerns. 1️⃣ Non consistent paddings across various screensAs you could observe, somewhere we had transparent navigation bar (Search screens, workspaces screen). On some screens we always applied padding (settings screen). The current approach that we aim to follow is to always have that padding. But as you can see in this PR some screens are still have old behavior and not always add the padding. 2️⃣ Additional padding from
|
If we go this way, I would encourage to cover more pages than these in the PR. At least add the ones I've mentioned during the initial review. |
Yeah, sure, absolutely agree 🙂 Just want to understand whether we are okay to follow a proposed approach or not and then I can proceed and make corresponding changes based on a chosen decision 👀 |
|
@kirillzyusko Thanks for the explanation. Would your proposed steps lead to the state where the iOS native wont have the extra padding either (same as android without the navigation buttons)? If yes, I am fine with this atomic approach. |
@mountiny yes, the last step will lead to this 😊 |
|
@mountiny, what should be the next steps here, considering the conversation above? |
|
I think we can go ahead with this plan, but lets prepare it a bit more, I dont like that ios would have this extra padding for more time than needed cc @lakchote Also we can use this thread to discuss https://expensify.slack.com/archives/C049HHMV9SM/p1736238279772929 |
|
Posted in Slack here for the next steps. |
|
Ok, so this PR now removes Ideally we'll want to merge #55633 right after this. That PR also removes Still, there are some more issues to consider, that i'm explaining in a comment in the original issue. |
|
cc @lakchote for visibility. @chrispader would be great to write down the plan anad also I think we should ask QA to test these on adhoc builds. Should it just be this pr to start with? |
i'm on it right now. I going deeper into the plan and potential follow-up or split up PRs in the issue. #53186 (comment) |
|
@kirillzyusko i think we can close this PR, since we decided to go with a new plan discussed here This is the new "Base PR" that we'll use instead: #57128 |
|
@kirillzyusko please close this PR. |










Explanation of Change
To keep a consistency I specified
includeSafeAreaPaddingBottomon screens that had transparent navigation bar.Fixed Issues
$ #53186
PROPOSAL: N/A
Tests
Offline tests
N/A
QA Steps
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