|
|
@@ -1314,13 +1314,20 @@ export function Prompt(props: PromptProps) {
|
|
|
|
|
|
const placeholderText = createMemo(() => {
|
|
|
if (props.showPlaceholder === false) return undefined
|
|
|
- if (store.mode === "shell") {
|
|
|
- if (!shell().length) return undefined
|
|
|
- const example = shell()[store.placeholder % shell().length]
|
|
|
- return `Run a command... "${example}"`
|
|
|
- }
|
|
|
- if (!list().length) return undefined
|
|
|
- return `Ask anything... "${list()[store.placeholder % list().length]}"`
|
|
|
+ const value = (() => {
|
|
|
+ if (store.mode === "shell") {
|
|
|
+ if (!shell().length) return undefined
|
|
|
+ return `Run a command... "${shell()[store.placeholder % shell().length]}"`
|
|
|
+ }
|
|
|
+ if (!list().length) return undefined
|
|
|
+ return `Ask anything... "${list()[store.placeholder % list().length]}"`
|
|
|
+ })()
|
|
|
+ if (!value) return undefined
|
|
|
+ const width =
|
|
|
+ dimensions().width < 44
|
|
|
+ ? dimensions().width - 5
|
|
|
+ : Math.min(75, dimensions().width - 4) - 5
|
|
|
+ return Locale.takeWidth(value, Math.max(1, width)).trimEnd()
|
|
|
})
|
|
|
const locationLabel = createMemo(() => {
|
|
|
if (!props.sessionID) {
|
|
|
@@ -1370,8 +1377,8 @@ export function Prompt(props: PromptProps) {
|
|
|
}}
|
|
|
>
|
|
|
<box
|
|
|
- paddingLeft={2}
|
|
|
- paddingRight={2}
|
|
|
+ paddingLeft={dimensions().width < 44 ? 1 : 2}
|
|
|
+ paddingRight={dimensions().width < 44 ? 1 : 2}
|
|
|
paddingTop={1}
|
|
|
flexShrink={0}
|
|
|
backgroundColor={promptBg()}
|
|
|
@@ -1461,25 +1468,34 @@ export function Prompt(props: PromptProps) {
|
|
|
syntaxStyle={syntax()}
|
|
|
/>
|
|
|
<box flexDirection="row" flexShrink={0} paddingTop={1} gap={1} justifyContent="space-between">
|
|
|
- <box flexDirection="row" gap={1}>
|
|
|
+ <box flexDirection="row" gap={1} flexGrow={1} flexShrink={1} minWidth={0}>
|
|
|
<Show when={agentLabel()} fallback={<box height={1} />}>
|
|
|
{(label) => (
|
|
|
<>
|
|
|
<text fg={fadeColor(highlight(), agentMetaAlpha())}>{label()}</text>
|
|
|
- <Show when={store.mode === "normal" && local.permission.mode === "auto"}>
|
|
|
+ <Show
|
|
|
+ when={store.mode === "normal" && local.permission.mode === "auto" && dimensions().width >= 44}
|
|
|
+ >
|
|
|
<text fg={fadeColor(theme.text.subdued, agentMetaAlpha())}>auto</text>
|
|
|
</Show>
|
|
|
- <Show when={store.mode === "normal"}>
|
|
|
- <box flexDirection="row" gap={1}>
|
|
|
+ <Show when={store.mode === "normal" && dimensions().width >= 28}>
|
|
|
+ <box flexDirection="row" gap={1} flexGrow={1} flexShrink={1} minWidth={0}>
|
|
|
<text fg={fadeColor(theme.text.subdued, modelMetaAlpha())}>·</text>
|
|
|
<text
|
|
|
- flexShrink={0}
|
|
|
+ flexShrink={1}
|
|
|
+ minWidth={0}
|
|
|
+ wrapMode="none"
|
|
|
+ truncate
|
|
|
fg={fadeColor(leader() ? theme.text.subdued : theme.text.default, modelMetaAlpha())}
|
|
|
>
|
|
|
{local.model.parsed().model}
|
|
|
</text>
|
|
|
- <text fg={fadeColor(theme.text.subdued, modelMetaAlpha())}>{currentProviderLabel()}</text>
|
|
|
- <Show when={showVariant()}>
|
|
|
+ <Show when={dimensions().width >= 50}>
|
|
|
+ <text flexShrink={0} fg={fadeColor(theme.text.subdued, modelMetaAlpha())}>
|
|
|
+ {currentProviderLabel()}
|
|
|
+ </text>
|
|
|
+ </Show>
|
|
|
+ <Show when={showVariant() && dimensions().width >= 70}>
|
|
|
<text fg={fadeColor(theme.text.subdued, variantMetaAlpha())}>·</text>
|
|
|
<text>
|
|
|
<span
|