wip: desktop work

This commit is contained in:
Adam
2025-10-24 16:04:44 -05:00
parent 6b82153263
commit fea6a357bc
3 changed files with 659 additions and 91 deletions

View File

@@ -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' },