summaryrefslogtreecommitdiffhomepage
path: root/packages/ui/src/components/code.tsx
diff options
context:
space:
mode:
authorAdam <[email protected]>2025-11-05 11:55:31 -0600
committerAdam <[email protected]>2025-11-05 11:55:35 -0600
commitd525fbf82940442d8d47265b7d7d0a9af8c282bc (patch)
tree5404bdca83992a030fea1693227343d2d401376c /packages/ui/src/components/code.tsx
parent69a499f80786b2656121cee4469f39df2e6c40e7 (diff)
downloadopencode-d525fbf82940442d8d47265b7d7d0a9af8c282bc.tar.gz
opencode-d525fbf82940442d8d47265b7d7d0a9af8c282bc.zip
feat(desktop): session router, interrupt agent, visual cleanup
Diffstat (limited to 'packages/ui/src/components/code.tsx')
-rw-r--r--packages/ui/src/components/code.tsx5
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/ui/src/components/code.tsx b/packages/ui/src/components/code.tsx
index f1c7efada..a31649788 100644
--- a/packages/ui/src/components/code.tsx
+++ b/packages/ui/src/components/code.tsx
@@ -11,20 +11,21 @@ export type CodeProps<T = {}> = FileOptions<T> & {
export function Code<T>(props: CodeProps<T>) {
let container!: HTMLDivElement
const [local, others] = splitProps(props, ["file", "class", "classList", "annotations"])
- const file = () => local.file
createEffect(() => {
const instance = new File<T>({
theme: { dark: "oc-1-dark", light: "oc-1-light" }, // or any Shiki theme
overflow: "wrap", // or 'scroll'
themeType: "system", // 'system', 'light', or 'dark'
+ disableFileHeader: true,
disableLineNumbers: false, // optional
// lang: 'typescript', // optional - auto-detected from filename if not provided
...others,
})
+ container.innerHTML = ""
instance.render({
- file: file(),
+ file: local.file,
lineAnnotations: local.annotations,
containerWrapper: container,
})