diff --git a/packages/tui/src/component/patch-diff.tsx b/packages/tui/src/component/patch-diff.tsx index a56d118368..aa314354e9 100644 --- a/packages/tui/src/component/patch-diff.tsx +++ b/packages/tui/src/component/patch-diff.tsx @@ -4,14 +4,14 @@ import type { JSX } from "@opentui/solid" import { createMemo, For, Show, splitProps } from "solid-js" import { splitPatchHunks } from "../util/diff" -type Props = Omit & { +type Props = Omit & { diff: string - hunkBg: ColorInput hunkFg: ColorInput + lineNumberBg: ColorInput } export function PatchDiff(props: Props) { - const [local, diffProps] = splitProps(props, ["diff", "hunkBg", "hunkFg"]) + const [local, diffProps] = splitProps(props, ["diff", "hunkFg", "lineNumberBg"]) const hunks = createMemo(() => splitPatchHunks(local.diff)) return ( @@ -19,11 +19,13 @@ export function PatchDiff(props: Props) { {(hunk, index) => ( <> 0}> - - {hunk.header ?? ""} - + + + {hunk.header ?? ""} + + - + )} diff --git a/packages/tui/src/mini/footer.permission.tsx b/packages/tui/src/mini/footer.permission.tsx index 3e1c6c002f..4d28bbcc2c 100644 --- a/packages/tui/src/mini/footer.permission.tsx +++ b/packages/tui/src/mini/footer.permission.tsx @@ -408,7 +408,6 @@ export function RunPermissionBody(props: { > { { const frame = await app.waitForFrame((value) => value.includes("@@ -20,3 +20,3 @@"), ) - const header = frame - .split("\n") - .find((line) => line.includes("@@ -20,3 +20,3 @@")) + const headerRow = frame.split("\n").findIndex((line) => line.includes("@@ -20,3 +20,3 @@")) + const header = frame.split("\n")[headerRow] + const background = parseColor("#222222") expect(header?.startsWith("@@ -20,3 +20,3 @@")).toBe(true) expect(header?.trimEnd()).toBe("@@ -20,3 +20,3 @@") + expect( + app + .captureSpans() + .lines[headerRow].spans.every( + (span) => + span.bg.r === background.r && + span.bg.g === background.g && + span.bg.b === background.b && + span.bg.a === background.a, + ), + ).toBe(true) expect(findDiffs(app.renderer.root)).toHaveLength(2) })