Upgrade opentui to v0.1.86 and activate markdown renderable by default (#14974)

This commit is contained in:
Sebastian
2026-03-03 16:42:27 +01:00
committed by GitHub
parent b751bd0373
commit 3310c25dd1
4 changed files with 39 additions and 16 deletions

View File

@@ -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()}

View File

@@ -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"]