The display pane is a column of the root now: it stands at the right over the terminal's full height, beside the prompt and the status bar, from 80 columns (layout.ts decides both columns' widths from the terminal's width alone). Below that it is no longer silently absent: the status bar names the key, and alt+d puts the display in the transcript's place and back. An images tab shows what view_image viewed, what show showed and what was attached, drawn by OpenTUI's own image renderable (kitty graphics where the terminal is found to support them, sixel, else blocks); `images: auto|on|off`. The transcript has two views over the same items: full, and compact, where a round of tool calls is one line and a failure or a refusal always has its own. `transcript: auto|full|compact`, alt+t, /transcript. The pane gets a session header, a tab bar that fits its width, clickable tabs and rows of known width; the status bar has a short form for a narrow column, and the welcome box's hints and the prompt's placeholder no longer wrap inside a phrase. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
27 lines
843 B
TypeScript
27 lines
843 B
TypeScript
import type { SyntaxStyle } from "@opentui/core"
|
|
import { createContext, useContext } from "solid-js"
|
|
import type { App } from "../app.ts"
|
|
import type { View } from "./state.ts"
|
|
import type { Theme } from "./theme.ts"
|
|
|
|
export interface Ctx {
|
|
app: App
|
|
view: View
|
|
theme: () => Theme
|
|
md: () => SyntaxStyle
|
|
thought: () => SyntaxStyle
|
|
/** Terminal size, from ONE resize subscription in Root: per-item subscriptions leaked listeners
|
|
* (and Node's warning about them printed over the screen). */
|
|
dims: () => { width: number; height: number }
|
|
/** The compact transcript is drawn (tool rounds grouped); unset: the full one. */
|
|
compact?: () => boolean
|
|
}
|
|
|
|
export const TuiContext = createContext<Ctx>()
|
|
|
|
export function useTui(): Ctx {
|
|
const c = useContext(TuiContext)
|
|
if (!c) throw new Error("TuiContext missing")
|
|
return c
|
|
}
|