From a3ef78157aba038023390fc3679a55232db35d20 Mon Sep 17 00:00:00 2001 From: Sebastian Herrlinger Date: Fri, 15 May 2026 02:50:11 +0200 Subject: [PATCH] handle undefined tips --- .../src/cli/cmd/tui/feature-plugins/home/tips-view.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/opencode/src/cli/cmd/tui/feature-plugins/home/tips-view.tsx b/packages/opencode/src/cli/cmd/tui/feature-plugins/home/tips-view.tsx index 8c50914df3..11790ebf49 100644 --- a/packages/opencode/src/cli/cmd/tui/feature-plugins/home/tips-view.tsx +++ b/packages/opencode/src/cli/cmd/tui/feature-plugins/home/tips-view.tsx @@ -73,6 +73,7 @@ function parse(tip: string): TipPart[] { } const NO_MODELS_TIP = "Run {highlight}/connect{/highlight} to add an AI provider and start coding" +const NO_MODELS_PARTS = parse(NO_MODELS_TIP) function shortcutText(value: string) { return `{highlight}${value}{/highlight}` @@ -145,8 +146,13 @@ export function Tips(props: { api: TuiPluginApi; connected?: boolean }) { return value ? [value] : [] }) return tips[Math.floor(tipOffset * tips.length)] ?? NO_MODELS_TIP - }) - const parts = createMemo(() => parse(tip())) + }, NO_MODELS_TIP) + // Solid can expose a memo's initial value while a pure computation is pending. + const parts = createMemo(() => { + const value = tip() + if (typeof value === "string") return parse(value) + return NO_MODELS_PARTS + }, NO_MODELS_PARTS) return (