summaryrefslogtreecommitdiffhomepage
path: root/packages/desktop/src/context/command.tsx
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-12-15 19:33:17 -0500
committerDax Raad <[email protected]>2025-12-15 19:35:18 -0500
commit112c58abf516e4523fb698b868a710c40b271559 (patch)
treeba7f47f02cc5cda42e5ac0d5ae563be3e452ac68 /packages/desktop/src/context/command.tsx
parent0dce5173ccca05aa7bd9eaabab78fe1f5f4d4360 (diff)
downloadopencode-112c58abf516e4523fb698b868a710c40b271559.tar.gz
opencode-112c58abf516e4523fb698b868a710c40b271559.zip
tui: refactor dialog system to use single active dialog instead of stack
Diffstat (limited to 'packages/desktop/src/context/command.tsx')
-rw-r--r--packages/desktop/src/context/command.tsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/desktop/src/context/command.tsx b/packages/desktop/src/context/command.tsx
index d4ef8e166..8fd76ee21 100644
--- a/packages/desktop/src/context/command.tsx
+++ b/packages/desktop/src/context/command.tsx
@@ -128,7 +128,7 @@ function DialogCommand(props: { options: CommandOption[] }) {
groupBy={(x) => x.category ?? ""}
onSelect={(option) => {
if (option) {
- dialog.clear()
+ dialog.close()
option.onSelect?.("palette")
}
}}
@@ -174,8 +174,8 @@ export const { use: useCommand, provider: CommandProvider } = createSimpleContex
const suspended = () => suspendCount() > 0
const showPalette = () => {
- if (dialog.stack.length === 0) {
- dialog.replace(() => <DialogCommand options={options().filter((x) => !x.disabled)} />)
+ if (!dialog.active) {
+ dialog.show(() => <DialogCommand options={options().filter((x) => !x.disabled)} />)
}
}