diff options
| author | Sebastian <[email protected]> | 2026-03-29 00:27:27 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-03-29 00:27:27 +0100 |
| commit | 38af99dcb47e92e4f25c7aa6344b5f8f9b766e1e (patch) | |
| tree | 299af567105120803426ffa200c11a08ab69f8ed /.opencode | |
| parent | 772059acb5555f958ef616a3ff00a2fd89b36933 (diff) | |
| download | opencode-38af99dcb47e92e4f25c7aa6344b5f8f9b766e1e.tar.gz opencode-38af99dcb47e92e4f25c7aa6344b5f8f9b766e1e.zip | |
prompt slot (#19563)
Diffstat (limited to '.opencode')
| -rw-r--r-- | .opencode/plugins/tui-smoke.tsx | 40 |
1 files changed, 35 insertions, 5 deletions
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 => ({ </box> ) }, + 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 = ( + <box flexShrink={0} flexDirection="row" gap={1}> + <text fg={skin.muted}> + <span style={{ fg: skin.accent }}>•</span> smoke home prompt + </text> + </box> + ) + + return <Prompt workspaceID={value.workspace_id} hint={Hint} placeholders={{ normal, shell }} /> + }, 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) } } |
