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>
<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> <Switch>
<Match when={status() === "running"}> <Match when={status() === "running"}>
<box flexDirection="row" gap={1} flexGrow={1} justifyContent="flex-start"> <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} /> <spinner color={spinnerDef().color} frames={spinnerDef().frames} interval={40} />
</Show> </Show>
</box> </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{" "} esc{" "}
<span <span
style={{ style={{
@@ -1578,7 +1584,7 @@ export function Prompt(props: PromptProps) {
</Match> </Match>
<Match when={move.progress()}> <Match when={move.progress()}>
{(progress) => ( {(progress) => (
<box paddingLeft={3}> <box paddingLeft={3} height={1} minHeight={0} flexShrink={1}>
<Spinner color={themeV2.hue.accent(500)}> <Spinner color={themeV2.hue.accent(500)}>
{progress()} {progress()}
<span style={{ fg: themeV2.text.subdued() }}>{".".repeat(move.creatingDots())}</span> <span style={{ fg: themeV2.text.subdued() }}>{".".repeat(move.creatingDots())}</span>
@@ -1587,8 +1593,10 @@ export function Prompt(props: PromptProps) {
)} )}
</Match> </Match>
<Match when={move.pendingNew()}> <Match when={move.pendingNew()}>
<box paddingLeft={3}> <box paddingLeft={3} height={1} minHeight={0} flexShrink={1}>
<text fg={themeV2.hue.accent(500)}>(new working copy)</text> <text fg={themeV2.hue.accent(500)} wrapMode="none" truncate>
(new working copy)
</text>
</box> </box>
</Match> </Match>
<Match when={true}> <Match when={true}>
@@ -1601,10 +1609,15 @@ export function Prompt(props: PromptProps) {
</Show> </Show>
</Match> </Match>
</Switch> </Switch>
<box gap={2} flexDirection="row"> </box>
<Show when={editorContextLabelState() !== "none" ? editorFileLabelDisplay() : undefined}> <Show when={editorContextLabelState() !== "none" ? editorFileLabelDisplay() : undefined}>
{(file) => ( {(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()} {file()}
</text> </text>
)} )}
@@ -1613,7 +1626,7 @@ export function Prompt(props: PromptProps) {
<Match when={store.mode === "normal"}> <Match when={store.mode === "normal"}>
<Switch> <Switch>
<Match when={liveWorkStatusVisible() || statusItems().length > 0}> <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()}> <Show when={liveWorkStatusVisible() && liveWorkShortcut()}>
{(shortcut) => <span style={{ fg: themeV2.text() }}>{shortcut()} </span>} {(shortcut) => <span style={{ fg: themeV2.text() }}>{shortcut()} </span>}
</Show> </Show>
@@ -1635,24 +1648,23 @@ export function Prompt(props: PromptProps) {
</text> </text>
</Match> </Match>
<Match when={true}> <Match when={true}>
<text fg={themeV2.text()}> <text fg={themeV2.text()} flexShrink={0}>
{agentShortcut()} <span style={{ fg: themeV2.text.subdued() }}>agents</span> {agentShortcut()} <span style={{ fg: themeV2.text.subdued() }}>agents</span>
</text> </text>
</Match> </Match>
</Switch> </Switch>
<text fg={themeV2.text()}> <text fg={themeV2.text()} flexShrink={0}>
{paletteShortcut()} <span style={{ fg: themeV2.text.subdued() }}>commands</span> {paletteShortcut()} <span style={{ fg: themeV2.text.subdued() }}>commands</span>
</text> </text>
</Match> </Match>
<Match when={store.mode === "shell"}> <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> esc <span style={{ fg: themeV2.text.subdued() }}>exit shell mode</span>
</text> </text>
</Match> </Match>
</Switch> </Switch>
</box> </box>
</box> </box>
</box>
<Autocomplete <Autocomplete
sessionID={props.sessionID} sessionID={props.sessionID}
ref={(r) => { ref={(r) => {