summaryrefslogtreecommitdiffhomepage
path: root/packages/desktop/src/components/diff.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/desktop/src/components/diff.tsx')
-rw-r--r--packages/desktop/src/components/diff.tsx13
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' },