pull/6319/head
Dax Raad 2025-12-29 13:57:31 -05:00
parent 421d89b96d
commit 32c3fcbe61
2 changed files with 19 additions and 20 deletions

View File

@ -33,6 +33,7 @@ import { useKV } from "../../context/kv"
export type PromptProps = {
sessionID?: string
visible?: boolean
disabled?: boolean
onSubmit?: () => void
ref?: (ref: PromptRef) => void
@ -373,7 +374,8 @@ export function Prompt(props: PromptProps) {
})
createEffect(() => {
input.focus()
if (props.visible !== false) input?.focus()
if (props.visible === false) input?.blur()
})
onMount(() => {
@ -798,7 +800,7 @@ export function Prompt(props: PromptProps) {
agentStyleId={agentStyleId}
promptPartTypeId={() => promptPartTypeId}
/>
<box ref={(r) => (anchor = r)}>
<box ref={(r) => (anchor = r)} visible={props.visible !== false}>
<box
border={["left"]}
borderColor={highlight()}

View File

@ -1108,24 +1108,21 @@ export function Session() {
</For>
</scrollbox>
<box flexShrink={0}>
<Switch>
<Match when={permissions().length > 0}>
<PermissionPrompt request={permissions()[0]} />
</Match>
<Match when={!session()?.parentID}>
<Prompt
ref={(r) => {
prompt = r
promptRef.set(r)
}}
disabled={permissions().length > 0}
onSubmit={() => {
toBottom()
}}
sessionID={route.sessionID}
/>
</Match>
</Switch>
<Show when={permissions().length > 0}>
<PermissionPrompt request={permissions()[0]} />
</Show>
<Prompt
visible={!session().parentID && permissions().length === 0}
ref={(r) => {
prompt = r
promptRef.set(r)
}}
disabled={permissions().length > 0}
onSubmit={() => {
toBottom()
}}
sessionID={route.sessionID}
/>
</box>
<Show when={!sidebarVisible()}>
<Footer />