mirror of
https://github.com/anomalyco/opencode.git
synced 2026-02-01 22:48:16 +00:00
Apply PR #11476: feat(tui): space to toggle answers in multi-select and enter for submit in questions tool
This commit is contained in:
@@ -237,11 +237,22 @@ export function QuestionPrompt(props: { request: QuestionRequest }) {
|
||||
moveTo((store.selected + 1) % total)
|
||||
}
|
||||
|
||||
if (evt.name === "return") {
|
||||
if (evt.name === "space" && multi()) {
|
||||
evt.preventDefault()
|
||||
selectOption()
|
||||
}
|
||||
|
||||
if (evt.name === "return") {
|
||||
evt.preventDefault()
|
||||
if (multi()) {
|
||||
setStore("tab", store.tab + 1)
|
||||
setStore("selected", 0)
|
||||
return
|
||||
}
|
||||
selectOption()
|
||||
return
|
||||
}
|
||||
|
||||
if (evt.name === "escape" || keybind.match("app_exit", evt)) {
|
||||
evt.preventDefault()
|
||||
reject()
|
||||
@@ -436,10 +447,15 @@ export function QuestionPrompt(props: { request: QuestionRequest }) {
|
||||
{"↑↓"} <span style={{ fg: theme.textMuted }}>select</span>
|
||||
</text>
|
||||
</Show>
|
||||
<Show when={multi() && !confirm()}>
|
||||
<text fg={theme.text}>
|
||||
space <span style={{ fg: theme.textMuted }}>toggle</span>
|
||||
</text>
|
||||
</Show>
|
||||
<text fg={theme.text}>
|
||||
enter{" "}
|
||||
<span style={{ fg: theme.textMuted }}>
|
||||
{confirm() ? "submit" : multi() ? "toggle" : single() ? "submit" : "confirm"}
|
||||
{confirm() || single() ? "submit" : "confirm"}
|
||||
</span>
|
||||
</text>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user