feat(tui): add mini splash setting (#38317)

Fix #38010
This commit is contained in:
Simon Klee 2026-07-22 15:46:50 +02:00 committed by GitHub
commit 8fad13365b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 89 additions and 18 deletions

View file

@ -684,6 +684,13 @@ export function RunSettingsBody(props: {
keywords: `footer status activity model context usage ${props.settings().footer}`,
key: "footer",
},
{
category: "Terminal",
display: "Splash",
footer: saving() === "splash" ? "saving" : props.settings().splash,
keywords: `splash entry exit banner ${props.settings().splash}`,
key: "splash",
},
{
category: "Terminal",
display: "Monochrome UI",

View file

@ -616,6 +616,10 @@ export class RunFooter implements FooterApi {
return this.theme()
}
public currentMiniSettings(): MiniSettings {
return this.miniSettings()
}
private destroyTheme(theme: RunTheme): void {
const index = this.themes.indexOf(theme)
if (index === -1) {

View file

@ -90,6 +90,7 @@ export function resolveMiniSettings(config?: { mini?: Partial<MiniSettings> }):
shell_output: config?.mini?.shell_output ?? "hide",
turn_summary: config?.mini?.turn_summary ?? "show",
footer: config?.mini?.footer ?? "show",
splash: config?.mini?.splash ?? "show",
mono: config?.mini?.mono ?? false,
}
}

View file

@ -196,13 +196,15 @@ export async function createRuntimeLifecycle(input: LifecycleInput): Promise<Lif
renderer,
state,
"entry",
entrySplash({
...meta,
theme: theme.splash,
showSession: splash.showSession,
detail: directoryLabel(input.getDirectory(), input.host.paths.home),
mono,
}),
miniSettings.splash === "show"
? entrySplash({
...meta,
theme: theme.splash,
showSession: splash.showSession,
detail: directoryLabel(input.getDirectory(), input.host.paths.home),
mono,
})
: undefined,
)
await renderer.idle().catch(() => {})
@ -224,7 +226,9 @@ export async function createRuntimeLifecycle(input: LifecycleInput): Promise<Lif
history: input.history,
theme,
mono,
wrote,
// The transcript always starts one row below the terminal's prior output,
// even when the entry splash itself is hidden.
wrote: wrote || miniSettings.splash === "hide",
tuiConfig,
miniSettings: {
current: miniSettings,
@ -306,8 +310,7 @@ export async function createRuntimeLifecycle(input: LifecycleInput): Promise<Lif
try {
await footer.idle().catch(() => {})
const show = renderer.isDestroyed ? false : next.showExit
if (!renderer.isDestroyed && show) {
if (!renderer.isDestroyed && next.showExit && footer.currentMiniSettings().splash === "show") {
const sessionID = next.sessionID || input.getSessionID?.() || input.sessionID
const splash = splashInfo(next.sessionTitle ?? input.sessionTitle, next.history ?? input.history)
wroteExit = queueSplash(

View file

@ -393,6 +393,7 @@ export type MiniSettings = {
shell_output: "show" | "hide"
turn_summary: "show" | "hide"
footer: "show" | "hide"
splash: "show" | "hide"
mono: boolean
}