diff --git a/client/panel-harness.html b/client/panel-harness.html new file mode 100644 index 00000000..05fb2f8d --- /dev/null +++ b/client/panel-harness.html @@ -0,0 +1,12 @@ + + +
+ + +
+ {breakablePath(c().path)}:{lineRange(c().startLine, c().endLine)}
+
+ {c().match === "renamed-file" ? "file renamed from " : "moved from "} + {breakablePath(c().oldPath!)} +
++ Paired with the base by a best guess. Check the diff before you trust the before values. +
++ Changed in this window and put back. Base and head are the same. +
++ Deleted. Its lines and values are from the base. +
+{c().naReason}
++ {breakablePath(d().path)} +
+ )} +
+
+ Couldn't load the diff: {props.error} +
+Open a chunk's diff to see its lines here.
++ No line differs between these two sides. +
++ The diff is clipped here. Open the code to read the rest. +
+{props.rule}
++ Tests, docs, generated and vendor files get no bucket. +
+{props.children}
; +} diff --git a/client/src/changelens/panel/harness.tsx b/client/src/changelens/panel/harness.tsx new file mode 100644 index 00000000..cece1c91 --- /dev/null +++ b/client/src/changelens/panel/harness.tsx @@ -0,0 +1,143 @@ +/* @refresh reload */ +// Dev-only page (client/panel-harness.html): the four panel components on sample data. +import { render } from "solid-js/web"; +import { createMemo, createSignal, For, type JSX } from "solid-js"; +import "../../index.css"; +import catalog from "../../../../server/tests/snapshots/metric-catalog.json"; +import { setMetricCatalog, type MetricCatalog } from "../../utils/metricsStore"; +import type { LensHunkDiff } from "../types"; +import { ChunkInspector, CommitRail, HunkDiff, ReviewBuckets } from "./index"; +import { bigHunkDiff, emptyPayload, sampleHunkDiff, samplePayload } from "./sample"; + +setMetricCatalog(catalog as MetricCatalog); + +type DiffState = "none" | "loaded" | "loading" | "error" | "same" | "big"; + +function Pick