ref(project-creation): Sort SCM providers and integrations by display order#118589
Open
jaydgoss wants to merge 2 commits into
Open
ref(project-creation): Sort SCM providers and integrations by display order#118589jaydgoss wants to merge 2 commits into
jaydgoss wants to merge 2 commits into
Conversation
… order Add a shared sortByScmProviderOrder helper (primary keys github, gitlab, bitbucket first, then the rest in original order) plus partitionScmProviders for ScmProviderPills. useScmProviders returns both scmProviders and activeIntegrations in that order, so activeIntegrationExisting (the first active integration) prioritizes a primary provider. ScmProviderPills uses the shared partition.
07f00c7 to
a10c61b
Compare
…vider Verify the provider sort is stable: two GitHub integrations with different ids and names keep their input order, so activeIntegrationExisting stays the first one.
evanpurkhiser
approved these changes
Jun 26, 2026
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.
TLDR
Order both the providers and the active integrations returned by
useScmProvidersthe same wayScmProviderPillsdisplays them (primary providers first, then the rest), so consumers list them consistently andactiveIntegrationExistingprioritizes a primary provider.Details
scmProviderOrder.ts: asortByScmProviderOrderhelper that stable-sorts by provider key (the primary keysgithub,gitlab,bitbucketfirst in that order, then the rest in their original order), pluspartitionScmProvidersforScmProviderPills' pills vs. "More" dropdown split.ScmProviderPillsusespartitionScmProvidersinstead of its own inline split.useScmProvidersreturns bothscmProvidersandactiveIntegrationsin that order. SinceactiveIntegrationExistingis the first active integration, it now prioritizes a primary provider too.