TUI: pick waiting phrase once per waiting session

This commit is contained in:
Vignesh Natarajan
2026-01-18 13:22:19 -08:00
committed by Peter Steinberger
parent fac66d4dda
commit e85d2dff97
2 changed files with 24 additions and 4 deletions

View File

@@ -1,4 +1,8 @@
import type { ClawdbotTheme } from "./theme/theme.js";
type MinimalTheme = {
dim: (s: string) => string;
bold: (s: string) => string;
accentSoft: (s: string) => string;
};
export const defaultWaitingPhrases = [
"flibbertigibbeting",
@@ -18,7 +22,7 @@ export function pickWaitingPhrase(tick: number, phrases = defaultWaitingPhrases)
return phrases[idx] ?? phrases[0] ?? "waiting";
}
export function shimmerText(theme: ClawdbotTheme, text: string, tick: number) {
export function shimmerText(theme: MinimalTheme, text: string, tick: number) {
const width = 6;
const hi = (ch: string) => theme.bold(theme.accentSoft(ch));
@@ -35,7 +39,7 @@ export function shimmerText(theme: ClawdbotTheme, text: string, tick: number) {
}
export function buildWaitingStatusMessage(params: {
theme: ClawdbotTheme;
theme: MinimalTheme;
tick: number;
elapsed: string;
connectionStatus: string;