summaryrefslogtreecommitdiffhomepage
path: root/packages
diff options
context:
space:
mode:
authorRahul Mishra <[email protected]>2026-01-18 00:38:11 +0530
committerGitHub <[email protected]>2026-01-17 13:08:11 -0600
commit5a199b04cbbc8a582d8130d4d8e37e052094cc50 (patch)
tree177fd8b2ce9a29239d17d5aef837f78b303b51b6 /packages
parenteb968a6651e2af4b806ca8b466a82b11b04c56a4 (diff)
downloadopencode-5a199b04cbbc8a582d8130d4d8e37e052094cc50.tar.gz
opencode-5a199b04cbbc8a582d8130d4d8e37e052094cc50.zip
fix: don't try to open command palette if a dialog is already open (#9116)
Diffstat (limited to 'packages')
-rw-r--r--packages/app/src/context/command.tsx4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/app/src/context/command.tsx b/packages/app/src/context/command.tsx
index a93ffc024..d8dc13e23 100644
--- a/packages/app/src/context/command.tsx
+++ b/packages/app/src/context/command.tsx
@@ -1,5 +1,6 @@
import { createMemo, createSignal, onCleanup, onMount, type Accessor } from "solid-js"
import { createSimpleContext } from "@opencode-ai/ui/context"
+import { useDialog } from "@opencode-ai/ui/context/dialog"
const IS_MAC = typeof navigator === "object" && /(Mac|iPod|iPhone|iPad)/.test(navigator.platform)
@@ -122,6 +123,7 @@ export function formatKeybind(config: string): string {
export const { use: useCommand, provider: CommandProvider } = createSimpleContext({
name: "Command",
init: () => {
+ const dialog = useDialog()
const [registrations, setRegistrations] = createSignal<Accessor<CommandOption[]>[]>([])
const [suspendCount, setSuspendCount] = createSignal(0)
@@ -165,7 +167,7 @@ export const { use: useCommand, provider: CommandProvider } = createSimpleContex
}
const handleKeyDown = (event: KeyboardEvent) => {
- if (suspended()) return
+ if (suspended() || dialog.active) return
const paletteKeybinds = parseKeybind("mod+shift+p")
if (matchKeybind(paletteKeybinds, event)) {