fix(tui): exit composer picker with up arrow (#37601)

This commit is contained in:
Aiden Cline
2026-07-17 22:22:00 -05:00
committed by GitHub
parent f2579c41b6
commit 08a7080e11
3 changed files with 12 additions and 6 deletions
@@ -22,6 +22,7 @@ interface Tab {
const ComposerContext = createContext<{
register: (tab: Tab) => () => void
active: (id: string) => boolean
close: () => void
}>()
export function useComposerTab() {
@@ -73,6 +74,7 @@ export function Composer(props: ComposerProps) {
active(id: string) {
return props.open && store.active === id
},
close,
}
const keymap = Keymap.use()
@@ -59,9 +59,11 @@ export function ShellTab(props: { sessionID: string }) {
group: "Composer",
bind: "up",
run() {
const list = entries()
if (list.length === 0) return
setStore("selected", (prev) => (prev - 1 + list.length) % list.length)
if (store.selected === 0) {
composer.close()
return
}
setStore("selected", (prev) => prev - 1)
},
},
{
@@ -160,9 +160,11 @@ export function SubagentsTab(props: { sessionID: string }) {
group: "Composer",
bind: "up",
run() {
const list = entries()
if (list.length === 0) return
moveTo((store.selected - 1 + list.length) % list.length, true)
if (store.selected === 0) {
composer.close()
return
}
moveTo(store.selected - 1, true)
},
},
{