diff options
| author | Adam <[email protected]> | 2025-10-24 16:04:44 -0500 |
|---|---|---|
| committer | Adam <[email protected]> | 2025-10-24 16:04:44 -0500 |
| commit | fea6a357bc1a25a05d3bcbbeb7bacf6286d4a7de (patch) | |
| tree | 42e35c2303260805006ccff5460f287c83500c3d /packages/desktop/src/components/diff.tsx | |
| parent | 6b821532634e9821f7a7ded1629954a814d5db82 (diff) | |
| download | opencode-fea6a357bc1a25a05d3bcbbeb7bacf6286d4a7de.tar.gz opencode-fea6a357bc1a25a05d3bcbbeb7bacf6286d4a7de.zip | |
wip: desktop work
Diffstat (limited to 'packages/desktop/src/components/diff.tsx')
| -rw-r--r-- | packages/desktop/src/components/diff.tsx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/packages/desktop/src/components/diff.tsx b/packages/desktop/src/components/diff.tsx index 0facaba47..d8457b528 100644 --- a/packages/desktop/src/components/diff.tsx +++ b/packages/desktop/src/components/diff.tsx @@ -1,4 +1,10 @@ -import { type FileContents, FileDiff, type DiffLineAnnotation, DiffFileRendererOptions } from "@pierre/precision-diffs" +import { + type FileContents, + FileDiff, + type DiffLineAnnotation, + DiffFileRendererOptions, + registerCustomTheme, +} from "@pierre/precision-diffs" import { ComponentProps, createEffect, splitProps } from "solid-js" export type DiffProps<T = {}> = Omit<DiffFileRendererOptions<T>, "themes"> & { @@ -9,6 +15,9 @@ export type DiffProps<T = {}> = Omit<DiffFileRendererOptions<T>, "themes"> & { classList?: ComponentProps<"div">["classList"] } +// @ts-expect-error +registerCustomTheme("opencode", () => import("./theme.json")) + // interface ThreadMetadata { // threadId: string // } @@ -40,7 +49,7 @@ export function Diff<T>(props: DiffProps<T>) { // annotations and a container element to hold the diff createEffect(() => { const instance = new FileDiff<T>({ - theme: "pierre-light", + theme: "opencode", // Or can also provide a 'themes' prop, which allows the code to adapt // to your OS light or dark theme // themes: { dark: 'pierre-night', light: 'pierre-light' }, |
