From 8ac1f6ad9ae4669cdf2de2128b5fa32c8522ff96 Mon Sep 17 00:00:00 2001 From: chapoi <101828855+chapoi@users.noreply.github.com> Date: Fri, 25 Oct 2024 14:34:59 +0200 Subject: [PATCH] UX: Visual adjustments to login/signup forms (#28680) This adds several improvements to the signup/login forms. Some of them include: - Added a minimal signup progress bar design for mobile. - Made the signup/login modals full height on mobile. - Improved the activation, account creation, and login-required pages on mobile. - Removed the subheader and emoji from the welcome component. - Removed most input instructions. - Used consistent font size for text below the inputs. - Displayed input instructions only when the field is focused. - Improved the vertical alignment of input labels. - Increased the spacing between inputs. - Fixed label positioning for custom fields. - Moved the "(optional)" text for the name input outside the instructions. - Disabled buttons during login to prevent layout shifts. - Reused the CTA component for modals as well. - Matched the invite CTA styles with the signup form. --------- Co-authored-by: Jan Cernik Co-authored-by: Joffrey JAFFEUX --- .../app/components/modal/create-account.hbs | 100 ++------- .../discourse/app/components/modal/login.hbs | 19 +- .../discourse/app/components/modal/login.js | 4 +- .../app/components/modal/login/footer.hbs | 26 --- .../app/components/signup-progress-bar.gjs | 28 ++- .../app/components/welcome-header.gjs | 6 - .../discourse/app/controllers/invites-show.js | 9 - .../discourse/app/mixins/name-validation.js | 6 +- .../app/templates/activate-account.gjs | 5 +- .../discourse/app/templates/invites/show.hbs | 28 +-- .../discourse/app/templates/login.hbs | 15 +- .../discourse/app/templates/signup.hbs | 31 +-- .../common/base/login-signup-page.scss | 60 +++++- .../stylesheets/common/base/static-login.scss | 6 +- .../components/signup-progress-bar.scss | 40 ++-- .../stylesheets/common/modal/login-modal.scss | 92 +++++++- .../desktop/login-signup-page.scss | 3 +- app/assets/stylesheets/mobile/_index.scss | 1 + .../mobile/components/welcome-header.scss | 2 + .../stylesheets/mobile/login-modal.scss | 204 ++++++++++++++++-- .../stylesheets/mobile/login-signup-page.scss | 42 +++- .../mobile/signup-progress-bar.scss | 30 +++ config/locales/client.en.yml | 6 +- 23 files changed, 481 insertions(+), 282 deletions(-) delete mode 100644 app/assets/javascripts/discourse/app/components/modal/login/footer.hbs create mode 100644 app/assets/stylesheets/mobile/signup-progress-bar.scss diff --git a/app/assets/javascripts/discourse/app/components/modal/create-account.hbs b/app/assets/javascripts/discourse/app/components/modal/create-account.hbs index aca31285ab9..764b479bec8 100644 --- a/app/assets/javascripts/discourse/app/components/modal/create-account.hbs +++ b/app/assets/javascripts/discourse/app/components/modal/create-account.hbs @@ -25,7 +25,6 @@ {{i18n "user.email.title"}} - - {{#unless this.emailValidation.reason}} + {{#if this.emailValidation.reason}} + + {{else}} {{i18n "user.email.instructions"}} - {{/unless}} + {{/if}} - {{#unless this.passwordValidation.reason}} - - {{this.passwordInstructions}} - - {{/unless}}
- {{#unless this.nameValidation.reason}} - - {{this.nameInstructions}} - - {{/unless}} {{/if}}
@@ -250,34 +235,13 @@ {{#if this.site.desktopView}} {{#if (and this.showCreateForm this.site.mobileView)}} - {{#if this.disclaimerHtml}} -
- {{html-safe this.disclaimerHtml}} -
- {{/if}} - - - {{/if}} diff --git a/app/assets/javascripts/discourse/app/components/modal/login.hbs b/app/assets/javascripts/discourse/app/components/modal/login.hbs index ec50c33f775..014f0bae49f 100644 --- a/app/assets/javascripts/discourse/app/components/modal/login.hbs +++ b/app/assets/javascripts/discourse/app/components/modal/login.hbs @@ -27,10 +27,7 @@ {{else}} {{#if this.site.mobileView}} - + {{#if this.site.desktopView}} - + {{#if this.site.desktopView}} {{/unless}} {{#if this.hasAtLeastOneLoginButton}} @@ -123,7 +114,7 @@ <:footer> {{#if this.site.mobileView}} {{#unless this.hasNoLoginOptions}} - - {{/unless}} - - {{#if @showSignupLink}} - - {{/if}} -{{/if}} - - \ No newline at end of file diff --git a/app/assets/javascripts/discourse/app/components/signup-progress-bar.gjs b/app/assets/javascripts/discourse/app/components/signup-progress-bar.gjs index 23de7497bb6..587a2441b0f 100644 --- a/app/assets/javascripts/discourse/app/components/signup-progress-bar.gjs +++ b/app/assets/javascripts/discourse/app/components/signup-progress-bar.gjs @@ -10,6 +10,7 @@ import I18n from "discourse-i18n"; export default class SignupProgressBar extends Component { @service siteSettings; + @service site; @tracked steps = []; constructor() { @@ -48,25 +49,22 @@ export default class SignupProgressBar extends Component { {{#if @step}}