-
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
[Wave 8] [Ideal Nav] Fix iPad navigation #35845
[Wave 8] [Ideal Nav] Fix iPad navigation #35845
Conversation
@@ -0,0 +1,3 @@ | |||
export default function getIsNarrowLayout() { | |||
return true; |
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.
This is an unsafe assumption – there are devices (such as an iPad pro), where even in portrait layout the screen width is wider than the breakpoint for narrow screens.
I think this practice of using platform as a proxy for other device properties which can be measured directly is bad and a source for technical debt.
I feel strongly that this PR be closed and we fix this by addressing the root cause of the problem(s) on iPad. My hunch is that most of them are stemming from bad assumptions like this one that native code must be running on a device with narrow screen width.
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 feel like this is more of a feature request as the assumption of us forcing portrait mode and narrow layout is running for a while and until we decide to officially support landscape too, its fine to keep it in the app.
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.
bad assumptions like this one that native code must be running on a device with narrow screen width.
This is not bad assumption imho, this is a intentional product/ design choice made in the past
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.
even if the screen width is beyond the threshold, the iPad always displays narrow layout
We already applied this throughout the app so I think it's fine for now.
Agree we should completely refactor this bad logic when we support wide layout in portrait mode of super large iPad (maybe when we officially support landscape mode)
@situchan @mananjadhav please do not review this PR as-is. |
We're discussing this internally here |
Chatted with @mountiny, and I'm willing to let this go through as a temporary measure, but we want to follow-up soon to remove this and address the root cause(s) to get wide layouts to work on native and remove any code that assumes that native devices must be a narrow layout. I stand by what I said above – that this PR codifies an unsafe assumption. As long as we acknowledge that and work to unwind this assumption, I'll remove my request for changes. According to @adamgrzybowski here, the main reasons why wide layouts don't currently work on native is due to our uses of
|
I'm going to group these issues into a tracking issue and add it to the wave8 project. |
The tracking issue if here #35854 thanks Rory! |
@situchan please feel free to resume the review |
@situchan whats your ETA on this PR? |
2 hrs |
Tested all 6 issues. Remaining bugs that were not fixed yet: Screen.Recording.2024-02-08.at.8.57.26.AM.mov |
Thanks for catching this bug @situchan! It should be fixed now. |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeScreen.Recording.2024-02-08.at.7.08.10.PM.moviOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
Test 1
This test case is not correct yet until #35927 is done. Please fix. |
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 tested as many cases as possible in addition to 6 linked issues.
Looks good!
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 everyone!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/mountiny in version: 1.4.40-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.40-5 🚀
|
Details
We used
getIsSmallScreenWidth
to determine which type of layout is currently displayed in some navigation logic. It was incorrect assumption on the iPad because even if the screen width is beyond the threshold, the iPad always displays narrow layout.With the new
getIsNarrowLayout
function everything should work the exactly the same on iPhones and iPads.P.S. Since the changes apply to the iPad only, I recorded videos exclusively for this platform.
Fixed Issues
$ #35753
$ #35755
$ #35752
$ #35758
$ #35759
$ #35764
Tests
Offline tests
QA Steps
Test 1
Test 2
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iPad.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop