Skip to content

Allow automatic updates to be limited to selected packages - #5327

Merged
Gabriel Dufresne (GabrielDuf) merged 5 commits into
mainfrom
feature/auto-update-selected-packages
Aug 27, 2026
Merged

Allow automatic updates to be limited to selected packages#5327
Gabriel Dufresne (GabrielDuf) merged 5 commits into
mainfrom
feature/auto-update-selected-packages

Conversation

@GabrielDuf

Copy link
Copy Markdown
Contributor

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:

  • Added new automatic update management functionality, including logic to mark/unmark packages for automatic updates, update the database accordingly, and display context-sensitive hints in the UI (InstallOptionsViewModel.cs, AvaloniaBootstrapper.cs).
  • Removed the obsolete AutoUpdatePackage property from the install options flow, centralizing auto-update state in the new database logic (InstallOptionsViewModel.cs).

Localization:

  • Added and updated English strings related to automatic updates, package marking, and scheduled maintenance for improved user guidance (lang_en.json).

UI/UX Improvements:

  • Introduced new accent-style toggle button styles for filter chips, improving visual clarity for on/off states in the UI (Styles.Common.axaml).

Backend and Infrastructure:

  • Ensured the automatic updates migration runs during package engine initialization, preparing the system for the new feature (AvaloniaBootstrapper.cs).
  • Added missing using directives to support new functionality and maintain code consistency (AvaloniaBootstrapper.cs, InstallOptionsViewModel.cs, PackageCollections.cs).

Icon Handling:

  • Added a static method to PackageWrapper to support shared icon loading for packages, respecting user settings (PackageCollections.cs).
  • Implemented the IPackageIconHost interface for PackageWrapper to standardize icon handling (PackageCollections.cs).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/UniGetUI.Avalonia/Views/DialogPages/InstallOptionsControl.axaml Outdated
Comment thread src/UniGetUI.Avalonia/ViewModels/DialogPages/ManageAutoUpdatesViewModel.cs Outdated
Comment thread src/UniGetUI.Avalonia/ViewModels/DialogPages/InstallOptionsViewModel.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 28 out of 28 changed files in this pull request and generated 3 comments.

Comment thread src/UniGetUI.Avalonia/ViewModels/DialogPages/ManageAutoUpdatesViewModel.cs Outdated
Comment thread src/UniGetUI.PackageEngine.Tests/AutoUpdatesDatabaseTests.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: true as active even when that package file has OverridesNextLevelOpts: false. In that state, the legacy updater ignored the package value and loaded manager defaults (InstallOptionsFactory.cs:83-89), so a stale local true can 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()),

Comment thread src/UniGetUI.Avalonia/ViewModels/DialogPages/ManageAutoUpdatesViewModel.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Add once 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 added AddRange API once.
        foreach (var pkg in packages)
        {
            string id = AutoUpdatesDatabase.GetIdForPackage(pkg);
            if (AutoUpdatesDatabase.IsAutoUpdated(id)) continue;
            AutoUpdatesDatabase.Add(id);
            marked++;

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, while ManagerIconResolver only recognizes dotnet; 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.HasUpdatesIgnored removes an expired <yyyy-MM-dd entry, 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")

@randy-but-a-ro randy-but-a-ro Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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]"
}

@GabrielDuf
Gabriel Dufresne (GabrielDuf) merged commit fda3a13 into main Aug 27, 2026
7 checks passed
@GabrielDuf
Gabriel Dufresne (GabrielDuf) deleted the feature/auto-update-selected-packages branch August 27, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE REQUEST] activate "Auto Update" on specific packages only

2 participants