Skip to content

Add alphabetical sorting to TreeView items#129

Merged
cricketthomas merged 1 commit intov1.0.315from
copilot/fix-128
Jul 5, 2025
Merged

Add alphabetical sorting to TreeView items#129
cricketthomas merged 1 commit intov1.0.315from
copilot/fix-128

Conversation

Copy link
Contributor

Copilot AI commented Jun 27, 2025

This PR implements alphabetical sorting for all TreeView items across the three-level hierarchy in the Azure Key Vault Explorer.

Changes Made

📁 New SortService Utility

Created a new SortService class that provides sorting methods for all TreeView collection types:

  • Subscriptions: Sorted alphabetically with "Quick Access" always at the top
  • Resource Groups: Sorted alphabetically by display name
  • Key Vaults: Sorted alphabetically by vault name

🔍 Enhanced Filtering

Updated FilterService to maintain alphabetical order in search results, ensuring filtered items are always displayed in sorted order.

🌳 TreeView Integration

Applied sorting at all key data loading points:

  • Initial subscription loading in GetAvailableKeyVaults()
  • Resource group expansion in KvSubscriptionModel_PropertyChanged()
  • Key vault expansion in KvResourceGroupNode_PropertyChanged()
  • Quick Access item management (PinVaultToQuickAccess())

Technical Details

The implementation ensures:

  • Performance: Sorting only occurs when collections are modified
  • Null Safety: Graceful handling of null/empty display names
  • Special Cases: "Quick Access" subscription always appears first
  • Search Compatibility: Filtered results maintain alphabetical order
  • Minimal Impact: No breaking changes to existing functionality

Before/After

Before: TreeView items appeared in the order they were loaded from Azure
After: All items are sorted alphabetically at every level, improving navigation and user experience

The sorting is applied consistently across:

  1. Level 1: Subscriptions (by SubscriptionDisplayName)
  2. Level 2: Resource Groups (by ResourceGroupDisplayName)
  3. Level 3: Key Vaults (by Data.Name)

Fixes #128.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • av-build-tel-api-v1.avaloniaui.net
    • Triggering command: dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/avalonia.buildservices/0.0.31/tools/netstandard2.0/runtimeconfig.json /home/REDACTED/.nuget/packages/avalonia.buildservices/0.0.31/tools/netstandard2.0/Avalonia.BuildServices.Collector.dll (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add alphabetical sorting to TreeView items Add alphabetical sorting to TreeView items Jun 27, 2025
Copilot AI requested a review from cricketthomas June 27, 2025 22:59
@cricketthomas cricketthomas changed the base branch from master to v1.0.315 July 5, 2025 13:16
@cricketthomas cricketthomas marked this pull request as ready for review July 5, 2025 13:16
@cricketthomas cricketthomas merged commit 21995a7 into v1.0.315 Jul 5, 2025
1 of 2 checks passed
@cricketthomas cricketthomas deleted the copilot/fix-128 branch November 16, 2025 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add alphabetical sorting to TreeView items

2 participants