diff options
| author | Tommy D. Rossi <[email protected]> | 2026-01-28 04:06:09 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-01-27 22:06:09 -0500 |
| commit | 7988f52231b7f8b3188831bbd9efd48797036099 (patch) | |
| tree | 0313d7ee543b3ea860898a19916d45e48bdd5bd4 | |
| parent | e3be4c9f23a157c437aae56f6841db1c7ec723de (diff) | |
| download | opencode-7988f52231b7f8b3188831bbd9efd48797036099.tar.gz opencode-7988f52231b7f8b3188831bbd9efd48797036099.zip | |
feat(app): use opentui markdown component behind experimental flag (#10900)
| -rw-r--r-- | packages/opencode/src/cli/cmd/tui/routes/session/index.tsx | 30 | ||||
| -rw-r--r-- | packages/opencode/src/flag/flag.ts | 1 |
2 files changed, 22 insertions, 9 deletions
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 5f47562d2..737ec4175 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx @@ -58,6 +58,7 @@ import { DialogTimeline } from "./dialog-timeline" import { DialogForkFromTimeline } from "./dialog-fork-from-timeline" import { DialogSessionRename } from "../../component/dialog-session-rename" import { Sidebar } from "./sidebar" +import { Flag } from "@/flag/flag" import { LANGUAGE_EXTENSIONS } from "@/lsp/language" import parsers from "../../../../../../parsers-config.ts" import { Clipboard } from "../../util/clipboard" @@ -1338,15 +1339,26 @@ function TextPart(props: { last: boolean; part: TextPart; message: AssistantMess return ( <Show when={props.part.text.trim()}> <box id={"text-" + props.part.id} paddingLeft={3} marginTop={1} flexShrink={0}> - <code - filetype="markdown" - drawUnstyledText={false} - streaming={true} - syntaxStyle={syntax()} - content={props.part.text.trim()} - conceal={ctx.conceal()} - fg={theme.text} - /> + <Switch> + <Match when={Flag.OPENCODE_EXPERIMENTAL_MARKDOWN}> + <markdown + syntaxStyle={syntax()} + content={props.part.text.trim()} + conceal={ctx.conceal()} + /> + </Match> + <Match when={!Flag.OPENCODE_EXPERIMENTAL_MARKDOWN}> + <code + filetype="markdown" + drawUnstyledText={false} + streaming={true} + syntaxStyle={syntax()} + content={props.part.text.trim()} + conceal={ctx.conceal()} + fg={theme.text} + /> + </Match> + </Switch> </box> </Show> ) diff --git a/packages/opencode/src/flag/flag.ts b/packages/opencode/src/flag/flag.ts index 0274dcc82..551435e72 100644 --- a/packages/opencode/src/flag/flag.ts +++ b/packages/opencode/src/flag/flag.ts @@ -46,6 +46,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 = OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_MARKDOWN") export const OPENCODE_MODELS_URL = process.env["OPENCODE_MODELS_URL"] function number(key: string) { |
