-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Notices: Add to logged out layout #23951
Conversation
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.
Tests well for me. Tried some other logged-out pages: /start, /jetpack/connect, /themes. All work fine and display notices on dispatch
.
Can also see the component mounting on server render:
calypso:server-render cache access for key +300ms /log-in
calypso:server-render cache miss for key +0ms /log-in
calypso:notices Mounting Global Notices React component. +14ms
calypso:server-render Server render time (ms) +58ms 72
GET /log-in 200 210.226 ms - 38659
👍
My first thought when seeing that was that maybe it was omitted to reduce logged out bundle size, but it seems there is no (significant) effect:
|
Add
GlobalNotices
to the logged-out layout. This allows notices to be displayed on logged-out pages.Remove
GlobalNotices
from thelogin
component to avoid duplication when viewinglogin
while… logged in. (https://github.com/Automattic/wp-calypso/pull/13700/files#r179679601)Add relevant state mock for renderToString layout tests.
Background
I was looking for evidence that
GlobalNotices
was intentionally removed or omitted from the logged-out layout but could not find any. Here's what I was able to uncover:Many
moonscommits ago, there were logged-in and logged-out layouts that both includedGlobalNotices
:wp-calypso/client/layout/index.jsx
Line 136 in 7fdca82
wp-calypso/client/layout/logged-out.jsx
Line 25 in 7fdca82
A design-specific logged-out layout also existed, it's creation was described in part as:
This omitted
GlobalNotices
. Was that intentional? (cc: @ockham @ehg)The logged-out layout was removed, with the exception of a design-specific version (Layout: Replace
LayoutLoggedOut
andLayoutLoggedOutOAuth
withLayout
#2964)The design-specific version became the generic logged-out layout (Themes: Render logged-out layout last #3516). This maintains the omission of
GlobalNotices
, which continues in the logged-out layout that we know and love today.It appears the
GlobalNotices
was likely lost in the shuffle. It may have been deemed unnecessary for the design layout, then overlooked when it became the generic logged-out layout.After all this, the login view needed to show notices (#13700).
It also appears that notices will be needed in other logged-out views (#23846).
Testing
/log-in
while logged in, you should see exactly one instance of theNoticesList
component in the React tree.Try notice-related instructions from Login: Make it possible to send 2FA recovery code via sms #13700