-
Notifications
You must be signed in to change notification settings - Fork 21
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
Replace FullScreen and FullContainer components with useLayout hook #1206
Conversation
…BodyMarginOffsetEffect hook
@@ -0,0 +1,94 @@ | |||
/** |
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.
Most of the CSS was moved from <FullScreen>
and <FullContainer>
and merged to a single file. It'd be easier to check the diff from this link.
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.
Tested locally and all good. Using a custom hook is cleaner than before. 👍
- ✅ Full page layout looks the same as before.
- ✅ Full content layout looks the same as before.
- ✅ There are no flickering in both layouts.
- ❔ However I didn't see the flickering either when using
develop
branch.
- ❔ However I didn't see the flickering either when using
- ✅ There is no spinner when refreshing any of the GLA admin page
- ❔ However I didn't see the spinner either when using
develop
branch.
- ❔ However I didn't see the spinner either when using
- ✅ The CSS approach to override
margin-top
of#wpbody
instead ofuseWPBodyMarginOffsetEffect
hook works as expected. - ✅ Everything works as expected when testing against the new WC navigation.
- Side note: when using WC
6.1
, there is no WC navigation settings inwp-admin/admin.php?page=wc-settings&tab=advanced§ion=features
, downgrading to WC6.0
in order to test the above tasks against the new navigation.
- Side note: when using WC
- ✅ Code is clean and easy to understand.
- 💅 Left a non-blocking comment below.
@ianlin, thanks for the review!
💡 The The flickering does not always occur every time. Inserting a breakpoint would be easier to observe. The
|
Thanks for sharing this info and the breakpoint tip! Now I can reproduce the flickering problem in |
as we no longer need its offset to do calculations removed in #1206
Changes proposed in this Pull Request:
Closes #311
useLayout
hook.<FullScreen>
and<FullContainer>
withuseLayout
hook.<Spinner>
of<Suspense>
to global scope to globally prevent the flickering when initial loading GLA admin pages.margin-top
. To prevent the flickering when overriding themargin-top
.Screenshots:
🎥 Full page layout
🎥 Full page layout with new WooCommerce navigation feature
🎥 Full content layout
🎥 Full content layout with new WooCommerce navigation feature
Detailed test instructions:
Full page layout
/wp-admin/admin.php?page=wc-admin&path=%2Fgoogle%2Fstart
Full content layout
/wp-admin/admin.php?page=wc-admin&path=%2Fgoogle%2Fdashboard
The patch of hiding the
<Spinner>
of<Suspense>
With new WooCommerce navigation
/wp-admin/admin.php?page=wc-settings&tab=advanced§ion=features
Additional details:
💡 Why move the workaround of hiding the initial loading spinner to global scope.
<Suspense fallback={ <Spinner /> }>
at the top layer.Changelog entry