The open source coding agent.
TypeScript
fix(desktop): focus prompt input after dialog close
Adam99680baf83cd
diff --git a/packages/desktop/src/components/prompt-input.tsx b/packages/desktop/src/components/prompt-input.tsxindex a04211a9804..b152ff0f522 100644--- a/packages/desktop/src/components/prompt-input.tsx+++ b/packages/desktop/src/components/prompt-input.tsx@@ -850,6 +850,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {</Show><div class="relative max-h-[240px] overflow-y-auto"><div+ data-component="prompt-input"ref={(el) => {editorRef = elprops.ref?.(el)diff --git a/packages/ui/src/components/session-turn.tsx b/packages/ui/src/components/session-turn.tsxindex 14e4055ca41..cab6a7af3c2 100644--- a/packages/ui/src/components/session-turn.tsx+++ b/packages/ui/src/components/session-turn.tsx@@ -108,8 +108,7 @@ export function SessionTurn(createResizeObserver(() => state.contentRef,- ({ height }) => {- console.log(height)+ () => {scrollToBottom()},)diff --git a/packages/ui/src/context/dialog.tsx b/packages/ui/src/context/dialog.tsxindex 71fc6380628..56be9ee4789 100644--- a/packages/ui/src/context/dialog.tsx+++ b/packages/ui/src/context/dialog.tsx@@ -33,6 +33,10 @@ function init() {},close() {active()?.onClose?.()+ if (!active()?.onClose) {+ const promptInput = document.querySelector("[data-component=prompt-input]") as HTMLElement+ promptInput?.focus()+ }setActive(undefined)},show(element: DialogElement, owner: Owner, onClose?: () => void) {@@ -48,7 +52,6 @@ function init() {open={true}onOpenChange={(open) => {if (!open) {- console.log("closing")result.close()}}}