diff options
| author | Sebastian <[email protected]> | 2026-03-03 16:42:27 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-03-03 15:42:27 +0000 |
| commit | 3310c25dd1f603c1f3afbe05924f18408fcf57e0 (patch) | |
| tree | 948f10d0fb3ce2924762b66d1fe687b133926da1 /packages | |
| parent | b751bd0373b9b407ac5c6413fbb54c05644f97a3 (diff) | |
| download | opencode-3310c25dd1f603c1f3afbe05924f18408fcf57e0.tar.gz opencode-3310c25dd1f603c1f3afbe05924f18408fcf57e0.zip | |
Upgrade opentui to v0.1.86 and activate markdown renderable by default (#14974)
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/opencode/package.json | 4 | ||||
| -rw-r--r-- | packages/opencode/src/cli/cmd/tui/routes/session/index.tsx | 24 | ||||
| -rw-r--r-- | packages/opencode/src/flag/flag.ts | 7 |
3 files changed, 29 insertions, 6 deletions
diff --git a/packages/opencode/package.json b/packages/opencode/package.json index 925246815..45ecafaa2 100644 --- a/packages/opencode/package.json +++ b/packages/opencode/package.json @@ -89,8 +89,8 @@ "@opencode-ai/sdk": "workspace:*", "@opencode-ai/util": "workspace:*", "@openrouter/ai-sdk-provider": "1.5.4", - "@opentui/core": "0.1.81", - "@opentui/solid": "0.1.81", + "@opentui/core": "0.1.86", + "@opentui/solid": "0.1.86", "@parcel/watcher": "2.5.1", "@pierre/diffs": "catalog:", "@solid-primitives/event-bus": "1.1.2", diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx index 6062bb07b..9d7098413 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx @@ -1412,6 +1412,13 @@ function ReasoningPart(props: { last: boolean; part: ReasoningPart; message: Ass // OpenRouter sends encrypted reasoning data that appears as [REDACTED] return props.part.text.replace("[REDACTED]", "").trim() }) + const streaming = createMemo(() => { + if (!props.last) return false + if (props.part.time.end) return false + if (props.message.time.completed) return false + if (props.message.error) return false + return true + }) return ( <Show when={content() && ctx.showThinking()}> <box @@ -1426,7 +1433,7 @@ function ReasoningPart(props: { last: boolean; part: ReasoningPart; message: Ass <code filetype="markdown" drawUnstyledText={false} - streaming={true} + streaming={streaming()} syntaxStyle={subtleSyntax()} content={"_Thinking:_ " + content()} conceal={ctx.conceal()} @@ -1440,6 +1447,13 @@ function ReasoningPart(props: { last: boolean; part: ReasoningPart; message: Ass function TextPart(props: { last: boolean; part: TextPart; message: AssistantMessage }) { const ctx = use() const { theme, syntax } = useTheme() + const streaming = createMemo(() => { + if (!props.last) return false + if (props.part.time?.end) return false + if (props.message.time.completed) return false + if (props.message.error) return false + return true + }) return ( <Show when={props.part.text.trim()}> <box id={"text-" + props.part.id} paddingLeft={3} marginTop={1} flexShrink={0}> @@ -1447,16 +1461,20 @@ function TextPart(props: { last: boolean; part: TextPart; message: AssistantMess <Match when={Flag.OPENCODE_EXPERIMENTAL_MARKDOWN}> <markdown syntaxStyle={syntax()} - streaming={true} + streaming={streaming()} content={props.part.text.trim()} conceal={ctx.conceal()} + tableOptions={{ + widthMode: "full", + columnFitter: "balanced", + }} /> </Match> <Match when={!Flag.OPENCODE_EXPERIMENTAL_MARKDOWN}> <code filetype="markdown" drawUnstyledText={false} - streaming={true} + streaming={streaming()} syntaxStyle={syntax()} content={props.part.text.trim()} conceal={ctx.conceal()} diff --git a/packages/opencode/src/flag/flag.ts b/packages/opencode/src/flag/flag.ts index e02f191c7..22eba6320 100644 --- a/packages/opencode/src/flag/flag.ts +++ b/packages/opencode/src/flag/flag.ts @@ -3,6 +3,11 @@ function truthy(key: string) { return value === "true" || value === "1" } +function falsy(key: string) { + const value = process.env[key]?.toLowerCase() + return value === "false" || value === "0" +} + export namespace Flag { export const OPENCODE_AUTO_SHARE = truthy("OPENCODE_AUTO_SHARE") export const OPENCODE_GIT_BASH_PATH = process.env["OPENCODE_GIT_BASH_PATH"] @@ -52,7 +57,7 @@ export namespace Flag { export const OPENCODE_EXPERIMENTAL_LSP_TOOL = OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_LSP_TOOL") export const OPENCODE_DISABLE_FILETIME_CHECK = truthy("OPENCODE_DISABLE_FILETIME_CHECK") export const OPENCODE_EXPERIMENTAL_PLAN_MODE = OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_PLAN_MODE") - export const OPENCODE_EXPERIMENTAL_MARKDOWN = truthy("OPENCODE_EXPERIMENTAL_MARKDOWN") + export const OPENCODE_EXPERIMENTAL_MARKDOWN = !falsy("OPENCODE_EXPERIMENTAL_MARKDOWN") export const OPENCODE_MODELS_URL = process.env["OPENCODE_MODELS_URL"] export const OPENCODE_MODELS_PATH = process.env["OPENCODE_MODELS_PATH"] |
