From 38af99dcb47e92e4f25c7aa6344b5f8f9b766e1e Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sun, 29 Mar 2026 00:27:27 +0100 Subject: prompt slot (#19563) --- .opencode/plugins/tui-smoke.tsx | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) (limited to '.opencode') diff --git a/.opencode/plugins/tui-smoke.tsx b/.opencode/plugins/tui-smoke.tsx index deb3c3e3e..febfc3e37 100644 --- a/.opencode/plugins/tui-smoke.tsx +++ b/.opencode/plugins/tui-smoke.tsx @@ -1,5 +1,5 @@ /** @jsxImportSource @opentui/solid */ -import { useKeyboard, useTerminalDimensions } from "@opentui/solid" +import { useKeyboard, useTerminalDimensions, type JSX } from "@opentui/solid" import { RGBA, VignetteEffect } from "@opentui/core" import type { TuiKeybindSet, @@ -615,7 +615,7 @@ const Modal = (props: { ) } -const home = (input: Cfg): TuiSlotPlugin => ({ +const home = (api: TuiPluginApi, input: Cfg) => ({ slots: { home_logo(ctx) { const map = ctx.theme.current @@ -649,6 +649,36 @@ const home = (input: Cfg): TuiSlotPlugin => ({ ) }, + home_prompt(ctx, value) { + const skin = look(ctx.theme.current) + type Prompt = (props: { + workspaceID?: string + hint?: JSX.Element + placeholders?: { + normal?: string[] + shell?: string[] + } + }) => JSX.Element + if (!("Prompt" in api.ui)) return null + const view = api.ui.Prompt + if (typeof view !== "function") return null + const Prompt = view as Prompt + const normal = [ + `[SMOKE] route check for ${input.label}`, + "[SMOKE] confirm home_prompt slot override", + "[SMOKE] verify api.ui.Prompt rendering", + ] + const shell = ["printf '[SMOKE] home prompt\n'", "git status --short", "bun --version"] + const Hint = ( + + + smoke home prompt + + + ) + + return + }, home_bottom(ctx) { const skin = look(ctx.theme.current) const text = "extra content in the unified home bottom slot" @@ -706,8 +736,8 @@ const block = (input: Cfg, order: number, title: string, text: string): TuiSlotP }, }) -const slot = (input: Cfg): TuiSlotPlugin[] => [ - home(input), +const slot = (api: TuiPluginApi, input: Cfg): TuiSlotPlugin[] => [ + home(api, input), block(input, 50, "Smoke above", "renders above internal sidebar blocks"), block(input, 250, "Smoke between", "renders between internal sidebar blocks"), block(input, 650, "Smoke below", "renders below internal sidebar blocks"), @@ -848,7 +878,7 @@ const tui: TuiPlugin = async (api, options, meta) => { ]) reg(api, value, keys) - for (const item of slot(value)) { + for (const item of slot(api, value)) { api.slots.register(item) } } -- cgit v1.2.3