Skip to content

Track support of minimum age in managers#4808

Open
Sébastien Duquette (sduquette-devolutions) wants to merge 1 commit into
mainfrom
supports-minimum-age
Open

Track support of minimum age in managers#4808
Sébastien Duquette (sduquette-devolutions) wants to merge 1 commit into
mainfrom
supports-minimum-age

Conversation

@sduquette-devolutions
Copy link
Copy Markdown
Contributor

We define SupportsMinimumAge in the manager classes and use this value to display which package managers support this setting.

image

We now use the value of SupportsMinimumAge to display which package managers support this setting.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a SupportsMinimumAge capability on package managers and updates both WinUI and Avalonia settings UIs to use that capability when enabling/showing “minimum update age” support (based on availability of package release/update dates).

Changes:

  • Added SupportsMinimumAge to ManagerCapabilities.
  • Updated WinUI + Avalonia settings pages to use manager.Capabilities.SupportsMinimumAge instead of hardcoded manager-name lists.
  • Marked Pip/Npm/Cargo/Bun as supporting minimum update age; updated .gitignore to ignore winget-cli_x64/.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/UniGetUI/Pages/SettingsPages/ManagersPages/PackageManager.xaml.cs Uses Capabilities.SupportsMinimumAge to enable/disable per-manager minimum update age UI.
src/UniGetUI/Pages/SettingsPages/GeneralPages/Updates.xaml.cs Uses Capabilities.SupportsMinimumAge for the release-date compatibility table.
src/UniGetUI.PackageEngine.Managers.Pip/Pip.cs Sets SupportsMinimumAge = true for Pip.
src/UniGetUI.PackageEngine.Managers.Npm/Npm.cs Sets SupportsMinimumAge = true for Npm.
src/UniGetUI.PackageEngine.Managers.Cargo/Cargo.cs Sets SupportsMinimumAge = true for Cargo.
src/UniGetUI.PackageEngine.Managers.Bun/Bun.cs Sets SupportsMinimumAge = true for Bun.
src/UniGetUI.PackageEngine.Enums/ManagerCapabilities.cs Adds the new SupportsMinimumAge capability flag.
src/UniGetUI.Avalonia/Views/Pages/SettingsPages/PackageManagerPage.axaml.cs Uses Capabilities.SupportsMinimumAge to enable/disable per-manager minimum update age UI (Avalonia).
src/UniGetUI.Avalonia/ViewModels/Pages/SettingsPages/UpdatesViewModel.cs Uses Capabilities.SupportsMinimumAge for the compatibility table (Avalonia).
.gitignore Removes old choco-cli ignore entries; adds winget-cli_x64/.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 35 to 41
public bool SupportsCustomSources = false;
public bool SupportsCustomPackageIcons = false;
public bool SupportsCustomPackageScreenshots = false;
public bool SupportsMinimumAge = false;
public ProxySupport SupportsProxy = ProxySupport.No;
public bool SupportsProxyAuth = false;
public SourceCapabilities Sources { get; set; }
Comment on lines 127 to 132
int row = i + 1;
var name = new TextBlock { Text = manager.DisplayName, VerticalAlignment = VerticalAlignment.Center };
Grid.SetRow(name, row); Grid.SetColumn(name, 0);
bool supported = !_managersWithoutUpdateDate.Contains(manager.Name);
bool supported = manager.Capabilities.SupportsMinimumAge;
var badge = MakeStatusBadge(supported ? yesStr : noStr, supported);
Grid.SetRow(badge, row); Grid.SetColumn(badge, 1);
Comment on lines 491 to 495

bool initiallyCustomAge = savedAgeVal == "custom";
bool ageSupported = !_managersWithoutUpdateDate.Contains(Manager.Name);
bool ageSupported = Manager.Capabilities.SupportsMinimumAge;

object ageCardDescription = !ageSupported
Comment on lines 85 to 90
var name = new TextBlock { Text = manager.DisplayName, VerticalAlignment = VerticalAlignment.Center };
Grid.SetRow(name, row); Grid.SetColumn(name, 0);

bool supported = !_managersWithoutUpdateDate.Contains(manager.Name);
bool supported = manager.Capabilities.SupportsMinimumAge;
var badge = _statusBadge(supported ? yesStr : noStr, supported ? Colors.Green : Colors.Red);
Grid.SetRow(badge, row); Grid.SetColumn(badge, 1);
Comment on lines 257 to 261
};

bool initiallyCustom = savedAge == "custom";
bool ageSupported = !_managersWithoutUpdateDate.Contains(manager.Name);
bool ageSupported = manager.Capabilities.SupportsMinimumAge;
object ageDescription = !ageSupported
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.

2 participants