Allow automatic updates to be limited to selected packages - #5327
Conversation
There was a problem hiding this comment.
Pull request overview
Adds package-specific automatic-update selection integrated with scheduled maintenance.
Changes:
- Adds persistent automatic-update selections and legacy migration.
- Adds scheduler targeting and management UI.
- Adds tests, localization, styles, and shared icon loading.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/UniGetUI.PackageEngine.Tests/PackageOperationsTests.cs |
Isolates test settings. |
src/UniGetUI.PackageEngine.Tests/AutoUpdatesDatabaseTests.cs |
Tests storage and migration. |
src/UniGetUI.PackageEngine.PackageManagerClasses/Packages/Classes/AutoUpdatesMigration.cs |
Migrates legacy selections. |
src/UniGetUI.PackageEngine.PackageManagerClasses/Packages/Classes/AutoUpdatesDatabase.cs |
Persists selected packages. |
src/UniGetUI.Core.Tools/Scheduling/ScheduleInstallTargets.cs |
Defines update scopes. |
src/UniGetUI.Core.Tools/Scheduling/MaintenanceTaskSchedule.cs |
Stores install scope. |
src/UniGetUI.Core.Tools/Scheduling/MaintenanceScheduleStore.cs |
Reads normalized scope. |
src/UniGetUI.Core.Tools.Tests/MaintenanceScheduleStoreTests.cs |
Tests scope persistence. |
src/UniGetUI.Core.Settings/SettingsEngine_Names.cs |
Adds settings keys. |
src/UniGetUI.Avalonia/Views/SoftwarePages/SoftwareUpdatesPage.cs |
Filters scheduled updates. |
src/UniGetUI.Avalonia/Views/SoftwarePages/AbstractPackagesPage.axaml.cs |
Opens management dialog. |
src/UniGetUI.Avalonia/Views/Pages/SettingsPages/Scheduler.axaml.cs |
Handles management requests. |
src/UniGetUI.Avalonia/Views/Pages/SettingsPages/Scheduler.axaml |
Adds scope controls. |
src/UniGetUI.Avalonia/Views/MainWindow.axaml.cs |
Hosts the new dialog. |
src/UniGetUI.Avalonia/Views/DialogPages/ManageAutoUpdatesWindow.axaml.cs |
Implements dialog behavior. |
src/UniGetUI.Avalonia/Views/DialogPages/ManageAutoUpdatesWindow.axaml |
Defines management UI. |
src/UniGetUI.Avalonia/Views/DialogPages/InstallOptionsControl.axaml |
Adds automatic-update controls. |
src/UniGetUI.Avalonia/Views/Controls/PackageIconLoader.cs |
Generalizes lazy icon loading. |
src/UniGetUI.Avalonia/ViewModels/SoftwarePages/PackagesPageViewModel.cs |
Exposes management command. |
src/UniGetUI.Avalonia/ViewModels/Pages/SettingsPages/SchedulerViewModel.cs |
Refreshes scheduler tasks. |
src/UniGetUI.Avalonia/ViewModels/Pages/SettingsPages/ScheduledTaskViewModel.cs |
Manages install scope. |
src/UniGetUI.Avalonia/ViewModels/DialogPages/ManageIgnoredUpdatesViewModel.cs |
Shares icon resolution. |
src/UniGetUI.Avalonia/ViewModels/DialogPages/ManageAutoUpdatesViewModel.cs |
Manages package selections. |
src/UniGetUI.Avalonia/ViewModels/DialogPages/InstallOptionsViewModel.cs |
Persists package selection. |
src/UniGetUI.Avalonia/Models/PackageCollections.cs |
Exposes shared icon loading. |
src/UniGetUI.Avalonia/Infrastructure/AvaloniaBootstrapper.cs |
Runs migration at startup. |
src/UniGetUI.Avalonia/Assets/Styles/Styles.Common.axaml |
Styles active toggles. |
src/Languages/lang_en.json |
Adds English strings. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 28 out of 28 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
Previously missed (2) — in code that hasn't changed since the last review.
src/UniGetUI.PackageEngine.PackageManagerClasses/Packages/Classes/AutoUpdatesMigration.cs:86
- The migration treats any raw
AutoUpdatePackage: trueas active even when that package file hasOverridesNextLevelOpts: false. In that state, the legacy updater ignored the package value and loaded manager defaults (InstallOptionsFactory.cs:83-89), so a stale localtruecan now unexpectedly mark the package and enable scheduled installation. Honor the override flag when importing; a missing flag should remain eligible because the legacy deserializer infers overrides for older non-default files.
return JsonNode.Parse(File.ReadAllText(path)) is JsonObject options
&& options[OptionKey]?.GetValue<bool>() is true;
src/UniGetUI.Avalonia/ViewModels/DialogPages/ManageAutoUpdatesViewModel.cs:114
- The shared resolver falls back to the Microsoft Store icon for several supported managers used here: Bun, Flatpak, Homebrew, Snap, and PowerShell7 are absent from its switch even though their icon assets exist (PowerShell7 can reuse
powershell.svg). As a result, rows for those managers display the wrong manager icon. Add mappings for every supported manager before using the resolver for this list.
ManagerIconResolver.Resolve(package.Manager.Properties.Name.ToLower()),
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 28 out of 28 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
src/UniGetUI.Avalonia/Views/SoftwarePages/SoftwareUpdatesPage.cs:477
- The bulk toolbar path calls
Addonce per selected package, and each call rewrites the complete settings dictionary synchronously. Marking many packages therefore performs N full file writes on the UI thread and can freeze the updates page. Collect the new IDs and use the addedAddRangeAPI once.
foreach (var pkg in packages)
{
string id = AutoUpdatesDatabase.GetIdForPackage(pkg);
if (AutoUpdatesDatabase.IsAutoUpdated(id)) continue;
AutoUpdatesDatabase.Add(id);
marked++;
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 28 out of 28 changed files in this pull request and generated no new comments.
Suppressed comments (2)
Previously missed (2) — in code that hasn't changed since the last review.
src/UniGetUI.Avalonia/ViewModels/DialogPages/ManageAutoUpdatesViewModel.cs:114
- This resolver input does not match several actual manager keys. For example, the .NET manager is named
.NET Tool(UniGetUI.PackageEngine.Managers.Dotnet/DotNet.cs:51-52), so this passes.net tool, whileManagerIconResolveronly recognizesdotnet; Homebrew, Flatpak, Snap, Bun, and PowerShell7 are also unmapped. Those rows therefore show the Microsoft Store fallback icon. Resolve icons from a stable canonical manager identifier and cover the supported managers (with a neutral fallback) instead of reusing this incomplete name map.
ManagerIconResolver.Resolve(package.Manager.Properties.Name.ToLower()),
src/UniGetUI.Avalonia/ViewModels/DialogPages/ManageAutoUpdatesViewModel.cs:294
- “Never” is inaccurate for temporary date-based ignores:
IgnoredUpdatesDatabase.HasUpdatesIgnoredremoves an expired<yyyy-MM-ddentry, and the retained automatic-update mark then becomes active again. Use wording such as “currently ignored, so it cannot be updated automatically right now” so the status matches both temporary and permanent ignores.
StatusTip = isIgnored
? CoreTools.Translate("This package has its updates ignored, so it will never be updated automatically")
There was a problem hiding this comment.
🤖 Pull request was approved automatically: the AI review is complete and all its review threads are resolved. 🎉
Integration Details
{
"deliveryId": "f0116530-a219-11f1-8cce-8c27c4f1c290",
"headSha": "99413b8229d0403ecdbc3bb6854c57aa93c37121",
"reviewer": "copilot-pull-request-reviewer[bot]"
}
This pull request introduces support for marking packages for automatic updates, along with UI and backend changes to manage and reflect this new functionality. It also adds new styles for toggle buttons and improves the handling of package icons. The most important changes are summarized below:
Automatic Updates Feature:
InstallOptionsViewModel.cs,AvaloniaBootstrapper.cs).AutoUpdatePackageproperty from the install options flow, centralizing auto-update state in the new database logic (InstallOptionsViewModel.cs).Localization:
lang_en.json).UI/UX Improvements:
Styles.Common.axaml).Backend and Infrastructure:
AvaloniaBootstrapper.cs).AvaloniaBootstrapper.cs,InstallOptionsViewModel.cs,PackageCollections.cs).Icon Handling:
PackageWrapperto support shared icon loading for packages, respecting user settings (PackageCollections.cs).IPackageIconHostinterface forPackageWrapperto standardize icon handling (PackageCollections.cs).