Moving a feature from 0.7.1 into the 0.7.0 release#492
Open
Moving a feature from 0.7.1 into the 0.7.0 release#492
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates list sorting across the VS Code extension to use numeric-aware comparisons, improving the ordering of items whose names/labels include numbers (e.g., “Item 2” before “Item 10”) in tree views and wizard quick-picks.
Changes:
- Switched many
Array.sortcomparators from plainlocaleComparetolocaleCompare(..., { numeric: true })for more natural numeric ordering. - Added numeric-aware sorting for DocumentDB tree nodes (databases, collections, indexes).
- Applied numeric-aware sorting to Azure discovery/service selection prompts and subscription/account/tenant lists.
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/tree/documentdb/IndexesItem.ts | Numeric-aware sort for index names |
| src/tree/documentdb/DatabaseItem.ts | Numeric-aware sort for collection names |
| src/tree/documentdb/ClusterItemBase.ts | Numeric-aware sort for database names |
| src/tree/discovery-view/DiscoveryBranchDataProvider.ts | Numeric-aware sort for discovery root items by id |
| src/tree/connections-view/LocalEmulators/LocalEmulatorsItem.ts | Numeric-aware sorts for emulator folders/connections |
| src/tree/connections-view/FolderItem.ts | Numeric-aware sorts for folders and connections |
| src/tree/connections-view/ConnectionsBranchDataProvider.ts | Numeric-aware sorts for root folders/connections |
| src/plugins/service-azure-vm/discovery-wizard/SelectVMStep.ts | Numeric-aware sort for VM quick-picks |
| src/plugins/service-azure-vm/discovery-tree/AzureSubscriptionItem.ts | Numeric-aware sort for discovered VM items |
| src/plugins/service-azure-vm/discovery-tree/AzureServiceRootItem.ts | Numeric-aware sort for Azure subscriptions |
| src/plugins/service-azure-mongo-vcore/discovery-wizard/SelectClusterStep.ts | Numeric-aware sort for cluster quick-picks |
| src/plugins/service-azure-mongo-vcore/discovery-tree/AzureSubscriptionItem.ts | Numeric-aware sort for discovered accounts |
| src/plugins/service-azure-mongo-vcore/discovery-tree/AzureServiceRootItem.ts | Numeric-aware sort for Azure subscriptions |
| src/plugins/service-azure-mongo-ru/discovery-wizard/SelectRUClusterStep.ts | Numeric-aware sort for cluster quick-picks |
| src/plugins/service-azure-mongo-ru/discovery-tree/AzureMongoRUSubscriptionItem.ts | Numeric-aware sort for discovered accounts |
| src/plugins/service-azure-mongo-ru/discovery-tree/AzureMongoRUServiceRootItem.ts | Numeric-aware sort for Azure subscriptions |
| src/plugins/api-shared/azure/wizard/SelectSubscriptionStep.ts | Numeric-aware sort for subscription selection quick-picks |
| src/plugins/api-shared/azure/subscriptionFiltering/InitializeFilteringStep.ts | Numeric-aware sort for tenant lists |
| src/plugins/api-shared/azure/subscriptionFiltering/FilterSubscriptionSubStep.ts | Numeric-aware sort for subscription filtering quick-picks |
| src/plugins/api-shared/azure/credentialsManagement/SelectAccountStep.ts | Numeric-aware sort for account selection |
| src/plugins/api-shared/azure/credentialsManagement/AccountTenantsStep.ts | Numeric-aware sort for tenant selection |
| src/commands/updateCredentials/PromptTenantStep.ts | Numeric-aware sort for tenant quick-picks |
| src/commands/newConnection/PromptTenantStep.ts | Numeric-aware sort for tenant quick-picks |
| src/commands/newConnection/PromptServiceDiscoveryStep.ts | Numeric-aware sort for service provider quick-picks |
| src/commands/connections-view/moveItems/PromptTargetFolderStep.ts | Numeric-aware sort for folder destination quick-picks |
| src/commands/chooseDataMigrationExtension/chooseDataMigrationExtension.ts | Numeric-aware sort for migration provider quick-picks |
| src/commands/addDiscoveryRegistry/PromptRegistryStep.ts | Numeric-aware sort for discovery registry provider quick-picks |
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.
This pull request updates sorting logic throughout the codebase to improve how lists are ordered, especially when labels or names contain numeric values. By enabling numeric-aware sorting, items like "Item 2" and "Item 10" will now appear in the expected order, enhancing user experience in various selection prompts and tree views.
Sorting improvements in wizard steps and prompts:
localeComparewith the{ numeric: true }option, ensuring numbers in labels are sorted naturally across wizard steps such as registry selection, data migration extension selection, folder selection, service discovery, and subscription filtering. [1] [2] [3] [4] [5] [6] [7] [8] [9]Sorting improvements for tenant and account lists:
Sorting improvements in Azure resource tree views: