From 27fd740e7ff4cfcbc3a59f2a86fd0a3e6e0e78e1 Mon Sep 17 00:00:00 2001 From: Gabriel Dufresne Date: Wed, 14 Oct 2026 10:27:49 -0400 Subject: [PATCH 01/15] Improve the Software Catalog and Catalog Editor experience Catalog Editor - Rename "New" to "New file", give it its own icon, and always confirm before it closes the open file; "New catalog" gets a distinct icon - Remove a catalog from the selector dropdown (x per row), confirming when it still has packages; the list stays open between removals - Add packages: jump to Discover with the edited catalog preselected - Save to the machine-wide catalog on macOS through the system administrator prompt when the root-owned file is not writable - Show unsaved changes in the page subtitle, errors in a dialog with selectable/copyable text, and a toast on save, instead of a status block that shrank the package list - Rename catalog uses a rename icon; sidebar item uses catalog_add Discover - Drop the always-visible catalog dropdown; "Add selection to catalog" opens a dialog to pick one or more catalogs and reports what was added and what was already present in each Software Catalog - When enabled, list it first in the sidebar, open it by default, and renumber Ctrl/Cmd+1..9 (and the macOS View menu) to follow the sidebar order from one shared mapping - Remember the view mode and sort order across restarts; default to the Icons view macOS glass - Keep toolbar button highlights and the catalog dropdown inside the capsule rim - Round the main toolbar button fully when it has no dropdown half Tests - Isolate SoftwareCatalogTests settings in a temp folder, and cover catalog removal, multi-catalog adds, persisted view/sort and the shortcut order --- src/Languages/lang_en.json | 23 +++++ .../Assets/Symbols/catalog_add.svg | 3 + .../Assets/Symbols/collections_add.svg | 3 + .../Assets/Symbols/document_add.svg | 3 + src/SharedAssets/Assets/Symbols/rename.svg | 3 + .../Styles/Styles.MacGlassControls.axaml | 18 ++++ .../Infrastructure/MacAdminFileInstaller.cs | 55 +++++++++++ .../Models/SoftwareCatalog.cs | 20 +++- .../DialogPages/CatalogEditorViewModel.cs | 71 ++++++++++++-- .../ViewModels/MainWindowViewModel.cs | 25 +++-- .../SoftwarePages/PackagesPageViewModel.cs | 16 +++- .../SoftwarePages/SoftwareCatalogViewModel.cs | 49 +++++++++- .../Views/Controls/CatalogSelector.cs | 93 +++++++++++++++---- .../Views/MainWindow.MacMenu.cs | 28 ++++-- .../Views/MainWindow.axaml.cs | 27 +++--- .../Pages/SettingsPages/Interface_P.axaml.cs | 8 +- src/UniGetUI.Avalonia/Views/SidebarView.axaml | 34 +++---- .../Views/SidebarView.axaml.cs | 27 ++++++ .../AbstractPackagesPage.axaml.cs | 3 + .../Views/SoftwarePages/CatalogEditorPage.cs | 90 +++++++++++++++--- .../SoftwarePages/DiscoverSoftwarePage.cs | 82 ++++++++++++++-- src/UniGetUI.Tests/CatalogEditorTests.cs | 48 ++++++++++ src/UniGetUI.Tests/SoftwareCatalogTests.cs | 68 ++++++++++++-- 23 files changed, 679 insertions(+), 118 deletions(-) create mode 100644 src/SharedAssets/Assets/Symbols/catalog_add.svg create mode 100644 src/SharedAssets/Assets/Symbols/collections_add.svg create mode 100644 src/SharedAssets/Assets/Symbols/document_add.svg create mode 100644 src/SharedAssets/Assets/Symbols/rename.svg create mode 100644 src/UniGetUI.Avalonia/Infrastructure/MacAdminFileInstaller.cs diff --git a/src/Languages/lang_en.json b/src/Languages/lang_en.json index 57e75dc5f3..cfcdc42943 100644 --- a/src/Languages/lang_en.json +++ b/src/Languages/lang_en.json @@ -57,6 +57,29 @@ "The selected package manager is not ready.": "The selected package manager is not ready.", "Catalog package search failed: {0}": "Catalog package search failed: {0}", "Discard unsaved catalog changes?": "Discard unsaved catalog changes?", + "New file": "New file", + "Add packages": "Add packages", + "Add packages to {0}": "Add packages to {0}", + "Search for packages, check the ones you want, then click Add selection to catalog.": "Search for packages, check the ones you want, then click Add selection to catalog.", + "Packages added to catalog": "Packages added to catalog", + "Choose the catalogs to add the {0} selected packages to.": "Choose the catalogs to add the {0} selected packages to.", + "Add to {0} catalogs": "Add to {0} catalogs", + "{0} were already in the catalog.": "{0} were already in the catalog.", + "{0}: {1} added": "{0}: {1} added", + "{0}: {1} added, {2} already there": "{0}: {1} added, {2} already there", + "Save the catalog to keep your changes.": "Save the catalog to keep your changes.", + "Packages added to {0} catalogs": "Packages added to {0} catalogs", + "{0} packages added to {1} catalogs. Save the catalog to keep your changes.": "{0} packages added to {1} catalogs. Save the catalog to keep your changes.", + "Create a catalog in the Catalog Editor first.": "Create a catalog in the Catalog Editor first.", + "Catalog saved": "Catalog saved", + "The catalog was not saved.": "The catalog was not saved.", + "UniGetUI needs administrator rights to save the software catalog.": "UniGetUI needs administrator rights to save the software catalog.", + "Remove": "Remove", + "Remove catalog": "Remove catalog", + "Remove catalog {0}": "Remove catalog {0}", + "Remove catalog {0} and its {1} packages?": "Remove catalog {0} and its {1} packages?", + "Discard unsaved catalog changes and start a new catalog file?": "Discard unsaved catalog changes and start a new catalog file?", + "Close the current catalog file and start a new one? Use New catalog to add a catalog to this file instead.": "Close the current catalog file and start a new one? Use New catalog to add a catalog to this file instead.", "Select a local catalog file.": "Select a local catalog file.", "Could not select a catalog file: {0}": "Could not select a catalog file: {0}", "The catalog editor could not be opened: {0}": "The catalog editor could not be opened: {0}", diff --git a/src/SharedAssets/Assets/Symbols/catalog_add.svg b/src/SharedAssets/Assets/Symbols/catalog_add.svg new file mode 100644 index 0000000000..1d21ff3480 --- /dev/null +++ b/src/SharedAssets/Assets/Symbols/catalog_add.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/SharedAssets/Assets/Symbols/collections_add.svg b/src/SharedAssets/Assets/Symbols/collections_add.svg new file mode 100644 index 0000000000..93a08ea938 --- /dev/null +++ b/src/SharedAssets/Assets/Symbols/collections_add.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/SharedAssets/Assets/Symbols/document_add.svg b/src/SharedAssets/Assets/Symbols/document_add.svg new file mode 100644 index 0000000000..f474900a5e --- /dev/null +++ b/src/SharedAssets/Assets/Symbols/document_add.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/SharedAssets/Assets/Symbols/rename.svg b/src/SharedAssets/Assets/Symbols/rename.svg new file mode 100644 index 0000000000..048b8fe0b5 --- /dev/null +++ b/src/SharedAssets/Assets/Symbols/rename.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/UniGetUI.Avalonia/Assets/Styles/Styles.MacGlassControls.axaml b/src/UniGetUI.Avalonia/Assets/Styles/Styles.MacGlassControls.axaml index 5471f59d31..4d33c2c401 100644 --- a/src/UniGetUI.Avalonia/Assets/Styles/Styles.MacGlassControls.axaml +++ b/src/UniGetUI.Avalonia/Assets/Styles/Styles.MacGlassControls.axaml @@ -82,6 +82,20 @@ + + + + +