mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
show textarea placeholder only on home
This commit is contained in:
parent
b27f85ba90
commit
e6d2149d41
2 changed files with 7 additions and 3 deletions
|
|
@ -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}
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue