mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
tui: fix provider sorting to prioritize recommended options
This commit is contained in:
parent
95b667d21e
commit
9ecaf618db
1 changed files with 2 additions and 1 deletions
|
|
@ -26,6 +26,7 @@ export function createDialogProviderOptions() {
|
|||
const options = createMemo(() => {
|
||||
return pipe(
|
||||
sync.data.provider_next.all,
|
||||
sortBy((x) => PROVIDER_PRIORITY[x.id] ?? 99),
|
||||
map((provider) => ({
|
||||
title: provider.name,
|
||||
value: provider.id,
|
||||
|
|
@ -33,6 +34,7 @@ export function createDialogProviderOptions() {
|
|||
opencode: "Recommended",
|
||||
anthropic: "Claude Max or API key",
|
||||
}[provider.id],
|
||||
category: provider.id in PROVIDER_PRIORITY ? "Popular" : "Other",
|
||||
async onSelect() {
|
||||
const methods = sync.data.provider_auth[provider.id] ?? [
|
||||
{
|
||||
|
|
@ -85,7 +87,6 @@ export function createDialogProviderOptions() {
|
|||
}
|
||||
},
|
||||
})),
|
||||
sortBy((x) => PROVIDER_PRIORITY[x.value] ?? 99),
|
||||
)
|
||||
})
|
||||
return options
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue