App icon indicating copy to clipboard operation
App copied to clipboard

Landscape UI - Unable to close FAB menu and notch is blocking some content from the preferences page - Reported by: @kakajann

Open isagoico opened this issue 5 years ago • 44 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Navigate to LHN
  2. Open FAB menu
  3. Change orientation to landscape
  4. Change back orientation to portrait
  5. Navigate to settings
  6. Open preferences
  7. Change orientation to landscape.

Expected Result:

UI should not break after changing orientation to landscape.

Actual Result:

User is unable to exit the FAB menu in preferences some UI elements are blocked by notch. Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platform:

Where is this issue occurring?

  • iOS
  • Android

Version Number: 1.1.8-0

Reproducible in staging?: Yes Reproducible in production?: Yes

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: Any additional supporting documentation image image

Upwork job link: https://www.upwork.com/jobs/~017190bb5038fac386

Issue reported by: @kakajann Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1634299085343500

View all open jobs on GitHub

isagoico avatar Oct 18 '21 15:10 isagoico

Triggered auto assignment to @pecanoro (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

MelvinBot avatar Oct 18 '21 15:10 MelvinBot

Triggered auto assignment to @michaelhaxhiu (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

MelvinBot avatar Oct 18 '21 16:10 MelvinBot

Proposal

  1. Create a new component to handle SafeArea for iPhoneX

src/components/SafeArea/index.js

const SafeArea = ({children}) => children;

export default SafeArea;

src/components/SafeArea/index.ios.js

const SafeArea = ({children}) => (
    <SafeAreaView style={[styles.iPhoneXSafeArea]} edges={['left', 'right']}>
        {children}
    </SafeAreaView>
);

export default SafeArea;
  1. Use it in App.js
<SafeArea>
    <Expensify />
</SafeArea>

This will solve the issue about blocked UI elements.

More Details

Apple suggests to use padding both sides in landscape mode on iPhoneX and this leads background color mismatch. Like this: Screen Shot 2021-10-19 at 8 21 53 AM and I had to set safeArea backgroundColor black. Like this: Screen Shot 2021-10-19 at 8 24 33 AM I don't think we can detect the orientation is left or right

kakajann avatar Oct 19 '21 03:10 kakajann

I think it looks better with the black BG.

shawnborton avatar Oct 19 '21 14:10 shawnborton

@michaelhaxhiu Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

MelvinBot avatar Oct 21 '21 19:10 MelvinBot

@michaelhaxhiu 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

MelvinBot avatar Oct 25 '21 19:10 MelvinBot

Sorry on the delay guys - I got assigned this GH while I was OOO (somehow?).

I can confirm this GH is unique and reproducible. Upwork job is posted: https://www.upwork.com/jobs/~017190bb5038fac386

michaelhaxhiu avatar Oct 26 '21 12:10 michaelhaxhiu

Triggered auto assignment to @Julesssss (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

MelvinBot avatar Oct 26 '21 12:10 MelvinBot

@parasharrajat I saw you added a thumbs down to the proposal above, was there a specific reason for this?

Julesssss avatar Oct 26 '21 14:10 Julesssss

Wrapping the whole app in safe area is not a best approach.

Main LHN takes full screen ...etc. It will have side-effects.

parasharrajat avatar Oct 26 '21 15:10 parasharrajat

@parasharrajat @Julesssss is this settled? I wanted to propose a slightly different approach

sidferreira avatar Oct 26 '21 17:10 sidferreira

@sidferreira we are still reviewing proposals, feel free to post yours here.

michaelhaxhiu avatar Oct 26 '21 18:10 michaelhaxhiu

Proposal

For most solution I agree with @kakajann but instead of using it app wise, I suggest to use it screen-based, for a better UI experience. This will allow the app to have a better result depending on what side it was rotated.

For example, the issue mentioned happens only if you rotate the device to the right, not if you rotate left. As well the problem of adding the whole app to the SafeArea causes the FAB shadow to not be complete.

So whatever changes, should make sure that the FAB shadow will render til the border of the device.

Follows some examples of the issue in different screens/orientations:

Screen Shot 2021-10-26 at 11 15 55 AM Screen Shot 2021-10-26 at 11 15 01 AM Screen Shot 2021-10-26 at 11 14 53 AM

I basically think that this is kinda bigger problem than just the FAB menu

sidferreira avatar Oct 26 '21 18:10 sidferreira

I don't think wrapping the app with custom SafeArea will be bad approach. Because it works with:

  • Only on iOs devices
  • Only on iPhone X and newer models
  • Only on Landscape orientation

kakajann avatar Oct 26 '21 18:10 kakajann

@kakajann I didn't want to mention it as a "bad" approach, sorry if sounded like that. The difference is about final results. Part of the expected UI behaviours on iOS is to have the content "bleeding" behind the notch, a behaviour that I personally enjoy, that's why I suggested a different approach.

sidferreira avatar Oct 26 '21 18:10 sidferreira

@sidferreira I was talking about @parasharrajat 's comment ) sorry I forgot to mention

kakajann avatar Oct 26 '21 18:10 kakajann

Because it works with:

  • Only on iOs devices

@kakajann what exactly do you mean here? That the safe area is only applied to the cases in which it is necessary?


@sidferreira selectively applying the fix to specific screens sounds a better solution to me, and it looks much better to have the extended background colours. But I wonder if the safe area should apply to specific devices, or all?

Julesssss avatar Oct 27 '21 14:10 Julesssss

That the safe area is only applied to the cases in which it is necessary?

Exactly.

Only on iOs devices

Because we define it in SafeArea/index.ios.js

Only on iPhone X and newer models

This will be handled by React Natives SafeAreaView

Only on Landscape orientation

edges={['left', 'right']} prop is enough to achieve it

kakajann avatar Oct 27 '21 14:10 kakajann

@Julesssss the component calculates and applies the margins based on the device type. It's pretty safe in my experience.

sidferreira avatar Oct 27 '21 15:10 sidferreira

Screen Shot 2021-10-26 at 11 14 53 AM

@sidferreira ideally, this solution would include padding for any right docked modal to avoid the notch covering some UI. Is this something that could also be achieved with your proposal? And if so, would we achieve this by applying SafeArea to the ScreenWrapper component?

For reference, there are quite a few flows with the right docked page: New Group/Chat, Request/Send Money, Settings, ect.

Julesssss avatar Oct 27 '21 15:10 Julesssss