From 50a1add183660dccc2149dc00dab796b380a80c1 Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" <219766164+opencode-agent[bot]@users.noreply.github.com> Date: Mon, 13 Jul 2026 10:20:15 -0400 Subject: [PATCH] fix(tui): open model selector at top (#36679) Co-authored-by: Dax Raad Co-authored-by: opencode-agent[bot] --- packages/tui/src/component/dialog-model.tsx | 1 + packages/tui/src/ui/dialog-select.tsx | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/tui/src/component/dialog-model.tsx b/packages/tui/src/component/dialog-model.tsx index fcbc472965..892f709147 100644 --- a/packages/tui/src/component/dialog-model.tsx +++ b/packages/tui/src/component/dialog-model.tsx @@ -154,6 +154,7 @@ export function DialogModel(props: { providerID?: string }) { skipFilter={true} title={title()} current={local.model.current()} + focusCurrent={false} /> ) } diff --git a/packages/tui/src/ui/dialog-select.tsx b/packages/tui/src/ui/dialog-select.tsx index 7fe1555d96..41f1969361 100644 --- a/packages/tui/src/ui/dialog-select.tsx +++ b/packages/tui/src/ui/dialog-select.tsx @@ -51,6 +51,7 @@ export interface DialogSelectProps { }[] bindings?: readonly Binding[] current?: T + focusCurrent?: boolean } export interface DialogSelectOption { @@ -104,6 +105,7 @@ export function DialogSelect(props: DialogSelectProps) { on( () => props.current, (current) => { + if (props.focusCurrent === false) return if (current) { const currentIndex = flat().findIndex((opt) => isDeepEqual(opt.value, current)) if (currentIndex >= 0) { @@ -229,7 +231,7 @@ export function DialogSelect(props: DialogSelectProps) { return } if (!selection) { - if (props.current !== undefined) { + if (props.focusCurrent !== false && props.current !== undefined) { const index = flat().findIndex((option) => isDeepEqual(option.value, props.current)) if (index >= 0) { setStore("selected", index) @@ -279,7 +281,7 @@ export function DialogSelect(props: DialogSelectProps) { setTimeout(() => { if (filter.length > 0) { moveTo(0, true, false) - } else if (current) { + } else if (current && props.focusCurrent !== false) { const currentIndex = flat().findIndex((opt) => isDeepEqual(opt.value, current)) if (currentIndex >= 0) { moveTo(currentIndex, true)