Просмотр исходного кода

tui: simplify popular providers list to show only top 6 instead of applying provider priority sorting

Dax Raad 3 месяцев назад
Родитель
Сommit
ca2b871810

+ 2 - 3
packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx

@@ -1,7 +1,7 @@
 import { createMemo, createSignal } from "solid-js"
 import { useLocal } from "@tui/context/local"
 import { useSync } from "@tui/context/sync"
-import { map, pipe, flatMap, entries, filter, isDeepEqual, sortBy } from "remeda"
+import { map, pipe, flatMap, entries, filter, isDeepEqual, sortBy, take } from "remeda"
 import { DialogSelect, type DialogSelectRef } from "@tui/ui/dialog-select"
 import { useDialog } from "@tui/ui/dialog"
 import { useTheme } from "../context/theme"
@@ -111,8 +111,7 @@ export function DialogModel() {
                 category: "Popular providers",
               }
             }),
-            filter((x) => PROVIDER_PRIORITY[x.value] !== undefined),
-            sortBy((x) => PROVIDER_PRIORITY[x.value] ?? 99),
+            take(6),
           )
         : []),
     ]

+ 0 - 1
packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx

@@ -17,7 +17,6 @@ const PROVIDER_PRIORITY: Record<string, number> = {
   openai: 3,
   google: 4,
   openrouter: 5,
-  vercel: 6,
 }
 
 export function createDialogProviderOptions() {