Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
},
"devDependencies": {
"@effect/vitest": "catalog:",
"@pierre/trees": "1.0.0-beta.4",
"@pierre/trees": "1.0.0-beta.6",
"@types/react": "~19.3.0",
"@types/react-dom": "~19.2.3",
"babel-preset-expo": "~58.0.8",
Expand Down
5 changes: 2 additions & 3 deletions apps/mobile/src/features/review/reviewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { parsePatchFiles } from "@pierre/diffs/utils/parsePatchFiles";
import type { ChangeTypes, FileDiffMetadata } from "@pierre/diffs/types";
import type { ThreadCheckpointSummary } from "@t3tools/client-runtime/state/thread-checkpoints";
import type { ReviewDiffPreviewSource } from "@t3tools/contracts";
import { unquoteGitPatchPath } from "@t3tools/shared/gitPatchPath";
import * as Arr from "effect/Array";
import { pipe } from "effect/Function";
import * as Order from "effect/Order";
Expand Down Expand Up @@ -374,8 +373,8 @@ function buildRenderableRows(file: FileDiffMetadata): ReadonlyArray<ReviewRender
}

function mapRenderableFile(file: FileDiffMetadata): ReviewRenderableFile {
const path = unquoteGitPatchPath(file.name || file.prevName || "");
const previousPath = file.prevName ? unquoteGitPatchPath(file.prevName) : null;
const path = file.name || file.prevName || "";
const previousPath = file.prevName || null;
const additions = file.hunks.reduce((total, hunk) => total + hunk.additionLines, 0);
const deletions = file.hunks.reduce((total, hunk) => total + hunk.deletionLines, 0);
const cacheKey = file.cacheKey ?? `${previousPath ?? "none"}:${path}:${file.type}`;
Expand Down
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@legendapp/list": "catalog:",
"@noble/hashes": "catalog:",
"@pierre/diffs": "catalog:",
"@pierre/trees": "1.0.0-beta.4",
"@pierre/trees": "1.0.0-beta.6",
"@t3tools/client-runtime": "workspace:*",
"@t3tools/contracts": "workspace:*",
"@t3tools/shared": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/diffs/AnnotatableCodeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ interface DiffCommentAnnotationGroup {
}

type DiffCommentLineAnnotation = DiffLineAnnotation<DiffCommentAnnotationGroup>;
export type AnnotatableCodeViewHandle = CodeViewHandle<DiffCommentAnnotationGroup>;
export type AnnotatableCodeViewHandle = CodeViewHandle<DiffCommentAnnotationGroup, undefined>;
const EMPTY_REVIEW_COMMENTS: ReadonlyArray<ReviewCommentContext> = [];

function annotationSide(range: SelectedLineRange): AnnotationSide {
Expand Down
7 changes: 5 additions & 2 deletions apps/web/src/components/diffs/StyledDiffCodeView.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ vi.mock("@pierre/diffs/worker/worker.js?worker", async () => {

vi.mock("@pierre/diffs/react", async (importOriginal) => ({
...(await importOriginal<typeof import("@pierre/diffs/react")>()),
CodeView: (props: CodeViewProps) => {
CodeView: (props: CodeViewProps<undefined, undefined>) => {
return props.items?.map((item) =>
item.type === "file" ? <FileOutput key={item.id} file={item.file} /> : null,
);
Expand All @@ -115,6 +115,7 @@ function FileOutput({ file }: { file: FileContents }) {
testState.renderPools.push(pool);
const renderer = new FileRenderer(
{ theme: "pierre-dark", preferredHighlighter: "shiki-wasm" },
undefined,
render,
pool,
);
Expand Down Expand Up @@ -301,8 +302,10 @@ describe("code-view worker lifecycle", () => {
expect(pool.getStats().totalWorkers).toBe(2);
expect(testState.terminations).toHaveLength(0);
await act(async () => renderer!.update(renderViews(0)));
// Pierre gives up on a held startup after 10 seconds; the idle timer then tears the pool down.
const timedOut = expect(pending).rejects.toThrow("worker initialization timed out");
await vi.advanceTimersByTimeAsync(30_000);
await pending;
await timedOut;
await Promise.all(testState.terminations);
await act(async () => {
for (const deliver of testState.heldResponses) deliver();
Expand Down
8 changes: 4 additions & 4 deletions apps/web/src/components/diffs/StyledDiffCodeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,16 +261,16 @@ const DIFF_VIEW_UNSAFE_CSS = `${DIFF_SURFACE_THEME_UNSAFE_CSS}
`;

export type StyledDiffCodeViewOptions<LAnnotation> = Omit<
NonNullable<CodeViewProps<LAnnotation>["options"]>,
NonNullable<CodeViewProps<LAnnotation, undefined>["options"]>,
"unsafeCSS" | "itemMetrics" | "layout"
>;

type StyledDiffCodeViewProps<LAnnotation> = (
| Omit<ControlledCodeViewProps<LAnnotation>, "options">
| Omit<UncontrolledCodeViewProps<LAnnotation>, "options">
| Omit<ControlledCodeViewProps<LAnnotation, undefined>, "options">
| Omit<UncontrolledCodeViewProps<LAnnotation, undefined>, "options">
) & {
readonly options?: StyledDiffCodeViewOptions<LAnnotation>;
readonly viewerRef?: Ref<CodeViewHandle<LAnnotation>>;
readonly viewerRef?: Ref<CodeViewHandle<LAnnotation, undefined>>;
/**
* Appended to the shared stylesheet inside the viewer's shadow root, for a surface that has
* to restyle chrome the viewer owns — such as replacing its per-file line counts.
Expand Down
Loading
Loading