Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit 7988f52

Browse files
authored
feat(app): use opentui markdown component behind experimental flag (anomalyco#10900)
1 parent e3be4c9 commit 7988f52

2 files changed

Lines changed: 22 additions & 9 deletions

File tree

packages/opencode/src/cli/cmd/tui/routes/session/index.tsx

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ import { DialogTimeline } from "./dialog-timeline"
5858
import { DialogForkFromTimeline } from "./dialog-fork-from-timeline"
5959
import { DialogSessionRename } from "../../component/dialog-session-rename"
6060
import { Sidebar } from "./sidebar"
61+
import { Flag } from "@/flag/flag"
6162
import { LANGUAGE_EXTENSIONS } from "@/lsp/language"
6263
import parsers from "../../../../../../parsers-config.ts"
6364
import { Clipboard } from "../../util/clipboard"
@@ -1338,15 +1339,26 @@ function TextPart(props: { last: boolean; part: TextPart; message: AssistantMess
13381339
return (
13391340
<Show when={props.part.text.trim()}>
13401341
<box id={"text-" + props.part.id} paddingLeft={3} marginTop={1} flexShrink={0}>
1341-
<code
1342-
filetype="markdown"
1343-
drawUnstyledText={false}
1344-
streaming={true}
1345-
syntaxStyle={syntax()}
1346-
content={props.part.text.trim()}
1347-
conceal={ctx.conceal()}
1348-
fg={theme.text}
1349-
/>
1342+
<Switch>
1343+
<Match when={Flag.OPENCODE_EXPERIMENTAL_MARKDOWN}>
1344+
<markdown
1345+
syntaxStyle={syntax()}
1346+
content={props.part.text.trim()}
1347+
conceal={ctx.conceal()}
1348+
/>
1349+
</Match>
1350+
<Match when={!Flag.OPENCODE_EXPERIMENTAL_MARKDOWN}>
1351+
<code
1352+
filetype="markdown"
1353+
drawUnstyledText={false}
1354+
streaming={true}
1355+
syntaxStyle={syntax()}
1356+
content={props.part.text.trim()}
1357+
conceal={ctx.conceal()}
1358+
fg={theme.text}
1359+
/>
1360+
</Match>
1361+
</Switch>
13501362
</box>
13511363
</Show>
13521364
)

packages/opencode/src/flag/flag.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export namespace Flag {
4646
export const OPENCODE_EXPERIMENTAL_LSP_TOOL = OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_LSP_TOOL")
4747
export const OPENCODE_DISABLE_FILETIME_CHECK = truthy("OPENCODE_DISABLE_FILETIME_CHECK")
4848
export const OPENCODE_EXPERIMENTAL_PLAN_MODE = OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_PLAN_MODE")
49+
export const OPENCODE_EXPERIMENTAL_MARKDOWN = OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_MARKDOWN")
4950
export const OPENCODE_MODELS_URL = process.env["OPENCODE_MODELS_URL"]
5051

5152
function number(key: string) {

0 commit comments

Comments
 (0)