fix(native-chat): keep a pending hidden model pick listed

This commit is contained in:
Brennan Benson
2026-11-12 02:25:58 -08:00
parent 25f2cb7ada
commit 030a459cd8
2 changed files with 5 additions and 2 deletions
@@ -222,7 +222,7 @@ export function descriptorRowElements(
/>
)
// No search here, so search-only rows stay out; folded ones follow a More models toggle.
const listed = choices.filter((choice) => !choice.hidden)
const listed = choices.filter((choice) => !choice.hidden || choice.value === currentValue)
const more = moreChoices ? listed.filter((choice) => choice.legacy) : []
return [
...listed.filter((choice) => !choice.legacy).map(choiceRow),
@@ -55,7 +55,10 @@ export function NativeChatModelCombobox({
const searching = Boolean(query.trim())
// Membership ignores the selection, so picking a model never moves rows in the open list.
const folded = (choice: SessionOptionSelectChoice) => !searching && Boolean(choice.legacy)
const listed = searching ? choices : choices.filter((choice) => !choice.hidden)
// The current value stays listed even while a pending pick still carries its hidden flag.
const listed = choices.filter(
(choice) => searching || !choice.hidden || choice.value === currentValue
)
const legacyChoices = listed.filter(folded)
const renderChoice = (choice: SessionOptionSelectChoice) => {
const label = nativeChatSessionChoiceLabel(choice, say)