mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-20 18:57:17 +03:00
fix(tui): allow favoriting models without a connected integration (#62244)
This commit is contained in:
@@ -144,8 +144,7 @@ function DialogConnectedModels(props: {
|
||||
.map((model) => {
|
||||
const provider = providers().get(model.providerID)
|
||||
const value = { providerID: model.providerID, modelID: model.id }
|
||||
// Users with nothing connected can only favorite models in the free picker (new designs); this picker keeps them unavailable.
|
||||
const favorite = connected() && isFavorite(value)
|
||||
const favorite = isFavorite(value)
|
||||
return {
|
||||
value,
|
||||
providerID: model.providerID,
|
||||
@@ -193,6 +192,8 @@ function DialogConnectedModels(props: {
|
||||
return results.map((option) => ({ ...option, description: option.providerName, category: undefined }))
|
||||
}
|
||||
|
||||
if (!connected()) return prioritizeFavorites(modelOptions, favoritePriority)
|
||||
|
||||
return [
|
||||
...favoriteOptions,
|
||||
...recentOptions,
|
||||
@@ -237,7 +238,6 @@ function DialogConnectedModels(props: {
|
||||
{
|
||||
command: "model.dialog.favorite",
|
||||
title: newDesigns() ? (option) => (isFavorite(option?.value) ? "unfavorite" : "favorite") : "Favorite",
|
||||
hidden: !connected(),
|
||||
onTrigger: (option) => {
|
||||
local.model.toggleFavorite(option.value as { providerID: string; modelID: string })
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user