From 4a94dfb10c2814d1564e23718c65cef72f6d9eda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20Kaan=20K=C3=B6se?= Date: Tue, 17 Mar 2026 16:08:04 +0100 Subject: [PATCH] Redesign Wino Account login and registration dialogs (#835) Add hero illustrations using XAML-native vector graphics (shield+lock for login, person+plus badge for registration). Improve visual design with gradient backgrounds, icon badges on benefit cards, and refined spacing/corner radii. Add Enter key handling so pressing Enter in an input field moves focus to the next field, and pressing Enter on the last field triggers the primary action (login/register). https://claude.ai/code/session_011B1M6UVeo4yUX3zNHBxQ2P Co-authored-by: Claude --- .../Dialogs/WinoAccountLoginDialog.xaml | 243 ++++++++++++++---- .../Dialogs/WinoAccountLoginDialog.xaml.cs | 41 ++- .../WinoAccountRegistrationDialog.xaml | 193 +++++++++++++- .../WinoAccountRegistrationDialog.xaml.cs | 50 +++- 4 files changed, 466 insertions(+), 61 deletions(-) diff --git a/Wino.Mail.WinUI/Dialogs/WinoAccountLoginDialog.xaml b/Wino.Mail.WinUI/Dialogs/WinoAccountLoginDialog.xaml index 84e46e40..1e8cfae2 100644 --- a/Wino.Mail.WinUI/Dialogs/WinoAccountLoginDialog.xaml +++ b/Wino.Mail.WinUI/Dialogs/WinoAccountLoginDialog.xaml @@ -19,65 +19,218 @@ - + + + - - - - - - - - - - - + Height="140" + CornerRadius="12"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Wino.Mail.WinUI/Dialogs/WinoAccountLoginDialog.xaml.cs b/Wino.Mail.WinUI/Dialogs/WinoAccountLoginDialog.xaml.cs index 20b367f3..bd88b239 100644 --- a/Wino.Mail.WinUI/Dialogs/WinoAccountLoginDialog.xaml.cs +++ b/Wino.Mail.WinUI/Dialogs/WinoAccountLoginDialog.xaml.cs @@ -1,5 +1,7 @@ using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Input; +using Windows.System; using Wino.Core.Domain; using Wino.Core.Domain.Entities.Shared; using Wino.Core.Domain.Interfaces; @@ -32,6 +34,25 @@ public sealed partial class WinoAccountLoginDialog : ContentDialog var deferral = args.GetDeferral(); + try + { + await PerformLoginAsync(); + } + finally + { + deferral.Complete(); + } + } + + private async System.Threading.Tasks.Task PerformLoginAsync() + { + var validationError = ValidateInput(); + if (!string.IsNullOrWhiteSpace(validationError)) + { + ShowError(validationError); + return; + } + try { SetBusyState(true); @@ -46,13 +67,11 @@ public sealed partial class WinoAccountLoginDialog : ContentDialog } Result = result.Account; - args.Cancel = false; Hide(); } finally { SetBusyState(false); - deferral.Complete(); } } @@ -71,6 +90,24 @@ public sealed partial class WinoAccountLoginDialog : ContentDialog return string.Empty; } + private void EmailTextBox_KeyDown(object sender, KeyRoutedEventArgs e) + { + if (e.Key == VirtualKey.Enter) + { + PasswordBox.Focus(FocusState.Programmatic); + e.Handled = true; + } + } + + private async void PasswordBox_KeyDown(object sender, KeyRoutedEventArgs e) + { + if (e.Key == VirtualKey.Enter) + { + e.Handled = true; + await PerformLoginAsync(); + } + } + private void InputChanged(TextBox sender, TextBoxTextChangingEventArgs args) => HideError(); private void InputChanged(object sender, RoutedEventArgs e) => HideError(); diff --git a/Wino.Mail.WinUI/Dialogs/WinoAccountRegistrationDialog.xaml b/Wino.Mail.WinUI/Dialogs/WinoAccountRegistrationDialog.xaml index 5f24e133..3d0abfe5 100644 --- a/Wino.Mail.WinUI/Dialogs/WinoAccountRegistrationDialog.xaml +++ b/Wino.Mail.WinUI/Dialogs/WinoAccountRegistrationDialog.xaml @@ -19,31 +19,187 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CornerRadius="12"> + @@ -53,20 +209,29 @@ + CornerRadius="12"> + @@ -74,21 +239,25 @@ - + + diff --git a/Wino.Mail.WinUI/Dialogs/WinoAccountRegistrationDialog.xaml.cs b/Wino.Mail.WinUI/Dialogs/WinoAccountRegistrationDialog.xaml.cs index fcc01d94..cdad25b3 100644 --- a/Wino.Mail.WinUI/Dialogs/WinoAccountRegistrationDialog.xaml.cs +++ b/Wino.Mail.WinUI/Dialogs/WinoAccountRegistrationDialog.xaml.cs @@ -1,6 +1,8 @@ using System; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Input; +using Windows.System; using Wino.Core.Domain; using Wino.Core.Domain.Entities.Shared; using Wino.Core.Domain.Interfaces; @@ -33,6 +35,25 @@ public sealed partial class WinoAccountRegistrationDialog : ContentDialog var deferral = args.GetDeferral(); + try + { + await PerformRegistrationAsync(); + } + finally + { + deferral.Complete(); + } + } + + private async System.Threading.Tasks.Task PerformRegistrationAsync() + { + var validationError = ValidateInput(); + if (!string.IsNullOrWhiteSpace(validationError)) + { + ShowError(validationError); + return; + } + try { SetBusyState(true); @@ -47,13 +68,11 @@ public sealed partial class WinoAccountRegistrationDialog : ContentDialog } Result = result.Account; - args.Cancel = false; Hide(); } finally { SetBusyState(false); - deferral.Complete(); } } @@ -77,6 +96,33 @@ public sealed partial class WinoAccountRegistrationDialog : ContentDialog return string.Empty; } + private void EmailTextBox_KeyDown(object sender, KeyRoutedEventArgs e) + { + if (e.Key == VirtualKey.Enter) + { + PasswordBox.Focus(FocusState.Programmatic); + e.Handled = true; + } + } + + private void PasswordBox_KeyDown(object sender, KeyRoutedEventArgs e) + { + if (e.Key == VirtualKey.Enter) + { + ConfirmPasswordBox.Focus(FocusState.Programmatic); + e.Handled = true; + } + } + + private async void ConfirmPasswordBox_KeyDown(object sender, KeyRoutedEventArgs e) + { + if (e.Key == VirtualKey.Enter) + { + e.Handled = true; + await PerformRegistrationAsync(); + } + } + private void InputChanged(TextBox sender, TextBoxTextChangingEventArgs args) => HideError(); private void InputChanged(object sender, RoutedEventArgs e) => HideError();