fix(tui): preserve prompt footer actions (#37180)

This commit is contained in:
Kit Langton
2026-07-16 22:08:22 -04:00
committed by GitHub
parent f76e18201a
commit 4a7f760d25
+24 -12
View File
@@ -1555,7 +1555,8 @@ export function Prompt(props: PromptProps) {
}
/>
</box>
<box width="100%" flexDirection="row" justifyContent="space-between">
<box width="100%" flexDirection="row" justifyContent="space-between" gap={2}>
<box flexGrow={1} flexShrink={1} minWidth={0}>
<Switch>
<Match when={status() === "running"}>
<box flexDirection="row" gap={1} flexGrow={1} justifyContent="flex-start">
@@ -1564,7 +1565,12 @@ export function Prompt(props: PromptProps) {
<spinner color={spinnerDef().color} frames={spinnerDef().frames} interval={40} />
</Show>
</box>
<text fg={store.interrupt > 0 ? themeV2.background.action() : themeV2.text()}>
<text
fg={store.interrupt > 0 ? themeV2.background.action() : themeV2.text()}
wrapMode="none"
truncate
flexShrink={1}
>
esc{" "}
<span
style={{
@@ -1578,7 +1584,7 @@ export function Prompt(props: PromptProps) {
</Match>
<Match when={move.progress()}>
{(progress) => (
<box paddingLeft={3}>
<box paddingLeft={3} height={1} minHeight={0} flexShrink={1}>
<Spinner color={themeV2.hue.accent(500)}>
{progress()}
<span style={{ fg: themeV2.text.subdued() }}>{".".repeat(move.creatingDots())}</span>
@@ -1587,8 +1593,10 @@ export function Prompt(props: PromptProps) {
)}
</Match>
<Match when={move.pendingNew()}>
<box paddingLeft={3}>
<text fg={themeV2.hue.accent(500)}>(new working copy)</text>
<box paddingLeft={3} height={1} minHeight={0} flexShrink={1}>
<text fg={themeV2.hue.accent(500)} wrapMode="none" truncate>
(new working copy)
</text>
</box>
</Match>
<Match when={true}>
@@ -1601,10 +1609,15 @@ export function Prompt(props: PromptProps) {
</Show>
</Match>
</Switch>
<box gap={2} flexDirection="row">
</box>
<Show when={editorContextLabelState() !== "none" ? editorFileLabelDisplay() : undefined}>
{(file) => (
<text fg={editorContextLabelState() === "pending" ? themeV2.hue.accent(500) : themeV2.text.subdued()}>
<text
wrapMode="none"
truncate
flexShrink={1}
fg={editorContextLabelState() === "pending" ? themeV2.hue.accent(500) : themeV2.text.subdued()}
>
{file()}
</text>
)}
@@ -1613,7 +1626,7 @@ export function Prompt(props: PromptProps) {
<Match when={store.mode === "normal"}>
<Switch>
<Match when={liveWorkStatusVisible() || statusItems().length > 0}>
<text fg={themeV2.text.subdued()} wrapMode="none">
<text fg={themeV2.text.subdued()} wrapMode="none" truncate flexShrink={1}>
<Show when={liveWorkStatusVisible() && liveWorkShortcut()}>
{(shortcut) => <span style={{ fg: themeV2.text() }}>{shortcut()} </span>}
</Show>
@@ -1635,24 +1648,23 @@ export function Prompt(props: PromptProps) {
</text>
</Match>
<Match when={true}>
<text fg={themeV2.text()}>
<text fg={themeV2.text()} flexShrink={0}>
{agentShortcut()} <span style={{ fg: themeV2.text.subdued() }}>agents</span>
</text>
</Match>
</Switch>
<text fg={themeV2.text()}>
<text fg={themeV2.text()} flexShrink={0}>
{paletteShortcut()} <span style={{ fg: themeV2.text.subdued() }}>commands</span>
</text>
</Match>
<Match when={store.mode === "shell"}>
<text fg={themeV2.text()}>
<text fg={themeV2.text()} flexShrink={0}>
esc <span style={{ fg: themeV2.text.subdued() }}>exit shell mode</span>
</text>
</Match>
</Switch>
</box>
</box>
</box>
<Autocomplete
sessionID={props.sessionID}
ref={(r) => {