From 5450885afe266c4048e9ab2f254498b1d124e2d9 Mon Sep 17 00:00:00 2001 From: ggurdin <46800240+ggurdin@users.noreply.github.com> Date: Thu, 18 Sep 2025 10:19:34 -0400 Subject: [PATCH] 4017 usability test todos 91725 (#4026) * chore: add ability to toggle show password in signup and login pages * chore: update text in register popup --- lib/l10n/intl_en.arb | 2 +- lib/pangea/login/pages/pangea_login_view.dart | 10 +++++++++- lib/pangea/login/pages/signup_with_email_view.dart | 10 +++++++++- lib/pangea/login/widgets/full_width_button.dart | 3 +++ 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 2686bb459..388c4687f 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -4717,7 +4717,7 @@ } }, "slightlyOffensive": "Slightly offensive", - "clickOnEmailLink": "Please click on the link in the email and then proceed. In rare cases, the email can be sent to spam or take up to 5 minutes to arrive.", + "clickOnEmailLink": "Please click on the link in the email and then proceed.\n\nCheck your spam folder if the email hasn't arrived.", "whoIsAllowedToJoinThisChat": "Who is allowed to join this chat", "dontForgetPassword": "Don't forget your password!", "enableAutocorrectToolName": "Enable device autocorrect", diff --git a/lib/pangea/login/pages/pangea_login_view.dart b/lib/pangea/login/pages/pangea_login_view.dart index 1fd205a3d..26aec3bb2 100644 --- a/lib/pangea/login/pages/pangea_login_view.dart +++ b/lib/pangea/login/pages/pangea_login_view.dart @@ -40,7 +40,7 @@ class PangeaLoginView extends StatelessWidget { hintText: L10n.of(context).password, autofillHints: const [AutofillHints.password], autoFocus: true, - obscureText: true, + obscureText: !controller.showPassword, textInputAction: TextInputAction.go, onSubmitted: (_) { controller.enabledSignIn ? controller.login() : null; @@ -52,6 +52,14 @@ class PangeaLoginView extends StatelessWidget { return null; }, controller: controller.passwordController, + suffix: IconButton( + icon: Icon( + controller.showPassword + ? Icons.visibility_off + : Icons.visibility, + ), + onPressed: controller.toggleShowPassword, + ), ), ], ), diff --git a/lib/pangea/login/pages/signup_with_email_view.dart b/lib/pangea/login/pages/signup_with_email_view.dart index ed41d7090..ce7b75b25 100644 --- a/lib/pangea/login/pages/signup_with_email_view.dart +++ b/lib/pangea/login/pages/signup_with_email_view.dart @@ -39,10 +39,18 @@ class SignupWithEmailView extends StatelessWidget { FullWidthTextField( hintText: L10n.of(context).password, textInputAction: TextInputAction.done, - obscureText: true, + obscureText: !controller.showPassword, validator: controller.password1TextFieldValidator, controller: controller.passwordController, onSubmitted: controller.enableSignUp ? controller.signup : null, + suffix: IconButton( + icon: Icon( + controller.showPassword + ? Icons.visibility_off + : Icons.visibility, + ), + onPressed: controller.toggleShowPassword, + ), ), FullWidthButton( title: L10n.of(context).signUp, diff --git a/lib/pangea/login/widgets/full_width_button.dart b/lib/pangea/login/widgets/full_width_button.dart index 87180365a..3ea6180f1 100644 --- a/lib/pangea/login/widgets/full_width_button.dart +++ b/lib/pangea/login/widgets/full_width_button.dart @@ -121,6 +121,7 @@ class FullWidthTextField extends StatelessWidget { final String? labelText; final List? autofillHints; final bool autoFocus; + final Widget? suffix; const FullWidthTextField({ required this.hintText, @@ -134,6 +135,7 @@ class FullWidthTextField extends StatelessWidget { this.labelText, this.autofillHints, this.autoFocus = false, + this.suffix, super.key, }); @@ -159,6 +161,7 @@ class FullWidthTextField extends StatelessWidget { vertical: 8.0, ), isDense: true, + suffixIcon: suffix, ), validator: validator, onTapOutside: (_) => FocusManager.instance.primaryFocus?.unfocus(),