This commit is contained in:
Dax Raad 2025-12-29 13:57:31 -05:00
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 = { export type PromptProps = {
sessionID?: string sessionID?: string
visible?: boolean
disabled?: boolean disabled?: boolean
onSubmit?: () => void onSubmit?: () => void
ref?: (ref: PromptRef) => void ref?: (ref: PromptRef) => void
@ -373,7 +374,8 @@ export function Prompt(props: PromptProps) {
}) })
createEffect(() => { createEffect(() => {
input.focus() if (props.visible !== false) input?.focus()
if (props.visible === false) input?.blur()
}) })
onMount(() => { onMount(() => {
@ -798,7 +800,7 @@ export function Prompt(props: PromptProps) {
agentStyleId={agentStyleId} agentStyleId={agentStyleId}
promptPartTypeId={() => promptPartTypeId} promptPartTypeId={() => promptPartTypeId}
/> />
<box ref={(r) => (anchor = r)}> <box ref={(r) => (anchor = r)} visible={props.visible !== false}>
<box <box
border={["left"]} border={["left"]}
borderColor={highlight()} borderColor={highlight()}

View file

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