summaryrefslogtreecommitdiffhomepage
path: root/packages/desktop/src/pages
diff options
context:
space:
mode:
authorAdam <[email protected]>2025-12-18 09:38:35 -0600
committerAdam <[email protected]>2025-12-18 11:16:33 -0600
commit268f37f8c9813b3805e508d37c20fec6e6e12cb1 (patch)
tree50c24c2763e1a69cceef19f6e675d0bb6e17bca9 /packages/desktop/src/pages
parentb0aaf04957336538dc49d2b0416f44dfbd538531 (diff)
downloadopencode-268f37f8c9813b3805e508d37c20fec6e6e12cb1.tar.gz
opencode-268f37f8c9813b3805e508d37c20fec6e6e12cb1.zip
fix(desktop): prompt history nav, optimistic prompt dup
Diffstat (limited to 'packages/desktop/src/pages')
-rw-r--r--packages/desktop/src/pages/layout.tsx2
-rw-r--r--packages/desktop/src/pages/session.tsx10
2 files changed, 8 insertions, 4 deletions
diff --git a/packages/desktop/src/pages/layout.tsx b/packages/desktop/src/pages/layout.tsx
index 387f2415f..5f4a5d797 100644
--- a/packages/desktop/src/pages/layout.tsx
+++ b/packages/desktop/src/pages/layout.tsx
@@ -358,7 +358,7 @@ export default function Layout(props: ParentProps) {
const opencode = "4b0ea68d7af9a6031a7ffda7ad66e0cb83315750"
return (
- <div class="relative size-5 shrink-0 rounded-sm overflow-hidden">
+ <div class="relative size-5 shrink-0 rounded-sm">
<Avatar
fallback={name()}
src={props.project.id === opencode ? "https://opencode.ai/favicon.svg" : props.project.icon?.url}
diff --git a/packages/desktop/src/pages/session.tsx b/packages/desktop/src/pages/session.tsx
index c9f24518e..c3cc31b5c 100644
--- a/packages/desktop/src/pages/session.tsx
+++ b/packages/desktop/src/pages/session.tsx
@@ -327,11 +327,15 @@ export default function Page() {
])
const handleKeyDown = (event: KeyboardEvent) => {
- if ((document.activeElement as HTMLElement)?.dataset?.component === "terminal") return
+ const activeElement = document.activeElement as HTMLElement | undefined
+ if (activeElement) {
+ const isProtected = activeElement.closest("[data-prevent-autofocus]")
+ const isInput = /^(INPUT|TEXTAREA|SELECT)$/.test(activeElement.tagName) || activeElement.isContentEditable
+ if (isProtected || isInput) return
+ }
if (dialog.active) return
- const focused = document.activeElement === inputRef
- if (focused) {
+ if (activeElement === inputRef) {
if (event.key === "Escape") inputRef?.blur()
return
}