Skip to content
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

Settings screen: improve discoverability of save button #5443

Merged
merged 12 commits into from Oct 15, 2020

Conversation

johnwatkins0
Copy link
Contributor

@johnwatkins0 johnwatkins0 commented Sep 28, 2020

Summary

Fixes #5353

On the settings screen, this moves the "Save" button and the related success and error notices into a white bar fixed to the bottom of the screen. I have reused styles from the similar component in the onboarding wizard.

Result with no error:
Screen Shot 2020-09-28 at 8 34 14 AM

Result with error:
Screen Shot 2020-09-28 at 8 37 08 AM

Checklist

  • My pull request is addressing an open issue (please create one otherwise).
  • My code is tested and passes existing tests.
  • My code follows the Engineering Guidelines (updates are often made to the guidelines, check it out periodically).

@google-cla google-cla bot added the cla: yes Signed the Google CLA label Sep 28, 2020
@johnwatkins0 johnwatkins0 self-assigned this Sep 28, 2020
@johnwatkins0 johnwatkins0 marked this pull request as ready for review September 29, 2020 15:12
@github-actions
Copy link
Contributor

github-actions bot commented Sep 29, 2020

Plugin builds for 118dba3 are ready 🛎️!

@jwold jwold added the WS:UX Work stream for UX/Front-end label Sep 29, 2020
@johnwatkins0 johnwatkins0 added this to Ready for Review in Ongoing Sep 29, 2020
@johnwatkins0 johnwatkins0 removed this from Ready for Review in Ongoing Sep 29, 2020
@westonruter
Copy link
Member

@johnwatkins0 As I chatted to you, there's a slight change in the height of the fixed bar when the notice is shown.

Notice Showing Notice Hidden
image image

@johnwatkins0
Copy link
Contributor Author

there's a slight change in the height of the fixed bar when the notice is shown.

Fixed in 327d298

@westonruter westonruter added this to the v2.1 milestone Oct 2, 2020
Copy link
Member

@westonruter westonruter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great for me! I will defer to @pierlon for confirming the JS changes.

Comment on lines +183 to +185
@media screen and (min-width: 783px) {
padding: 30px 90px;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor point: should files like this eventually get renamed to *.sass? This isn't valid CSS so my IDE complains:

image

{ error && <ErrorNotice errorMessage={ error.message || __( 'An error occurred. You might be offline or logged out.', 'amp' ) } /> }
{ ! error && ! hasOptionsChanges && didSaveOptions && ! downloadingTheme && (
<AMPNotice
className={ `amp-save-success-notice ${ savedNoticeClass }` }
Copy link
Contributor

@pierlon pierlon Oct 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the notice be hidden once savedNoticeClass is set to dismissed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the class entirely in 9d1ec07

</svg>
</Button>
{ error && <ErrorNotice errorMessage={ error.message || __( 'An error occurred. You might be offline or logged out.', 'amp' ) } /> }
{ ! error && ! hasOptionsChanges && didSaveOptions && ! downloadingTheme && (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it now the case that the notice is always to be shown unless this condition evaluates to false?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it shows until the user makes changes again. So I just pushed 9d1ec07 to take this a step further and not have a custom class on the notice at all. That was to handle the fly in and automatic timeout, which aren't needed anymore.

@pierlon
Copy link
Contributor

pierlon commented Oct 3, 2020

Also, I noticed an error in one of the CSS files while reviewing (not related to these changes). Here's a patch with the fix:

--- assets/src/css/core-components.css	(revision 5b4b10be6bbf0729ec2eff5fce372d050466b367)
+++ assets/src/css/core-components.css	(date 1601691170646)
@@ -77,7 +77,7 @@
 
 .amp .components-button.is-primary:disabled.is-busy {
 	background-size: 100% 100%;
-	background-image: linear-gradient(-45deg, var(--amp-settings-color-brand) 28%, rgba(36, 89, 231, .8) 28%, rgb(36, 89, 231, .8) 72%, var(--amp-settings-color-brand) 72%);
+	background-image: linear-gradient(-45deg, var(--amp-settings-color-brand) 28%, rgba(36, 89, 231, .8) 28%, rgba(36, 89, 231, .8) 72%, var(--amp-settings-color-brand) 72%);
 	border-color: var(--color-gray-medium);
 }

@johnwatkins0
Copy link
Contributor Author

Also, I noticed an error in one of the CSS files while reviewing

Fixed in 4684790

@CLAassistant
Copy link

CLAassistant commented Oct 8, 2020

CLA assistant check
All committers have signed the CLA.

Co-authored-by: Pierre Gordon <16200219+pierlon@users.noreply.github.com>
@westonruter westonruter merged commit b7bb7c5 into develop Oct 15, 2020
@westonruter westonruter deleted the feature/5353-fixed-settings-footer branch October 15, 2020 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Signed the Google CLA WS:UX Work stream for UX/Front-end
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve discoverability of “Save Changes” button on AMP settings screen
5 participants