From 91a45d6ac27fabcc293cff853838c0df144df737 Mon Sep 17 00:00:00 2001 From: Giuseppe Imperato Date: Fri, 1 May 2026 23:07:19 +0200 Subject: [PATCH] ui: remove duplicate add buttons from empty states; fix subtitle wrapping and alignment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove PrimaryActionText from all four list-view EmptyStateControls (Passwords, CreditCards, Identities, SecureNotes) — the add action is already available in the top-right toolbar; showing it a second time at the center of the page was redundant and visually cluttered - Remove wired PrimaryActionCommand in IdentitiesListView and SecureNotesListView code-behind (no longer needed) - Hide ColumnHeadersGrid in PasswordsListView when the list is empty to prevent the header row from pushing the empty state off-center - EmptyStateControl: remove MaxWidth constraint and set TextWrapping=NoWrap on the subtitle so it always renders on a single line - IdentitiesListView: add Margin="0,16,0,0" to EmptyState to compensate for the missing RowSpacing gap and align its icon with Password/Cards - Installer/PassKey.iss: bump AppVersion to 1.0.5 (missed in previous PR) Co-Authored-By: Claude Sonnet 4.6 --- Installer/PassKey.iss | 4 ++-- src/PassKey.Desktop/Controls/EmptyStateControl.xaml | 4 ++-- src/PassKey.Desktop/Views/CreditCardsListView.xaml | 2 +- src/PassKey.Desktop/Views/CreditCardsListView.xaml.cs | 2 -- src/PassKey.Desktop/Views/IdentitiesListView.xaml | 3 ++- src/PassKey.Desktop/Views/IdentitiesListView.xaml.cs | 5 ----- src/PassKey.Desktop/Views/PasswordsListView.xaml | 4 ++-- src/PassKey.Desktop/Views/PasswordsListView.xaml.cs | 3 +-- src/PassKey.Desktop/Views/SecureNotesListView.xaml | 1 - src/PassKey.Desktop/Views/SecureNotesListView.xaml.cs | 4 ---- 10 files changed, 10 insertions(+), 22 deletions(-) diff --git a/Installer/PassKey.iss b/Installer/PassKey.iss index 4078573..b98f02d 100644 --- a/Installer/PassKey.iss +++ b/Installer/PassKey.iss @@ -4,8 +4,8 @@ [Setup] AppId={{A7F3C2D1-8E4B-4F9A-B6D5-3C1E7A2F0D84} AppName=PassKey -AppVersion=1.0.4 -AppVerName=PassKey 1.0.4 +AppVersion=1.0.5 +AppVerName=PassKey 1.0.5 AppPublisher=Giuseppe Imperato AppPublisherURL=https://github.com/pexatar/PassKey AppSupportURL=https://github.com/pexatar/PassKey/issues diff --git a/src/PassKey.Desktop/Controls/EmptyStateControl.xaml b/src/PassKey.Desktop/Controls/EmptyStateControl.xaml index 6a88c45..68b968b 100644 --- a/src/PassKey.Desktop/Controls/EmptyStateControl.xaml +++ b/src/PassKey.Desktop/Controls/EmptyStateControl.xaml @@ -6,8 +6,7 @@ + Spacing="16"> + /> diff --git a/src/PassKey.Desktop/Views/CreditCardsListView.xaml.cs b/src/PassKey.Desktop/Views/CreditCardsListView.xaml.cs index fb83744..58aa62e 100644 --- a/src/PassKey.Desktop/Views/CreditCardsListView.xaml.cs +++ b/src/PassKey.Desktop/Views/CreditCardsListView.xaml.cs @@ -31,8 +31,6 @@ public async void SetViewModel(CreditCardsListViewModel vm) // Apply localized empty-state strings (guarantees correct language on every OS locale). EmptyState.Title = _res.GetString("EmptyCardsTitle"); EmptyState.Subtitle = _res.GetString("EmptyCardsSubtitle"); - EmptyState.PrimaryActionText = _res.GetString("EmptyCardsPrimaryAction"); - vm.PropertyChanged += OnViewModelPropertyChanged; vm.SaveCompleted += ShowSavedToast; diff --git a/src/PassKey.Desktop/Views/IdentitiesListView.xaml b/src/PassKey.Desktop/Views/IdentitiesListView.xaml index 715e402..6c58b9e 100644 --- a/src/PassKey.Desktop/Views/IdentitiesListView.xaml +++ b/src/PassKey.Desktop/Views/IdentitiesListView.xaml @@ -60,10 +60,11 @@ x:Uid="EmptyIdentities" x:Name="EmptyState" Visibility="Collapsed" + Margin="0,16,0,0" Icon="" Title="Nessuna identità" Subtitle="Aggiungi la tua prima identità per salvare dati personali, indirizzi e documenti." - PrimaryActionText="Aggiungi identità" /> + /> _viewModel?.AddNewCommand.Execute(null)); - await vm.LoadEntriesCommand.ExecuteAsync(null); UpdateList(); UpdateEmptyState(); diff --git a/src/PassKey.Desktop/Views/PasswordsListView.xaml b/src/PassKey.Desktop/Views/PasswordsListView.xaml index 611e14f..3d533c2 100644 --- a/src/PassKey.Desktop/Views/PasswordsListView.xaml +++ b/src/PassKey.Desktop/Views/PasswordsListView.xaml @@ -55,7 +55,7 @@ - + @@ -187,7 +187,7 @@ Icon="" Title="Nessuna password salvata" Subtitle="Aggiungi la tua prima password per iniziare a proteggere i tuoi account." - PrimaryActionText="Nuova password" /> + /> diff --git a/src/PassKey.Desktop/Views/PasswordsListView.xaml.cs b/src/PassKey.Desktop/Views/PasswordsListView.xaml.cs index c3abbfe..e3c31d7 100644 --- a/src/PassKey.Desktop/Views/PasswordsListView.xaml.cs +++ b/src/PassKey.Desktop/Views/PasswordsListView.xaml.cs @@ -32,8 +32,6 @@ public async void SetViewModel(PasswordsListViewModel vm) // Apply localized empty-state strings (guarantees correct language on every OS locale). EmptyState.Title = _res.GetString("EmptyPasswordsTitle"); EmptyState.Subtitle = _res.GetString("EmptyPasswordsSubtitle"); - EmptyState.PrimaryActionText = _res.GetString("EmptyPasswordsPrimaryAction"); - vm.PropertyChanged += OnViewModelPropertyChanged; vm.SaveCompleted += ShowSavedToast; @@ -68,6 +66,7 @@ private void UpdateEmptyState() if (_viewModel is null) return; EmptyState.Visibility = _viewModel.IsEmpty ? Visibility.Visible : Visibility.Collapsed; PasswordList.Visibility = _viewModel.IsEmpty ? Visibility.Collapsed : Visibility.Visible; + ColumnHeadersGrid.Visibility = _viewModel.IsEmpty ? Visibility.Collapsed : Visibility.Visible; } private void UpdateDetailPanel() diff --git a/src/PassKey.Desktop/Views/SecureNotesListView.xaml b/src/PassKey.Desktop/Views/SecureNotesListView.xaml index 0b22109..bc375b5 100644 --- a/src/PassKey.Desktop/Views/SecureNotesListView.xaml +++ b/src/PassKey.Desktop/Views/SecureNotesListView.xaml @@ -171,7 +171,6 @@ Icon="" Title="Nessuna nota" Subtitle="Crea la tua prima nota sicura per salvare informazioni riservate." - PrimaryActionText="Nuova nota" AutomationProperties.Name="Nessuna nota. Crea la tua prima nota sicura." /> diff --git a/src/PassKey.Desktop/Views/SecureNotesListView.xaml.cs b/src/PassKey.Desktop/Views/SecureNotesListView.xaml.cs index 1dd4401..3feca18 100644 --- a/src/PassKey.Desktop/Views/SecureNotesListView.xaml.cs +++ b/src/PassKey.Desktop/Views/SecureNotesListView.xaml.cs @@ -39,13 +39,9 @@ public async void SetViewModel(SecureNotesListViewModel vm) // Apply localized empty-state strings (guarantees correct language on every OS locale). EmptyState.Title = _res.GetString("EmptyNotesTitle"); EmptyState.Subtitle = _res.GetString("EmptyNotesSubtitle"); - EmptyState.PrimaryActionText = _res.GetString("EmptyNotesPrimaryAction"); FilteredEmptyState.Title = _res.GetString("EmptyFilteredTitle"); FilteredEmptyState.Subtitle = _res.GetString("EmptyFilteredSubtitle"); - // Wire EmptyState primary action button - EmptyState.PrimaryActionCommand = new RelayCommand(() => _viewModel?.AddNewCommand.Execute(null)); - await vm.LoadEntriesCommand.ExecuteAsync(null); UpdateList(); UpdateEmptyState();