mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-21 17:54:23 +01:00
wip: desktop work
This commit is contained in:
@@ -3,12 +3,12 @@ import {
|
||||
FileDiff,
|
||||
type DiffLineAnnotation,
|
||||
type HunkData,
|
||||
DiffFileRendererOptions,
|
||||
FileDiffOptions,
|
||||
// registerCustomTheme,
|
||||
} from "@pierre/precision-diffs"
|
||||
import { ComponentProps, createEffect, splitProps } from "solid-js"
|
||||
|
||||
export type DiffProps<T = {}> = Omit<DiffFileRendererOptions<T>, "themes"> & {
|
||||
export type DiffProps<T = {}> = FileDiffOptions<T> & {
|
||||
before: FileContents
|
||||
after: FileContents
|
||||
annotations?: DiffLineAnnotation<T>[]
|
||||
@@ -54,13 +54,9 @@ export function Diff<T>(props: DiffProps<T>) {
|
||||
// When ready to render, simply call .render with old/new file, optional
|
||||
// annotations and a container element to hold the diff
|
||||
createEffect(() => {
|
||||
// @ts-expect-error
|
||||
const instance = new FileDiff<T>({
|
||||
// theme: "pierre-light",
|
||||
// theme: "pierre-light",
|
||||
// Or can also provide a 'themes' prop, which allows the code to adapt
|
||||
// to your OS light or dark theme
|
||||
themes: { dark: "pierre-dark", light: "pierre-light" },
|
||||
theme: { dark: "pierre-dark", light: "pierre-light" },
|
||||
// When using the 'themes' prop, 'themeType' allows you to force 'dark'
|
||||
// or 'light' theme, or inherit from the OS ('system') theme.
|
||||
themeType: "system",
|
||||
|
||||
@@ -55,11 +55,7 @@ export function AssistantMessageDisplay(props: { message: AssistantMessage; part
|
||||
return x.type !== "tool" || (x as ToolPart).tool !== "todoread"
|
||||
})
|
||||
})
|
||||
return (
|
||||
<div data-component="assistant-message">
|
||||
<For each={filteredParts()}>{(part) => <Part part={part} message={props.message} />}</For>
|
||||
</div>
|
||||
)
|
||||
return <For each={filteredParts()}>{(part) => <Part part={part} message={props.message} />}</For>
|
||||
}
|
||||
|
||||
export function UserMessageDisplay(props: { message: UserMessage; parts: PartType[] }) {
|
||||
|
||||
Reference in New Issue
Block a user