Repository navigation
Disable toolbar buttons that would do nothing - #5614
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the selection-aware package toolbar changes.
No open issues 🎉
What changed in this PR
This PR makes UniGetUI’s package-page toolbars reflect the current selection, disabling actions when they have no package to act on.
Changes:
- Adds shared selection predicates with coalesced dispatcher refreshes.
- Applies selection requirements across Discover, Installed, Updates, Bundles, and Catalog Editor, preserving catalog editability checks.
- Adds a headless Catalog Editor test covering zero, one, and two checked packages.
| File | Description |
|---|---|
src/UniGetUI.Tests/ToolbarSelectionStateTests.cs |
Tests toolbar enabled states as checked selections change. |
src/UniGetUI.Avalonia/Views/SoftwarePages/SoftwareUpdatesPage.cs |
Gates update, options, manual update, details, and ignore actions. |
src/UniGetUI.Avalonia/Views/SoftwarePages/PackageBundlesPage.cs |
Gates installation, removal, and package details actions. |
src/UniGetUI.Avalonia/Views/SoftwarePages/InstalledPackagesPage.cs |
Gates uninstall, single-package, ignore, and bundle-export actions. |
src/UniGetUI.Avalonia/Views/SoftwarePages/DiscoverSoftwarePage.cs |
Gates installation, single-package, and bundle-export actions. |
src/UniGetUI.Avalonia/Views/SoftwarePages/CatalogEditorPage.cs |
Combines selection requirements with catalog editability checks. |
src/UniGetUI.Avalonia/Views/SoftwarePages/AbstractPackagesPage.axaml.cs |
Adds reusable selection gates and coalesced toolbar refreshes. |
Review effort: Balanced
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": "4a780cf0-d234-11f1-9782-6371075ae569",
"headSha": "96aecde20ac361078021658b4328a71922f838b6",
"reviewer": "copilot-pull-request-reviewer[bot]"
}
Gabriel Dufresne (GabrielDuf)
deleted the
disable-idle-toolbar-buttons
branch
October 27, 2026 18:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several buttons in the package pages' toolbar were always enabled, even when clicking them could do nothing. For example, Package details with no package selected, or with several checked. They are now disabled until they have something to act on.
Needs exactly one package (the focused row, or else the only checked package — the same rule the buttons already used when clicked):
Needs at least one checked package:
The Catalog Editor buttons also still require an editable, selected catalog.
Left unchanged: Reload, Export to CSV (it reports "nothing to export" itself), Manage ignored updates, and the bundle file actions.
Implementation
AbstractPackagesPagegainsEnableWhen(control, predicate). The predicates are rechecked onFilteredPackages.SelectionStateChangedandPackageList.SelectionChanged.GenerateToolBaris called from the base constructor.IsEnabled, so overflowed items follow along.Known gap: on the Bundles page, the main Install button is enabled whenever something is checked, even if every checked package is already installed and would be skipped.
Testing
ToolbarSelectionStateTestsdrives the Catalog Editor toolbar through zero, one and two checked packages.UniGetUI.Teststargets Windows, so locally it ran from a temporary net10.0 project that compiles the same file; CI is the first real run of the test project.dotnet format whitespaceanddotnet format stylechecks pass.