Sort providers in alphabetical vs random (#5090)
This commit is contained in:
@@ -420,7 +420,10 @@ pub async fn configure_provider_dialog() -> Result<bool, Box<dyn Error>> {
|
||||
let config = Config::global();
|
||||
|
||||
// Get all available providers and their metadata
|
||||
let available_providers = providers().await;
|
||||
let mut available_providers = providers().await;
|
||||
|
||||
// Sort providers alphabetically by display name
|
||||
available_providers.sort_by(|a, b| a.display_name.cmp(&b.display_name));
|
||||
|
||||
// Create selection items from provider metadata
|
||||
let provider_items: Vec<(&String, &str, &str)> = available_providers
|
||||
|
||||
@@ -153,7 +153,9 @@ const ProviderCards = memo(function ProviderCards({
|
||||
const providerCards = useMemo(() => {
|
||||
// providers needs to be an array
|
||||
const providersArray = Array.isArray(providers) ? providers : [];
|
||||
const cards = providersArray.map((provider) => (
|
||||
// Sort providers alphabetically by name
|
||||
const sortedProviders = [...providersArray].sort((a, b) => a.name.localeCompare(b.name));
|
||||
const cards = sortedProviders.map((provider) => (
|
||||
<ProviderCard
|
||||
key={provider.name}
|
||||
provider={provider}
|
||||
|
||||
Reference in New Issue
Block a user