-
Notifications
You must be signed in to change notification settings - Fork 22
Pre-processing of Card UI to reduce the future work conflicts between partial auth and UX improvements on onboarding page #1052
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
Conversation
if ( ! google ) { | ||
return ( | ||
<TitleButtonLayout | ||
title={ __( | ||
'Error while loading Google account info', | ||
'google-listings-and-ads' | ||
) } | ||
/> | ||
); | ||
} |
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 didn't move this part to the new implementation, because with the previous continued development, it has been no longer entering this logic.
&:not(:empty) { | ||
margin-bottom: 8px; | ||
} |
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.
To remove the extra 8px height when rendering the loading spinner only at
google-listings-and-ads/js/src/components/google-account-card/google-account-card.js
Lines 13 to 15 in 92b0887
if ( ! hasFinishedResolution ) { | |
return <AccountCard appearance={ {} } description={ <AppSpinner /> } />; | |
} |
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'm not sure if we discussed it already, but if we'd make Cards body a display: flex; flex-direction: column; gap: 8px;
we would not have to bother about :not(:empty)
and :last-child
manual margin juggling, but would get that collapsing for empty and edge items for free.
If we are about to stay with manual reset, I'd add a code comment that it's to collapse the margin for empty titles. So we won't forget this in the future.
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.
A similar discussion is here #1019 (comment).
In the <Subsection.Title>
case, currently its parent elements are:
<Section.Card.Body>
<FlexBlock>
<Subsection>
<ContentButtonLayout>
<div>
If transfer the space style to upper layers, the changing scope will be much larger. I lean toward not doing so for now. Added comment by a41336c
<AppDocumentationLink | ||
context="setup-mc-accounts" | ||
linkId="required-google-permissions" | ||
href="https://docs.woocommerce.com/document/google-listings-and-ads/#required-google-permissions" |
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.
The anchor should work after finishing #1053
js/src/components/google-account-card/auth-google-account-card.js
Outdated
Show resolved
Hide resolved
js/src/components/google-account-card/auth-google-account-card.js
Outdated
Show resolved
Hide resolved
appearance={ APPEARANCE.GOOGLE } | ||
disabled={ disabled } | ||
hideIcon | ||
alignIcon="top" |
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.
❔ 📜
Do we need alignIcon
when it's hideIcon
.
Also maybe we can somehow marge those two props together, to avoid such confusion.
Like, iconPosition = top | center | hidden
?
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.
Sorry for not stating it clearly first. 🙏 By the UX Improvements project, all account cards will have a leading icon. But I only adjusted Google account card for the Partial oauth project, and other account cards stay with the original visual results. To make it consistent as possible, I was thinking of hiding the icon here, and Gan can just remove all hideIcon
when he is working on UX Improvements.
// cc @ecgan
const { google, hasFinishedResolution } = useGoogleAccount(); | ||
|
||
if ( ! hasFinishedResolution ) { | ||
return <AccountCard appearance={ {} } description={ <AppSpinner /> } />; |
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.
📜 It wasn't here before, but we could consider making this element A11y friendly with indicating loading state
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.
💅 📜 Also, maybe we can consider introducing a default behavior for no appearance, so we would not have to provide an empty object here.
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.
Since the UX Improvements project will have more interactive adjustments to all account cards on the onboarding page, and I don't know how Gan will do the design. So I don't aim to make detailed changes in this PR, but to stick to the original implementation as much as possible. And we could leave this 📜 as a dev note for Gan. 😎
// cc @ecgan
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.
Reviewed the code, tested locally, the MC setup, Ads setup, and settings cards. LGTM besides one note about no-longer-needed code left, plus a number of cosmetic ideas.
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.
pre-approving, as I guess there are still PRs planned that may address all remaining issues.
Changes proposed in this Pull Request:
Part of #1000
disabled
andalignIcon
props to<AccountCard>
for styling<GoogleAccountCard>
by<AccountCard>
<GoogleMCAccount>
<GoogleAccount>
within js/src/setup-ads/ads-stepper/setup-accounts/index.jsThe requirements of UX improvements can be found at pcTzPl-6u
Additional notes
<AccountCard>
, so I put the class names onto some internal elements in advance by the existed naming convention in the codebase. Such as the usages in the app-tab-navScreenshots:
💡 The adjusted UI of WordPress and Google account cards is upon the red line, and the one under red line is the original UI.
📷 . Disabled card/secion
📷 . Not yet connected
📷 . Connected
Detailed test instructions:
Changelog entry