tui: position prompt at bottom when resuming from handoff with initial prompt

pull/12755/head
Dax Raad 2026-02-08 18:44:45 -05:00
parent f689fc7f75
commit 246430cb8f
1 changed files with 24 additions and 11 deletions

View File

@ -77,11 +77,11 @@ export function Home() {
let prompt: PromptRef
const args = useArgs()
onMount(() => {
if (once) return
if (route.initialPrompt) {
prompt.set(route.initialPrompt)
once = true
} else if (args.prompt) {
return
}
if (!once && args.prompt) {
prompt.set({ input: args.prompt, parts: [] })
once = true
prompt.submit()
@ -96,7 +96,26 @@ export function Home() {
<box flexGrow={1} justifyContent="center" alignItems="center" paddingLeft={2} paddingRight={2} gap={1}>
<box height={3} />
<Logo />
<box width="100%" maxWidth={75} zIndex={1000} paddingTop={1}>
<Show when={!route.initialPrompt}>
<box width="100%" maxWidth={75} zIndex={1000} paddingTop={1}>
<Prompt
ref={(r) => {
prompt = r
promptRef.set(r)
}}
hint={Hint}
/>
</box>
</Show>
<box height={3} width="100%" maxWidth={75} alignItems="center" paddingTop={2}>
<Show when={showTips()}>
<Tips />
</Show>
</box>
<Toast />
</box>
<Show when={route.initialPrompt}>
<box paddingLeft={2} paddingRight={2}>
<Prompt
ref={(r) => {
prompt = r
@ -105,13 +124,7 @@ export function Home() {
hint={Hint}
/>
</box>
<box height={3} width="100%" maxWidth={75} alignItems="center" paddingTop={2}>
<Show when={showTips()}>
<Tips />
</Show>
</box>
<Toast />
</box>
</Show>
<box paddingTop={1} paddingBottom={1} paddingLeft={2} paddingRight={2} flexDirection="row" flexShrink={0} gap={2}>
<text fg={theme.textMuted}>{directory()}</text>
<box gap={1} flexDirection="row" flexShrink={0}>