summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAdam <[email protected]>2025-12-15 04:58:01 -0600
committerAdam <[email protected]>2025-12-15 10:20:16 -0600
commitacd91bddf7e83591d60f6801b7d34685a7f3f256 (patch)
tree673124b4a37e06a63af93d591bde8bb77d4e9a30
parent3a14ca044ca521d1ab24c04da8e9e3bab9e2de58 (diff)
downloadopencode-acd91bddf7e83591d60f6801b7d34685a7f3f256.tar.gz
opencode-acd91bddf7e83591d60f6801b7d34685a7f3f256.zip
wip(desktop): progress
-rw-r--r--packages/desktop/src/pages/session.tsx5
-rw-r--r--packages/ui/src/components/dialog.tsx8
2 files changed, 13 insertions, 0 deletions
diff --git a/packages/desktop/src/pages/session.tsx b/packages/desktop/src/pages/session.tsx
index 48e01239c..caea614c9 100644
--- a/packages/desktop/src/pages/session.tsx
+++ b/packages/desktop/src/pages/session.tsx
@@ -185,6 +185,11 @@ export default function Page() {
return
}
+ // Don't interfere with dialogs
+ if (dialog.stack.length > 0) {
+ return
+ }
+
const focused = document.activeElement === inputRef
if (focused) {
if (event.key === "Escape") {
diff --git a/packages/ui/src/components/dialog.tsx b/packages/ui/src/components/dialog.tsx
index 47d6af42e..40a6ac83d 100644
--- a/packages/ui/src/components/dialog.tsx
+++ b/packages/ui/src/components/dialog.tsx
@@ -20,6 +20,14 @@ export function Dialog(props: DialogProps) {
...(props.classList ?? {}),
[props.class ?? ""]: !!props.class,
}}
+ onOpenAutoFocus={(e) => {
+ const target = e.currentTarget as HTMLElement | null
+ const autofocusEl = target?.querySelector("[autofocus]") as HTMLElement | null
+ if (autofocusEl) {
+ e.preventDefault()
+ autofocusEl.focus()
+ }
+ }}
>
<Show when={props.title || props.action}>
<div data-slot="dialog-header">