show textarea placeholder only on home
Some checks are pending
format / format (push) Waiting to run
snapshot / publish (push) Waiting to run
test / test (push) Waiting to run

This commit is contained in:
Sebastian Herrlinger 2025-10-28 13:04:29 +01:00
parent b27f85ba90
commit e6d2149d41
2 changed files with 7 additions and 3 deletions

View file

@ -4,7 +4,6 @@ import {
TextareaRenderable,
MouseEvent,
KeyEvent,
SyntaxStyle,
PasteEvent,
t,
dim,
@ -33,6 +32,7 @@ export type PromptProps = {
onSubmit?: () => void
ref?: (ref: PromptRef) => void
hint?: JSX.Element
showPlaceholder?: boolean
}
export type PromptRef = {
@ -382,7 +382,11 @@ export function Prompt(props: PromptProps) {
</box>
<box paddingTop={1} paddingBottom={1} backgroundColor={Theme.backgroundElement} flexGrow={1}>
<textarea
placeholder={t`${dim(fg(Theme.primary)(" → meta+↑↓"))} ${dim(fg("#64748b")("history"))} ${dim(fg("#a78bfa")("•"))} ${dim(fg(Theme.primary)("meta+return"))} ${dim(fg("#64748b")("newline"))} ${dim(fg("#a78bfa")("•"))} ${dim(fg(Theme.primary)("return"))} ${dim(fg("#64748b")("submit"))}`}
placeholder={
props.showPlaceholder
? t`${dim(fg(Theme.primary)(" → meta+↑↓"))} ${dim(fg("#64748b")("history"))} ${dim(fg("#a78bfa")("•"))} ${dim(fg(Theme.primary)("meta+return"))} ${dim(fg("#64748b")("newline"))} ${dim(fg("#a78bfa")("•"))} ${dim(fg(Theme.primary)("return"))} ${dim(fg("#64748b")("submit"))}`
: undefined
}
textColor={Theme.text}
focusedTextColor={Theme.text}
minHeight={1}

View file

@ -42,7 +42,7 @@ export function Home() {
<HelpRow keybind="agent_cycle">Switch agent</HelpRow>
</box>
<box width="100%" maxWidth={75} zIndex={1000} paddingTop={1}>
<Prompt hint={Hint} />
<Prompt hint={Hint} showPlaceholder={true} />
</box>
</box>
)