@devries-cameron20 / t3code Mirror · read-only / commits / d228f1f2c8
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 18:15 UTC

perf(web): highlight code with @pierre/highlights instead of Shiki (#23178)

maria committed Oct 25, 2026 at 02:08 UTC d228f1f2c8e43a9262e8ad485c0af8344a538fa8
14 files changed +304 -225
apps/web/src/components/chat/HighlightedCodeLines.tsx
+3 -2
@@ -1,10 +1,11 @@
1 -import type { DiffsHighlighter } from "@pierre/diffs";
1 import { toHtml } from "hast-util-to-html";
2 import { toJsxRuntime } from "hast-util-to-jsx-runtime";
3 import { cloneElement, isValidElement, memo, type DOMAttributes } from "react";
4 import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
7 -type HighlightedRoot = ReturnType<DiffsHighlighter["codeToHast"]>;
6 +import type { highlightCodeToHast } from "../../lib/incrementalHighlighting";
7 +
8 +type HighlightedRoot = ReturnType<typeof highlightCodeToHast>;
9 type HighlightedNode = HighlightedRoot["children"][number];
10 const runtime = { Fragment, jsx, jsxs };
11
apps/web/src/components/chat/MarkdownCodeBlock.tsx
+7 -3
@@ -5,7 +5,10 @@ import React, { use, useEffect, useRef, useState, type ReactNode } from "react";
5
6 import { getClientSettings } from "../../hooks/useSettings";
7 import type { DiffThemeName } from "../../lib/diffRendering";
8 -import { createIncrementalHighlightedDocument } from "../../lib/incrementalHighlighting";
8 +import {
9 + createIncrementalHighlightedDocument,
10 + highlightCodeToHast,
11 +} from "../../lib/incrementalHighlighting";
12 import { LRUCache } from "../../lib/lruCache";
13 import { getSyntaxHighlighterPromise } from "../../lib/syntaxHighlighting";
14 import { cn } from "../../lib/utils";
@@ -353,11 +356,12 @@ function UncachedShikiCodeBlock({
356 const incrementalHighlight = preserveLines
357 ? createIncrementalHighlightedDocument(highlighter, language, themeName)
358 : null;
359 + useEffect(() => () => incrementalHighlight?.dispose(), [incrementalHighlight]);
360 const highlighted = (() => {
361 try {
362 if (incrementalHighlight) return incrementalHighlight(code);
363 return preserveLines
360 - ? highlighter.codeToHast(code, { lang: language, theme: themeName })
364 + ? highlightCodeToHast(highlighter, code, language, themeName)
365 : highlighter.codeToHtml(code, { lang: language, theme: themeName });
366 } catch (error) {
367 console.warn(
@@ -365,7 +369,7 @@ function UncachedShikiCodeBlock({
369 error instanceof Error ? error.message : error,
370 );
371 return preserveLines
368 - ? highlighter.codeToHast(code, { lang: "text", theme: themeName })
372 + ? highlightCodeToHast(highlighter, code, "text", themeName)
373 : highlighter.codeToHtml(code, { lang: "text", theme: themeName });
374 }
375 })();
apps/web/src/components/diffs/AnnotatableCodeView.browser.test.tsx
+1 -1
@@ -40,7 +40,7 @@ vi.mock("./StyledDiffCodeView", () => ({
40 ) : null}
41 {item.annotations?.map((annotation) => (
42 <div key={`${annotation.side}:${annotation.lineNumber}`}>
43 - {props.renderAnnotation?.(annotation, item)}
43 + {props.renderAnnotation?.(annotation, item.fileDiff, item)}
44 </div>
45 ))}
46 </section>
apps/web/src/components/diffs/AnnotatableCodeView.tsx
+1 -1
@@ -285,7 +285,7 @@ export function AnnotatableCodeView({
285 ? renderHeaderPrefix(item.fileDiff, item.id, item.collapsed === true)
286 : null
287 }
288 - renderAnnotation={(annotation) => {
288 + renderAnnotation={(...[annotation]) => {
289 const hasDraft = annotation.metadata.entries.some((entry) => entry.kind === "draft");
290 return (
291 <div
apps/web/src/components/diffs/useReviewFilePatches.ts
+2
@@ -111,6 +111,8 @@ export function useReviewFilePatches({
111 hunks: [],
112 additionLines: [],
113 deletionLines: [],
114 + additionCharacterCount: 0,
115 + deletionCharacterCount: 0,
116 splitLineCount: 0,
117 unifiedLineCount: 0,
118 isPartial: true,
apps/web/src/components/pullRequest/PullRequestCodeTab.tsx
+2 -2
@@ -3,7 +3,7 @@ import {
3 sourceControlClients,
4 } from "@t3tools/client-runtime/source-control-clients";
5 import type { CodeViewItem, DiffLineAnnotation, SelectedLineRange } from "@pierre/diffs";
6 -import type { CodeViewDiffItem, CodeViewHandle } from "@pierre/diffs/react";
6 +import type { CodeViewAnnotationArgs, CodeViewDiffItem, CodeViewHandle } from "@pierre/diffs/react";
7 import type {
8 EnvironmentId,
9 PullRequestDetailView,
@@ -934,7 +934,7 @@ function PullRequestCodeTab({
934 />
935 );
936
937 - const renderAnnotation = (annotation: ReviewAnnotation) => (
937 + const renderAnnotation = (...[annotation]: CodeViewAnnotationArgs<ReviewAnnotationGroup>) => (
938 <div className="py-1 font-sans text-foreground">
939 {annotation.metadata.threads.map(renderThreadCard)}
940 {annotation.metadata.pending.map((comment) => (
apps/web/src/components/settings/CaptureShortcutConfig.tsx
+2
@@ -12,6 +12,7 @@ import * as Cause from "effect/Cause";
12 import { useState } from "react";
13 import { getDesktopSnapShotBridge } from "../../lib/desktopSnapShot";
14 import { resolveDiffThemeName } from "../../lib/diffRendering";
15 +import { PREFERRED_HIGHLIGHTER } from "../../lib/syntaxHighlighting";
16 import { useRenderedAppearance } from "../../hooks/useTheme";
17 import { useCopyToClipboard } from "../../hooks/useCopyToClipboard";
18 import { Button } from "../ui/button";
@@ -181,6 +182,7 @@ export function CaptureShortcutConfig({
182 diffStyle: "unified",
183 theme: resolveDiffThemeName(resolvedTheme),
184 overflow: "wrap",
185 + preferredHighlighter: PREFERRED_HIGHLIGHTER,
186 }}
187 />
188 </div>
apps/web/src/index.css
+2 -2
@@ -1721,7 +1721,7 @@ code {
1721 inherited sizes on unrelated pre surfaces (terminal previews, approvals).
1722 Inline code stays relative to its sentence so it never towers over prose;
1723 diffs and file previews take the size through --diffs-font-size. */
1724 -.chat-markdown .chat-markdown-shiki .shiki,
1724 +.chat-markdown .chat-markdown-shiki :is(.shiki, .diffs),
1725 .chat-markdown .chat-markdown-codeblock pre,
1726 :is(.chat-markdown, .composer-tiptap) pre code {
1727 font-size: var(--font-size-code, inherit);
@@ -2100,7 +2100,7 @@ code {
2100 overflow-wrap: anywhere;
2101 }
2102
2103 -:is(.chat-markdown, .composer-tiptap) .chat-markdown-shiki .shiki {
2103 +:is(.chat-markdown, .composer-tiptap) .chat-markdown-shiki :is(.shiki, .diffs) {
2104 background: transparent !important;
2105 }
2106
apps/web/src/lib/incrementalHighlighting.test.ts
+82 -56
@@ -1,6 +1,6 @@
1 import { toHtml } from "hast-util-to-html";
2 -import { getSharedHighlighter } from "@pierre/diffs";
3 -import { describe, expect, it } from "vite-plus/test";
2 +import { disposeHighlighter, getSharedHighlighter } from "@pierre/diffs";
3 +import { afterAll, beforeAll, describe, expect, it } from "vite-plus/test";
4
5 import { createIncrementalHighlightedDocument } from "./incrementalHighlighting";
6
@@ -18,65 +18,91 @@ const samples = {
18 sql: "SELECT 'multi\nline'\nFROM table_name;\n",
19 } as const;
20
21 -const highlighterPromise = getSharedHighlighter({
21 +const highlighterOptions = {
22 langs: Object.keys(samples) as Array<keyof typeof samples>,
23 themes: ["pierre-dark", "pierre-light"],
24 - preferredHighlighter: "shiki-wasm",
25 -});
24 +};
25
27 -describe("incremental code highlighting", () => {
28 - it.each(Object.entries(samples))(
29 - "matches full HTML at every streaming prefix in %s",
30 - async (language, code) => {
31 - const highlighter = await highlighterPromise;
32 - for (const theme of ["pierre-dark", "pierre-light"] as const) {
33 - const highlight = createIncrementalHighlightedDocument(highlighter, language, theme);
34 - for (let end = 0; end <= code.length; end++) {
35 - const text = code.slice(0, end);
36 - expect(toHtml(highlight(text)), `${theme}, prefix ${end}`).toBe(
37 - highlighter.codeToHtml(text, { lang: language, theme }),
38 - );
26 +describe.each(["shiki-wasm", "highlights"] as const)(
27 + "incremental code highlighting (%s)",
28 + (engine) => {
29 + beforeAll(() => disposeHighlighter());
30 + afterAll(() => disposeHighlighter());
31 + it.each(Object.entries(samples))(
32 + "matches full HTML at every streaming prefix in %s",
33 + async (language, code) => {
34 + const highlighter = await getSharedHighlighter({
35 + ...highlighterOptions,
36 + preferredHighlighter: engine,
37 + });
38 + for (const theme of ["pierre-dark", "pierre-light"] as const) {
39 + const highlight = createIncrementalHighlightedDocument(highlighter, language, theme);
40 + for (let end = 0; end <= code.length; end++) {
41 + const text = code.slice(0, end);
42 + expect(toHtml(highlight(text)), `${theme}, prefix ${end}`).toBe(
43 + highlighter.codeToHtml(text, { lang: language, theme }),
44 + );
45 + }
46 + highlight.dispose();
47 }
40 - }
41 - },
42 - );
43 -
44 - it("resets after edits and truncation, including edits to a completed line", async () => {
45 - const highlighter = await highlighterPromise;
46 - const highlight = createIncrementalHighlightedDocument(
47 - highlighter,
48 - "typescript",
49 - "pierre-dark",
48 + },
49 );
51 - const inputs = [
52 - "/* open\ncomment\n",
53 - "/* open\ncomment\n*/\nconst x = 1;",
54 - "const edited = 2;\nconst x = 1;",
55 - "const edited = 2;\nconst x = 10;",
56 - "const edited = 2;\n",
57 - "",
58 - "\n\n\nconst fresh = true;\n",
59 - ];
60 - for (const text of inputs) {
61 - expect(toHtml(highlight(text))).toBe(
62 - highlighter.codeToHtml(text, { lang: "typescript", theme: "pierre-dark" }),
50 +
51 + it("resets after edits and truncation, including edits to a completed line", async () => {
52 + const highlighter = await getSharedHighlighter({
53 + ...highlighterOptions,
54 + preferredHighlighter: engine,
55 + });
56 + const highlight = createIncrementalHighlightedDocument(
57 + highlighter,
58 + "typescript",
59 + "pierre-dark",
60 );
64 - }
65 - });
61 + const inputs = [
62 + "/* open\ncomment\n",
63 + "/* open\ncomment\n*/\nconst x = 1;",
64 + "const edited = 2;\nconst x = 1;",
65 + "const edited = 2;\nconst x = 10;",
66 + "const edited = 2;\n",
67 + "",
68 + "\n\n\nconst fresh = true;\n",
69 + ];
70 + for (const text of inputs) {
71 + expect(toHtml(highlight(text))).toBe(
72 + highlighter.codeToHtml(text, { lang: "typescript", theme: "pierre-dark" }),
73 + );
74 + }
75 + highlight.dispose();
76 + });
77
67 - it("preserves partial CRLF and CR line endings", async () => {
68 - const highlighter = await highlighterPromise;
69 - const highlight = createIncrementalHighlightedDocument(
70 - highlighter,
71 - "typescript",
72 - "pierre-dark",
73 - );
74 - const code = "/* multi\r\nline */\r\nconst x = 1;\r\n";
75 - for (let end = 0; end <= code.length; end++) {
76 - const text = code.slice(0, end);
77 - expect(toHtml(highlight(text))).toBe(
78 - highlighter.codeToHtml(text, { lang: "typescript", theme: "pierre-dark" }),
78 + // MarkdownCodeBlock creates the document outside its plain-text fallback.
79 + it("creates a document for a language the highlighter has not loaded", async () => {
80 + const highlighter = await getSharedHighlighter({
81 + ...highlighterOptions,
82 + preferredHighlighter: engine,
83 + });
84 + expect(() =>
85 + createIncrementalHighlightedDocument(highlighter, "cobol", "pierre-dark").dispose(),
86 + ).not.toThrow();
87 + });
88 +
89 + it("preserves partial CRLF and CR line endings", async () => {
90 + const highlighter = await getSharedHighlighter({
91 + ...highlighterOptions,
92 + preferredHighlighter: engine,
93 + });
94 + const highlight = createIncrementalHighlightedDocument(
95 + highlighter,
96 + "typescript",
97 + "pierre-dark",
98 );
80 - }
81 - });
82 -});
99 + const code = "/* multi\r\nline */\r\nconst x = 1;\r\n";
100 + for (let end = 0; end <= code.length; end++) {
101 + const text = code.slice(0, end);
102 + expect(toHtml(highlight(text))).toBe(
103 + highlighter.codeToHtml(text, { lang: "typescript", theme: "pierre-dark" }),
104 + );
105 + }
106 + });
107 + },
108 +);
apps/web/src/lib/incrementalHighlighting.ts
+96 -57
@@ -1,70 +1,109 @@
1 -import type { DiffsHighlighter } from "@pierre/diffs";
1 +import {
2 + renderTokenLines,
3 + type DiffsHighlighter,
4 + type ThemedToken,
5 + type TokensResult,
6 +} from "@pierre/diffs";
7
8 import type { DiffThemeName } from "./diffRendering";
9
5 -function codeChildren(root: ReturnType<DiffsHighlighter["codeToHast"]>) {
6 - const pre = root.children.find((node) => node.type === "element" && node.tagName === "pre");
7 - if (pre?.type !== "element") throw new Error("Missing highlighted pre element");
8 - const code = pre.children.find((node) => node.type === "element" && node.tagName === "code");
9 - if (code?.type !== "element") throw new Error("Missing highlighted code element");
10 - return code.children;
10 +function highlightedDocument(
11 + result: TokensResult,
12 + lines = renderTokenLines(result.tokens, {}),
13 +): { type: "root"; children: ReturnType<typeof renderTokenLines> } {
14 + return {
15 + type: "root" as const,
16 + children: [
17 + {
18 + type: "element" as const,
19 + tagName: "pre",
20 + properties: {
21 + class: "diffs",
22 + style:
23 + result.rootStyle === false
24 + ? undefined
25 + : (result.rootStyle ??
26 + [
27 + result.fg != null ? `color:${result.fg}` : "",
28 + result.bg != null ? `background-color:${result.bg}` : "",
29 + ]
30 + .filter(Boolean)
31 + .join(";")),
32 + tabIndex: 0,
33 + },
34 + children: [
35 + {
36 + type: "element" as const,
37 + tagName: "code",
38 + properties: {},
39 + children: lines.flatMap((line, index) =>
40 + index === 0 ? [line] : [{ type: "text" as const, value: "\n" }, line],
41 + ),
42 + },
43 + ],
44 + },
45 + ],
46 + };
47 +}
48 +
49 +export function highlightCodeToHast(
50 + highlighter: DiffsHighlighter,
51 + code: string,
52 + language: string,
53 + theme: DiffThemeName,
54 +) {
55 + return highlightedDocument(highlighter.codeToTokens(code, { lang: language, theme }));
56 }
57
58 export function createIncrementalHighlightedDocument(
59 highlighter: DiffsHighlighter,
60 language: string,
61 theme: DiffThemeName,
17 -): (code: string) => ReturnType<DiffsHighlighter["codeToHast"]> {
62 +) {
63 const options = { lang: language, theme };
19 - const newline = { type: "text" as const, value: "\n" };
20 - let cached:
21 - | {
22 - prefix: string;
23 - state: ReturnType<DiffsHighlighter["getLastGrammarState"]>;
24 - children: ReturnType<typeof codeChildren>;
25 - }
26 - | undefined;
64 + let shell: TokensResult | undefined;
65 + let tokenizer: ReturnType<DiffsHighlighter["createStreamTokenizer"]> | undefined;
66 + let previous = "";
67 + const completedLines: ReturnType<typeof renderTokenLines> = [];
68 +
69 + function dispose() {
70 + tokenizer?.dispose();
71 + tokenizer = undefined;
72 + previous = "";
73 + completedLines.length = 0;
74 + }
75
28 - return (code: string) => {
29 - // Plain text and ANSI do not have a TextMate grammar state. A CR at the end
30 - // of a chunk can still become a CRLF, so keep that input on the full path.
31 - if (
32 - !language ||
33 - ["text", "plaintext", "plain", "txt", "ansi"].includes(language) ||
34 - code.includes("\r")
35 - ) {
36 - return highlighter.codeToHast(code, options);
37 - }
38 - if (cached && !code.startsWith(cached.prefix)) cached = undefined;
39 - const end = code.lastIndexOf("\n") + 1;
40 - if (end > (cached?.prefix.length ?? 0)) {
41 - // Omit the final newline: Shiki would tokenize an extra empty line and
42 - // advance the grammar state twice before we process the following line.
43 - const root = highlighter.codeToHast(code.slice(cached?.prefix.length ?? 0, end - 1), {
44 - ...options,
45 - ...(cached ? { grammarState: cached.state } : {}),
46 - });
47 - const state = highlighter.getLastGrammarState(root);
48 - if (!state) {
49 - cached = undefined;
50 - return highlighter.codeToHast(code, options);
76 + return Object.assign(
77 + (code: string) => {
78 + // ANSI and partial CRLF sequences need the full-source normalization path.
79 + if (language === "ansi" || code.includes("\r")) {
80 + dispose();
81 + return highlightCodeToHast(highlighter, code, language, theme);
82 }
52 - cached = {
53 - prefix: code.slice(0, end),
54 - state,
55 - children: [...(cached ? [...cached.children, newline] : []), ...codeChildren(root)],
56 - };
57 - }
58 - const prefix = cached;
59 - if (!prefix) return highlighter.codeToHast(code, options);
60 - return highlighter.codeToHast(code.slice(prefix.prefix.length), {
61 - ...options,
62 - grammarState: prefix.state,
63 - transformers: [
64 - {
65 - code: (node) => ({ ...node, children: [...prefix.children, newline, ...node.children] }),
66 - },
67 - ],
68 - });
69 - };
83 + if (!code.startsWith(previous)) dispose();
84 + // Created on first use so an unknown language throws inside the caller's fallback.
85 + shell ??= highlighter.codeToTokens("", options);
86 + tokenizer ??= highlighter.createStreamTokenizer(options);
87 + const update = tokenizer.enqueue(code.slice(previous.length));
88 + if (update instanceof Promise) {
89 + dispose();
90 + void update.catch(() => {});
91 + return highlightCodeToHast(highlighter, code, language, theme);
92 + }
93 + previous = code;
94 + let line: ThemedToken[] = [];
95 + for (const token of update.stable) {
96 + if (token.content === "\n") {
97 + completedLines.push(...renderTokenLines([line], {}));
98 + line = [];
99 + } else line.push(token);
100 + }
101 + // Completed line nodes retain their identity while the final line changes.
102 + return highlightedDocument(shell, [
103 + ...completedLines,
104 + ...renderTokenLines([update.unstable], {}),
105 + ]);
106 + },
107 + { dispose },
108 + );
109 }
apps/web/src/lib/syntaxHighlighting.ts
+4 -5
@@ -8,12 +8,11 @@ import {
8 import { resolveDiffThemeName } from "./diffRendering";
9
10 /**
11 - * Always highlight with the Oniguruma WASM engine — the JS regex engine can
12 - * backtrack catastrophically and hang the tokenizing thread. The shared
13 - * highlighter is a first-caller-wins singleton, so every creation site must
14 - * pass this value.
11 + * Highlights' hand-written WASM lexers tokenize large files 10-40x faster than
12 + * Shiki and never backtrack like Shiki's JS regex engine. Only one highlighter
13 + * type can be active per thread, so every creation site must pass this value.
14 */
16 -export const PREFERRED_HIGHLIGHTER: HighlighterTypes = "shiki-wasm";
15 +export const PREFERRED_HIGHLIGHTER: HighlighterTypes = "highlights";
16
17 const highlighterPromiseCache = new Map<string, Promise<DiffsHighlighter>>();
18
patches/@pierre%2Fdiffs@1.6.1.patch renamed
+80 -68
@@ -1,5 +1,5 @@
1 diff --git a/dist/components/CodeView.d.ts b/dist/components/CodeView.d.ts
2 -index cc32d28..3a46bf4 100644
2 +index 234ec4baa4..274ff5e32b 100644
3 --- a/dist/components/CodeView.d.ts
4 +++ b/dist/components/CodeView.d.ts
5 @@ -158,6 +158,12 @@ interface CodeViewOptions<LAnnotation, Caret> extends CodeViewPassThroughOptions
@@ -15,7 +15,7 @@ index cc32d28..3a46bf4 100644
15 /** Render a non-virtualized element at the very start of the scroll content,
16 * before the first item. It is always rendered and scrolls with the content.
17 * Return the same element across calls and mutate it in place to update;
18 -@@ -268,6 +274,13 @@ declare class CodeView<LAnnotation = undefined, Caret = undefined> {
18 +@@ -269,6 +275,13 @@ declare class CodeView<LAnnotation = undefined, Caret = undefined> {
19 getSelectedLines(): CodeViewLineSelection | null;
20 clearSelectedLines(options?: SelectionWriteOptions): void;
21 getItem(itemId: string): CodeViewItem<LAnnotation> | undefined;
@@ -30,10 +30,10 @@ index cc32d28..3a46bf4 100644
30 * Returns the editor while this item is being edited. Partial diffs get an
31 * editor after their files load; scrolling away or collapsing keeps it.
32 diff --git a/dist/components/CodeView.js b/dist/components/CodeView.js
33 -index 140f94f..96fc774 100644
33 +index ee5c91c5ab..7d0a2901e4 100644
34 --- a/dist/components/CodeView.js
35 +++ b/dist/components/CodeView.js
36 -@@ -16,6 +16,7 @@ import { prefersReducedMotion } from "../utils/prefersReducedMotion.js";
36 +@@ -18,6 +18,7 @@ import { resolvePreferredHighlighter } from "../utils/resolvePreferredHighlighte
37 import { roundToDevicePixel } from "../utils/roundToDevicePixel.js";
38 import { VirtualizedFile } from "./VirtualizedFile.js";
39 import { VirtualizedFileDiff } from "./VirtualizedFileDiff.js";
@@ -41,7 +41,7 @@ index 140f94f..96fc774 100644
41 //#region src/components/CodeView.ts
42 const CODE_VIEW_DIFF_OPTION_KEYS = [
43 "theme",
44 -@@ -114,6 +115,8 @@ function defineItemOption(target, key, get) {
44 +@@ -116,6 +117,8 @@ function defineItemOption(target, key, get) {
45 }
46 const DEFAULT_SCROLL_INTERACTION_RESTORE_DELAY_MS = 120;
47 const SUB_PIXEL_TOLERANCE = 1;
@@ -50,16 +50,16 @@ index 140f94f..96fc774 100644
50 const SCROLLING_CODE_OVERFLOW_FIX_VARIABLE = "--diffs-overflow-override";
51 function createScrollRebaseConfig(containerHeight, triggerTop, targetTop) {
52 return {
53 -@@ -211,6 +214,8 @@ var CodeView = class CodeView {
53 +@@ -213,6 +216,8 @@ var CodeView = class CodeView {
54 isReadySubscription;
55 pendingHighlighterTheme;
56 - isContainerManaged;
56 + isComponentManaged;
57 + search = new CodeViewSearch(this);
58 + pendingSearchReveal;
59 - constructor(options = { theme: DEFAULT_THEMES }, workerManager, isContainerManaged = false) {
59 + slotSnapshotStale = false;
60 + constructor(options = { theme: DEFAULT_THEMES }, workerManager, isComponentManaged = false) {
61 this.options = options;
61 - this.computeMetricsCache(options.itemMetrics);
62 -@@ -392,6 +397,7 @@ var CodeView = class CodeView {
62 +@@ -395,6 +400,7 @@ var CodeView = class CodeView {
63 this.root.addEventListener("touchstart", this.clearPendingScroll, { passive: true });
64 this.root.addEventListener("pointerdown", this.clearPendingScroll, { passive: true });
65 this.root.addEventListener("keydown", this.clearPendingScroll, { passive: true });
@@ -67,15 +67,15 @@ index 140f94f..96fc774 100644
67 this.resizeObserver.observe(this.root);
68 this.render(true);
69 window.__INSTANCE = this;
70 -@@ -464,6 +470,7 @@ var CodeView = class CodeView {
70 +@@ -467,6 +473,7 @@ var CodeView = class CodeView {
71 this.heightDirty = true;
72 this.resetRenderState();
73 - if (!this.isContainerManaged) this.flushSlotCoordinator();
73 + if (!this.isComponentManaged) this.flushSlotCoordinator();
74 + this.search.refresh();
75 if (failed) throw failure;
76 }
77 cleanUp() {
78 -@@ -485,6 +492,8 @@ var CodeView = class CodeView {
78 +@@ -488,6 +495,8 @@ var CodeView = class CodeView {
79 this.root?.removeEventListener("touchstart", this.clearPendingScroll);
80 this.root?.removeEventListener("pointerdown", this.clearPendingScroll);
81 this.root?.removeEventListener("keydown", this.clearPendingScroll);
@@ -84,7 +84,7 @@ index 140f94f..96fc774 100644
84 this.root?.style.removeProperty("overflow-anchor");
85 this.container?.remove();
86 this.stickyOffset.remove();
87 -@@ -626,6 +635,137 @@ var CodeView = class CodeView {
87 +@@ -629,6 +638,137 @@ var CodeView = class CodeView {
88 getItem(itemId) {
89 return this.idToItem.get(itemId)?.item;
90 }
@@ -222,7 +222,7 @@ index 140f94f..96fc774 100644
222 /**
223 * Returns the editor while this item is being edited. Partial diffs get an
224 * editor after their files load; scrolling away or collapsing keeps it.
225 -@@ -645,6 +785,7 @@ var CodeView = class CodeView {
225 +@@ -648,6 +788,7 @@ var CodeView = class CodeView {
226 this.render();
227 this.syncItemEditors();
228 this.syncSelection();
@@ -230,7 +230,7 @@ index 140f94f..96fc774 100644
230 return true;
231 }
232 updateItemId(oldId, newId) {
233 -@@ -678,6 +819,7 @@ var CodeView = class CodeView {
233 +@@ -681,6 +822,7 @@ var CodeView = class CodeView {
234 this.renamePendingScrollTarget(oldId, newId);
235 this.renamePendingLayoutAnchor(oldId, newId);
236 this.render();
@@ -238,7 +238,7 @@ index 140f94f..96fc774 100644
238 return true;
239 }
240 addItem(input) {
241 -@@ -687,6 +829,7 @@ var CodeView = class CodeView {
241 +@@ -690,6 +832,7 @@ var CodeView = class CodeView {
242 this.appendItemsInternal(inputs);
243 this.syncItemEditors();
244 this.syncSelection();
@@ -246,7 +246,7 @@ index 140f94f..96fc774 100644
246 }
247 removeItem(itemId) {
248 const item = this.idToItem.get(itemId);
249 -@@ -709,6 +852,7 @@ var CodeView = class CodeView {
249 +@@ -712,6 +855,7 @@ var CodeView = class CodeView {
250 for (const removedItem of removedItemsById?.values() ?? []) removedItem.instance.cleanUp();
251 }
252 this.syncSelection();
@@ -254,7 +254,7 @@ index 140f94f..96fc774 100644
254 }
255 /**
256 * Append new records to the viewer while preserving existing layout state.
257 -@@ -1330,6 +1474,10 @@ var CodeView = class CodeView {
257 +@@ -1334,6 +1478,10 @@ var CodeView = class CodeView {
258 item.item = nextItem;
259 item.version = nextItem.version;
260 item.renderedOptionsRevision = -1;
@@ -265,7 +265,7 @@ index 140f94f..96fc774 100644
265 return true;
266 }
267 getMaxScrollTopForHeight(scrollHeight) {
268 -@@ -1710,6 +1858,10 @@ var CodeView = class CodeView {
268 +@@ -1714,6 +1862,10 @@ var CodeView = class CodeView {
269 this.updateStickyPositioning();
270 this.validateStickyContainerHeight();
271 this.fixContainerFocus();
@@ -276,7 +276,7 @@ index 140f94f..96fc774 100644
276 if (fitPerfectly || this.scrollAnimation != null) this.render();
277 };
278 flushManagers(updatedItems) {
279 -@@ -1804,7 +1956,8 @@ var CodeView = class CodeView {
279 +@@ -1808,7 +1960,8 @@ var CodeView = class CodeView {
280 this.notifyScroll();
281 this.render();
282 };
@@ -286,7 +286,7 @@ index 140f94f..96fc774 100644
286 this.pendingScrollTarget = void 0;
287 this.pendingLayoutAnchor = void 0;
288 this.scrollAnimation = void 0;
289 -@@ -2066,7 +2219,12 @@ var CodeView = class CodeView {
289 +@@ -2071,7 +2224,12 @@ var CodeView = class CodeView {
290 const item = this.items[index];
291 if (item == null) throw new Error("CodeView.recomputeLayout: invalid item index");
292 item.top = runningTop;
@@ -300,7 +300,7 @@ index 140f94f..96fc774 100644
300 else item.height = item.instance.updateCodeViewLayout(item.item.file, runningTop, reset, item.item.annotations ?? []);
301 runningTop += item.height;
302 if (index < this.items.length - 1) runningTop += layout.gap;
303 -@@ -2086,6 +2244,27 @@ var CodeView = class CodeView {
303 +@@ -2091,6 +2249,27 @@ var CodeView = class CodeView {
304 return this.getLayout().gap + this.itemMetricsCache.diffHeaderHeight;
305 }
306 };
@@ -330,7 +330,7 @@ index 140f94f..96fc774 100644
330 if (item.type === "diff") return item.instance.updateCodeViewLayout(item.item.fileDiff, item.top, void 0, item.item.annotations ?? []);
331 diff --git a/dist/components/CodeViewSearch.js b/dist/components/CodeViewSearch.js
332 new file mode 100644
333 -index 0000000..29370ad
333 +index 0000000000..29370adf88
334 --- /dev/null
335 +++ b/dist/components/CodeViewSearch.js
336 @@ -0,0 +1,360 @@
@@ -695,22 +695,32 @@ index 0000000..29370ad
695 +
696 +//# sourceMappingURL=CodeViewSearch.js.map
697 diff --git a/dist/components/FileDiff.js b/dist/components/FileDiff.js
698 -index 6f66bd3..3125fac 100644
698 +index 12f4f8949f..e33a5ed319 100644
699 --- a/dist/components/FileDiff.js
700 +++ b/dist/components/FileDiff.js
701 -@@ -1,5 +1,6 @@
702 --import { CUSTOM_HEADER_SLOT_ID, DEFAULT_THEMES, EMPTY_RENDER_RANGE, HEADER_FILENAME_SUFFIX_SLOT_ID, HEADER_METADATA_SLOT_ID, HEADER_PREFIX_SLOT_ID } from "../constants.js";
703 -+import { CUSTOM_HEADER_SLOT_ID, DEFAULT_THEMES, HEADER_FILENAME_SUFFIX_SLOT_ID, HEADER_METADATA_SLOT_ID, HEADER_PREFIX_SLOT_ID } from "../constants.js";
701 +@@ -1,6 +1,7 @@
702 +-import { CUSTOM_HEADER_SLOT_ID, DEFAULT_THEMES, EMPTY_LINE_ANNOTATIONS, EMPTY_RENDER_RANGE, HEADER_FILENAME_SUFFIX_SLOT_ID, HEADER_METADATA_SLOT_ID, HEADER_PREFIX_SLOT_ID } from "../constants.js";
703 ++import { CUSTOM_HEADER_SLOT_ID, DEFAULT_THEMES, EMPTY_LINE_ANNOTATIONS, HEADER_FILENAME_SUFFIX_SLOT_ID, HEADER_METADATA_SLOT_ID, HEADER_PREFIX_SLOT_ID } from "../constants.js";
704 + import { HighlighterDisposedError } from "../highlighter/highlighterType.js";
705 import { getThemes } from "../utils/getThemes.js";
706 +import { getHighlighterThemeStyles } from "../utils/getHighlighterThemeStyles.js";
707 import { getHighlighterIfLoaded, getSharedHighlighter } from "../highlighter/shared_highlighter.js";
708 import { dequeueRender, queueRender } from "../managers/UniversalRenderingManager.js";
709 import { areThemesEqual } from "../utils/areThemesEqual.js";
709 -@@ -691,11 +692,20 @@ var FileDiff = class {
710 +@@ -724,7 +725,7 @@ var FileDiff = class {
711 + if (expandUnchanged) this.loadFilesIfNecessary();
712 + this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options));
713 + this.syncInteractionOptions();
714 +- this.prepareRenderData(this.hunksRenderer.getDiffForNextRender(workingDiff));
715 ++ this.prepareRenderData(collapsed ? workingDiff : this.hunksRenderer.getDiffForNextRender(workingDiff));
716 + const { disableErrorHandling = false, disableFileHeader = false } = this.options;
717 + if (disableFileHeader) {
718 + if (this.headerElement != null) {
719 +@@ -740,11 +741,22 @@ var FileDiff = class {
720 this.removeRenderedCode();
721 this.clearAuxiliaryNodes();
722 try {
713 -- const hunksResult = this.hunksRenderer.renderDiff(latestDiff, EMPTY_RENDER_RANGE);
723 +- const hunksResult = this.hunksRenderer.renderDiff(workingDiff, EMPTY_RENDER_RANGE);
724 - if (hunksResult != null) this.applyThemeState(fileContainer, hunksResult.themeStyles, themeType, hunksResult.baseThemeType);
725 - if (hunksResult?.headerElement != null) this.applyHeaderToDOM(hunksResult.headerElement, fileContainer, hunksResult.fileDiff);
726 + // An empty render range still highlights the full diff. Headers only need the theme.
@@ -720,24 +730,26 @@ index 6f66bd3..3125fac 100644
730 + else getSharedHighlighter({
731 + themes: getThemes(theme),
732 + langs: ["text"],
723 -+ preferredHighlighter: this.workerManager?.getPreferredHighlighter() ?? this.options.preferredHighlighter
733 ++ preferredHighlighter: resolvePreferredHighlighter(this.workerManager, this.options)
734 + }).then(() => {
735 + if (this.enabled && this.fileContainer === fileContainer && this.options.collapsed && areThemesEqual(theme, this.getTheme())) this.rerender();
726 -+ }).catch((error) => console.error(error));
727 -+ if (!disableFileHeader) this.applyHeaderToDOM(this.hunksRenderer.renderHeader(latestDiff), fileContainer, latestDiff);
736 ++ }).catch((error) => {
737 ++ if (!(error instanceof HighlighterDisposedError)) console.error(error);
738 ++ });
739 ++ if (!disableFileHeader) this.applyHeaderToDOM(this.hunksRenderer.renderHeader(workingDiff), fileContainer, workingDiff);
740 this.renderSeparators([]);
729 -- this.renderedDiff = hunksResult?.fileDiff ?? latestDiff;
730 -+ this.renderedDiff = latestDiff;
741 +- this.adoptRenderData(hunksResult?.fileDiff ?? workingDiff);
742 ++ this.adoptRenderData(workingDiff);
743 this.injectUnsafeCSS();
744 } catch (error) {
745 if (disableErrorHandling) throw error;
746 diff --git a/dist/components/VirtualizedFile.d.ts b/dist/components/VirtualizedFile.d.ts
735 -index 5e68e35..79dcd88 100644
747 +index 90ef575932..0fd262cbb7 100644
748 --- a/dist/components/VirtualizedFile.d.ts
749 +++ b/dist/components/VirtualizedFile.d.ts
738 -@@ -49,7 +49,7 @@ declare class VirtualizedFile<LAnnotation = undefined, Caret = undefined> extend
739 - setVisibility(visible: boolean): void;
750 +@@ -50,7 +50,7 @@ declare class VirtualizedFile<LAnnotation = undefined, Caret = undefined> extend
751 rerender(): void;
752 + protected get isComponentManaged(): boolean;
753 syncGhostTextRows(): void;
754 - applyDocumentChange(textDocument: TextDocument<'file', LAnnotation>, newLineAnnotations?: LineAnnotation<LAnnotation>[], shouldUpdateBuffer?: boolean): void;
755 + applyDocumentChange(textDocument: TextDocument<'file', LAnnotation>, newLineAnnotations?: LineAnnotation<LAnnotation>[], shouldUpdateBuffer?: boolean, startLine?: number): void;
@@ -745,7 +757,7 @@ index 5e68e35..79dcd88 100644
757 protected finalizeRender(): void;
758 private updatePendingRender;
759 diff --git a/dist/components/VirtualizedFile.js b/dist/components/VirtualizedFile.js
748 -index d1f57cd..5908ad7 100644
760 +index 95d4ca8fdf..24a980672d 100644
761 --- a/dist/components/VirtualizedFile.js
762 +++ b/dist/components/VirtualizedFile.js
763 @@ -23,6 +23,7 @@ var VirtualizedFile = class extends File {
@@ -756,8 +768,8 @@ index d1f57cd..5908ad7 100644
768 ghostTextRows: NO_GHOST_TEXT_ROWS
769 };
770 pendingRender;
759 -@@ -35,6 +36,8 @@ var VirtualizedFile = class extends File {
760 - super(options, workerManager, isContainerManaged);
771 +@@ -34,6 +35,8 @@ var VirtualizedFile = class extends File {
772 + super(options, workerManager, requestOwnerRender);
773 this.virtualizer = virtualizer;
774 this.metrics = metrics;
775 + const simpleVirtualizer = this.getSimpleVirtualizer();
@@ -765,7 +777,7 @@ index d1f57cd..5908ad7 100644
777 }
778 setMetrics(metrics, force = false) {
779 const nextMetrics = computeVirtualFileMetrics(metrics);
768 -@@ -86,10 +89,12 @@ var VirtualizedFile = class extends File {
780 +@@ -85,10 +88,12 @@ var VirtualizedFile = class extends File {
781 if (this.isAdvancedMode()) throw new Error("VirtualizedFile.setThemeType cannot be used inside CodeView. Update CodeView options instead.");
782 super.setThemeType(themeType);
783 }
@@ -781,7 +793,7 @@ index d1f57cd..5908ad7 100644
793 if (this.cache.checkpoints.length > 0) this.cache.checkpoints.length = 0;
794 this.cache.ghostTextRows = NO_GHOST_TEXT_ROWS;
795 if (this.renderRange != null && resetRenderRange) this.renderRange = void 0;
784 -@@ -135,6 +140,13 @@ var VirtualizedFile = class extends File {
796 +@@ -134,6 +139,13 @@ var VirtualizedFile = class extends File {
797 if (this.code == null) return hasHeightChange;
798 const content = this.code.children[1];
799 if (!(content instanceof HTMLElement)) return hasHeightChange;
@@ -795,7 +807,7 @@ index d1f57cd..5908ad7 100644
807 if (this.renderRange != null && shouldRenderFileAnnotations(this.renderRange)) {
808 const nextFileAnnotationHeight = measureFileAnnotationHeight(content) ?? 0;
809 if (nextFileAnnotationHeight !== this.cache.fileAnnotationHeight) {
798 -@@ -358,12 +370,12 @@ var VirtualizedFile = class extends File {
810 +@@ -366,12 +378,12 @@ var VirtualizedFile = class extends File {
811 codeView.instanceChanged(this, true);
812 } else this.getSimpleVirtualizer()?.requestHeightReconcile(this);
813 }
@@ -811,29 +823,29 @@ index d1f57cd..5908ad7 100644
823 if (!this.isSimpleMode()) this.computeApproximateSize(true);
824 else if (shouldUpdateBuffer && previousRenderRange != null && file != null) {
825 diff --git a/dist/components/VirtualizedFileDiff.js b/dist/components/VirtualizedFileDiff.js
814 -index 96f970f..1bb59c6 100644
826 +index eb34dd4a77..821bb0ab11 100644
827 --- a/dist/components/VirtualizedFileDiff.js
828 +++ b/dist/components/VirtualizedFileDiff.js
817 -@@ -552,7 +552,7 @@ var VirtualizedFileDiff = class extends FileDiff {
829 +@@ -551,7 +551,7 @@ var VirtualizedFileDiff = class extends FileDiff {
830 rerender() {
819 - if (!this.enabled || this.fileDiff == null && this.additionFile == null && this.deletionFile == null) return;
820 - const latestDiff = this.getLatestDiff();
821 -- const nextRenderDiff = latestDiff == null ? void 0 : this.hunksRenderer.getDiffForNextRender(latestDiff);
822 -+ const nextRenderDiff = latestDiff == null || this.options.collapsed === true ? latestDiff : this.hunksRenderer.getDiffForNextRender(latestDiff);
831 + if (!this.enabled || this.getInputDiff() == null && this.additionFile == null && this.deletionFile == null) return;
832 + const workingDiff = this.getWorkingDiff();
833 +- const nextRenderDiff = workingDiff == null ? void 0 : this.hunksRenderer.getDiffForNextRender(workingDiff);
834 ++ const nextRenderDiff = workingDiff == null || this.options.collapsed === true ? workingDiff : this.hunksRenderer.getDiffForNextRender(workingDiff);
835 if (this.isSimpleMode()) this.pendingRender = void 0;
836 this.forceRenderOverride = true;
825 - this.virtualizer.instanceChanged(this, !areDiffTargetsEqual(this.getRenderedDiff(), nextRenderDiff));
826 -@@ -724,7 +724,7 @@ var VirtualizedFileDiff = class extends FileDiff {
837 + if (this.isSimpleMode() && this.requestRender()) return;
838 +@@ -731,7 +731,7 @@ var VirtualizedFileDiff = class extends FileDiff {
839 const previousRenderedDiff = this.getRenderedDiff();
840 const { pendingRender } = this;
841 const previousLayoutDiff = pendingRender?.diff ?? previousRenderedDiff;
830 -- const pendingRenderDiff = this.hunksRenderer.getDiffForNextRender(latestDiff);
831 -+ const pendingRenderDiff = this.options.collapsed === true ? latestDiff : this.hunksRenderer.getDiffForNextRender(latestDiff);
842 +- const pendingRenderDiff = this.hunksRenderer.getDiffForNextRender(workingDiff);
843 ++ const pendingRenderDiff = this.options.collapsed === true ? workingDiff : this.hunksRenderer.getDiffForNextRender(workingDiff);
844 this.pendingRender = {
833 - latestDiff,
845 + workingDiff,
846 diff: pendingRenderDiff
847 diff --git a/dist/components/web-components.js b/dist/components/web-components.js
836 -index 6e7b486..5b7290f 100644
848 +index 6e7b486a02..5b7290f181 100644
849 --- a/dist/components/web-components.js
850 +++ b/dist/components/web-components.js
851 @@ -2,8 +2,17 @@ import { DIFFS_TAG_NAME } from "../constants.js";
@@ -867,10 +879,10 @@ index 6e7b486..5b7290f 100644
879 connectedCallback() {
880 const shadowRoot = this.shadowRoot ?? this.attachShadow({ mode: "open" });
881 diff --git a/dist/editor/editor.js b/dist/editor/editor.js
870 -index 8f04a6f..c203023 100644
882 +index bf17cea32f..671e77b8cd 100644
883 --- a/dist/editor/editor.js
884 +++ b/dist/editor/editor.js
873 -@@ -1899,7 +1899,11 @@ var Editor = class {
885 +@@ -1903,7 +1903,11 @@ var Editor = class {
886 changedDocumentLines: this.#isDiff && !didLineCountChange ? getChangedDocumentLines(textDocument, change) : void 0,
887 documentLineCount: textDocument.lineCount
888 });
@@ -884,7 +896,7 @@ index 8f04a6f..c203023 100644
896 if (newLineAnnotations != null) {
897 this.#lineAnnotations = newLineAnnotations;
898 diff --git a/dist/editor/searchPanel.d.ts b/dist/editor/searchPanel.d.ts
887 -index 9542849..1c1a51f 100644
899 +index 9542849786..1c1a51f56d 100644
900 --- a/dist/editor/searchPanel.d.ts
901 +++ b/dist/editor/searchPanel.d.ts
902 @@ -15,6 +15,8 @@ interface SearchPanelOptions {
@@ -897,7 +909,7 @@ index 9542849..1c1a51f 100644
909 scrollToMatch: (nextMatch: MatchRange, retainFocus: boolean) => void;
910 applyReplace: (edits: ResolvedTextEdit[]) => void;
911 diff --git a/dist/editor/searchPanel.js b/dist/editor/searchPanel.js
900 -index df1ba63..676751b 100644
912 +index df1ba637c2..676751bb0e 100644
913 --- a/dist/editor/searchPanel.js
914 +++ b/dist/editor/searchPanel.js
915 @@ -12,7 +12,7 @@ var SearchPanelWidget = class {
@@ -919,7 +931,7 @@ index df1ba63..676751b 100644
931 this.#inputElement.select();
932 };
933 diff --git a/dist/managers/ResizeManager.d.ts b/dist/managers/ResizeManager.d.ts
922 -index 3efafc4..9e5b751 100644
934 +index 3efafc4132..9e5b7511f9 100644
935 --- a/dist/managers/ResizeManager.d.ts
936 +++ b/dist/managers/ResizeManager.d.ts
937 @@ -5,6 +5,8 @@ interface ResizeManagerSetupOptions {
@@ -932,7 +944,7 @@ index 3efafc4..9e5b751 100644
944 private static managersByElement;
945 private static getResizeObserver;
946 diff --git a/dist/managers/ResizeManager.js b/dist/managers/ResizeManager.js
935 -index 9724cb1..14145d8 100644
947 +index 9724cb1e34..14145d8329 100644
948 --- a/dist/managers/ResizeManager.js
949 +++ b/dist/managers/ResizeManager.js
950 @@ -19,6 +19,7 @@ var ResizeManager = class ResizeManager {
@@ -952,10 +964,10 @@ index 9724cb1..14145d8 100644
964 }
965 applyAnnotationUpdates(annotationUpdates) {
966 diff --git a/dist/react/CodeView.d.ts b/dist/react/CodeView.d.ts
955 -index e78e713..642b235 100644
967 +index 12e12c50cd..684c7a89fa 100644
968 --- a/dist/react/CodeView.d.ts
969 +++ b/dist/react/CodeView.d.ts
958 -@@ -56,6 +56,8 @@ interface CodeViewBaseProps<LAnnotation, Caret> {
970 +@@ -57,6 +57,8 @@ interface CodeViewBaseProps<LAnnotation, Caret> {
971 * is frozen; re-key the accepted value in place before accepting.
972 */
973 onItemEditComplete?: CodeViewItemEditCompleteHandler<LAnnotation, Caret>;
@@ -965,7 +977,7 @@ index e78e713..642b235 100644
977 renderHeaderPrefix?(item: CodeViewItem<LAnnotation>): ReactNode;
978 renderHeaderFilenameSuffix?(item: CodeViewItem<LAnnotation>): ReactNode;
979 diff --git a/dist/react/CodeView.js b/dist/react/CodeView.js
968 -index 84c7915..d1930bf 100644
980 +index 4dfed6bd0a..ac35a5a455 100644
981 --- a/dist/react/CodeView.js
982 +++ b/dist/react/CodeView.js
983 @@ -24,7 +24,7 @@ function createDefaultCache(controlled) {
@@ -1030,7 +1042,7 @@ index 84c7915..d1930bf 100644
1042 if (hasGutterRenderer) managedOptions.renderGutterUtility = noopRender;
1043 if (hasCodeViewHeader) managedOptions.renderCodeViewHeader = noopRender;
1044 diff --git a/dist/utils/createFileHeaderElement.js b/dist/utils/createFileHeaderElement.js
1033 -index 39fe30e..600442e 100644
1045 +index 39fe30e47b..600442e3eb 100644
1046 --- a/dist/utils/createFileHeaderElement.js
1047 +++ b/dist/utils/createFileHeaderElement.js
1048 @@ -73,12 +73,12 @@ function createMetadataElement(fileDiff) {
@@ -1049,10 +1061,10 @@ index 39fe30e..600442e 100644
1061 }));
1062 }
1063 diff --git a/package.json b/package.json
1052 -index d9dc7b5..3c37bae 100644
1064 +index 0cc43c4a7d..60b7d17d61 100644
1065 --- a/package.json
1066 +++ b/package.json
1055 -@@ -58,6 +58,18 @@
1067 +@@ -60,6 +60,18 @@
1068 "./worker/worker-portable.js": {
1069 "types": "./dist/worker/worker-portable.d.ts",
1070 "import": "./dist/worker/worker-portable.js"
pnpm-lock.yaml
+16 -25
@@ -264,7 +264,7 @@ overrides:
264 expo-widgets: 58.0.20
265 '@ff-labs/fff-node': 0.11.0
266 '@legendapp/list': 3.3.5
267 - '@pierre/diffs': 1.5.2
267 + '@pierre/diffs': 1.6.1
268 '@react-native-ai/apple': 0.12.0
269 '@react-native-menu/menu': 2.0.0
270 '@react-navigation/native-stack': 7.21.0
@@ -354,7 +354,7 @@ patchedDependencies:
354 '@ff-labs/fff-node@0.11.0': cc71fcec015f4d39bc96ae2e2bf6b0ca678124c722c66a7841efce9d34b5983c
355 '@legendapp/list@3.3.5': 011a862a7116ec5b5f4bba17d37bc58c9b5a8f64a6a9f527345f316ce9c96e63
356 '@muse-code/sdk@1.4.6': 7b495b607fc5d76b444c7c4d58821e839726a30e6f3c53564f0d59f2d5b42101
357 - '@pierre/diffs@1.5.2': 2ec81ba1e8ce4681095a3473c2bf78e630417740c622720ef624febb467c25fc
357 + '@pierre/diffs@1.6.1': 4645364ddf113e48e8827f3b4966b3b1ff745317011e5a3d904e2d8672dee7dc
358 '@react-native-ai/apple@0.12.0': 2d09870c2848d185cb05b53ed823a46e12dba519324d8dd8e584e28731990f9d
359 '@react-native-menu/menu@2.0.0': 910ec1bf22aa85a96fcf12299cd823bc30f702dd9b2d77b564d10b9ed709f7f6
360 '@react-navigation/native-stack@7.21.0': 990d575444c4af2ce8218b3b7a8280fe244c03abbdb32b822a2e862f791dbf42
@@ -537,8 +537,8 @@ importers:
537 specifier: 'catalog:'
538 version: 1.9.1
539 '@pierre/diffs':
540 - specifier: 1.5.2
541 - version: 1.5.2(patch_hash=2ec81ba1e8ce4681095a3473c2bf78e630417740c622720ef624febb467c25fc)(@shikijs/themes@4.2.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)
540 + specifier: 1.6.1
541 + version: 1.6.1(patch_hash=4645364ddf113e48e8827f3b4966b3b1ff745317011e5a3d904e2d8672dee7dc)(@shikijs/themes@4.2.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)
542 '@pierre/highlights':
543 specifier: 'catalog:'
544 version: 0.2.0
@@ -1022,8 +1022,8 @@ importers:
1022 specifier: 'catalog:'
1023 version: 1.8.0
1024 '@pierre/diffs':
1025 - specifier: 1.5.2
1026 - version: 1.5.2(patch_hash=2ec81ba1e8ce4681095a3473c2bf78e630417740c622720ef624febb467c25fc)(@shikijs/themes@4.2.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)
1025 + specifier: 1.6.1
1026 + version: 1.6.1(patch_hash=4645364ddf113e48e8827f3b4966b3b1ff745317011e5a3d904e2d8672dee7dc)(@shikijs/themes@4.2.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)
1027 '@pierre/trees':
1028 specifier: 1.0.0-beta.6
1029 version: 1.0.0-beta.6(@pierre/theme@2.0.0)(@shikijs/themes@4.2.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(shiki@4.2.0)
@@ -1325,8 +1325,8 @@ importers:
1325 packages/client-runtime:
1326 dependencies:
1327 '@pierre/diffs':
1328 - specifier: 1.5.2
1329 - version: 1.5.2(patch_hash=2ec81ba1e8ce4681095a3473c2bf78e630417740c622720ef624febb467c25fc)(@shikijs/themes@4.2.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)
1328 + specifier: 1.6.1
1329 + version: 1.6.1(patch_hash=4645364ddf113e48e8827f3b4966b3b1ff745317011e5a3d904e2d8672dee7dc)(@shikijs/themes@4.2.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)
1330 '@t3tools/contracts':
1331 specifier: workspace:*
1332 version: link:../contracts
@@ -5543,8 +5543,8 @@ packages:
5543 resolution: {integrity: sha512-ODOov0sGMJMf3jPonOkgGqPknTsu+DdQ7kD++gz8aI+aFMOMHFbWAA2taqXXVTdP+OTOQR/znGvSpmkeI0WTYQ==}
5544 engines: {node: '>=14.18.0'}
5545
5546 - '@pierre/diffs@1.5.2':
5547 - resolution: {integrity: sha512-QVxIWQEnNoko22k63maERzozd29+FtaUNpRrZiw603WMe5R1mFSED+jMtPkcVP3SDYS1DWg5K7sa7sJbr3xkNQ==}
5546 + '@pierre/diffs@1.6.1':
5547 + resolution: {integrity: sha512-XTfLW4bFETyosZfFNUoyRh1zPE4tmAijOoxdHx4X805tlaq/7/fuQXIiJSm21+jLkDo8vn5elQ+2O4YtMTKM0Q==}
5548 peerDependencies:
5549 react: ^18.3.1 || ^19.0.0
5550 react-dom: ^18.3.1 || ^19.0.0
@@ -5585,8 +5585,8 @@ packages:
5585 shiki:
5586 optional: true
5587
5588 - '@pierre/theming@1.0.1':
5589 - resolution: {integrity: sha512-WCI5Qd7iprDpISL9fBYOLe8RV53+b7mFNA3bPzl60/2CKCSrsKN8zEcep6Y3BAzvARlmca50zGjDodqPGiTUKA==}
5588 + '@pierre/theming@1.0.2':
5589 + resolution: {integrity: sha512-RmXLLqtx31UGcR8kZyO5hGAQ1EXz6loT1Cu0BFAGsbnBboIxp2BlomkLfWyvdT4WZXnBGyu25onL1gKpFQuSUw==}
5590 peerDependencies:
5591 '@pierre/theme': ^1.1.0 || ^2.0.0
5592 '@shikijs/themes': ^3.0.0 || ^4.0.0
@@ -6037,10 +6037,6 @@ packages:
6037 resolution: {integrity: sha512-RX8IHYeLv8Cu2W6ruc3RxUqWn0IYCqSrMBzi/uRGAmfyDNOnNO5BF/Px7o97n4XTpmFTo5GbRaazuOWj+2ak2w==}
6038 engines: {node: '>=20'}
6039
6040 - '@shikijs/transformers@4.2.0':
6041 - resolution: {integrity: sha512-pKrYVNUr1oPjJvs76gkPPirDySx3GKG9O88P2Y3AQ+7AjSFws9Y+Ry/Q/6Yg6QpyigzjdQ6H5JAMNAvLXZ63dw==}
6042 - engines: {node: '>=20'}
6043 -
6040 '@shikijs/types@4.2.0':
6041 resolution: {integrity: sha512-VT/MKtlpOhEPZloSH3Pb9WCZEBDoQVMa9jedp5UAwmJOar1DVc9DRODAxmYPW9M93IK4ryuqRejFfmlvlVDemw==}
6042 engines: {node: '>=20'}
@@ -15377,11 +15373,11 @@ snapshots:
15373 tslib: 2.8.1
15374 webcrypto-core: 1.9.2
15375
15380 - '@pierre/diffs@1.5.2(patch_hash=2ec81ba1e8ce4681095a3473c2bf78e630417740c622720ef624febb467c25fc)(@shikijs/themes@4.2.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)':
15376 + '@pierre/diffs@1.6.1(patch_hash=4645364ddf113e48e8827f3b4966b3b1ff745317011e5a3d904e2d8672dee7dc)(@shikijs/themes@4.2.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)':
15377 dependencies:
15378 + '@pierre/highlights': 0.2.0
15379 '@pierre/theme': 2.0.0
15383 - '@pierre/theming': 1.0.1(@pierre/theme@2.0.0)(@shikijs/themes@4.2.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(shiki@4.2.0)
15384 - '@shikijs/transformers': 4.2.0
15380 + '@pierre/theming': 1.0.2(@pierre/theme@2.0.0)(@shikijs/themes@4.2.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(shiki@4.2.0)
15381 diff: 9.0.0
15382 hast-util-to-html: 9.0.5
15383 lru_map: 0.4.1
@@ -15406,7 +15402,7 @@ snapshots:
15402 react-dom: 19.3.0(react@19.3.0)
15403 shiki: 4.2.0
15404
15409 - '@pierre/theming@1.0.1(@pierre/theme@2.0.0)(@shikijs/themes@4.2.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(shiki@4.2.0)':
15405 + '@pierre/theming@1.0.2(@pierre/theme@2.0.0)(@shikijs/themes@4.2.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(shiki@4.2.0)':
15406 optionalDependencies:
15407 '@pierre/theme': 2.0.0
15408 '@shikijs/themes': 4.2.0
@@ -15819,11 +15815,6 @@ snapshots:
15815 dependencies:
15816 '@shikijs/types': 4.2.0
15817
15822 - '@shikijs/transformers@4.2.0':
15823 - dependencies:
15824 - '@shikijs/core': 4.2.0
15825 - '@shikijs/types': 4.2.0
15826 -
15818 '@shikijs/types@4.2.0':
15819 dependencies:
15820 '@shikijs/vscode-textmate': 10.0.2
pnpm-workspace.yaml
+6 -3
@@ -51,7 +51,7 @@ catalog:
51 "@legendapp/list": 3.3.5
52 "@noble/curves": 1.9.1
53 "@noble/hashes": 1.8.0
54 - "@pierre/diffs": 1.5.2
54 + "@pierre/diffs": 1.6.1
55 "@pierre/highlights": 0.2.0
56 "@tailwindcss/node": 4.3.3
57 "@tailwindcss/oxide": 4.3.3
@@ -220,6 +220,9 @@ minimumReleaseAgeExclude:
220 - react-native-svg@15.16.0
221 - "@expo/schema-utils@58.0.2"
222 - pele@1.8.0
223 + - "@pierre/diffs@1.6.1"
224 + - "@pierre/highlights@0.2.0"
225 + - "@pierre/theming@1.0.2"
226
227 overrides:
228 # Pin every patched package, including transitive dependencies, so lockfile-free
@@ -235,7 +238,7 @@ overrides:
238 expo-widgets: 58.0.20
239 "@ff-labs/fff-node": 0.11.0
240 "@legendapp/list": 3.3.5
238 - "@pierre/diffs": 1.5.2
241 + "@pierre/diffs": 1.6.1
242 "@react-native-ai/apple": 0.12.0
243 "@react-native-menu/menu": 2.0.0
244 "@react-navigation/native-stack": 7.21.0
@@ -366,7 +369,7 @@ patchedDependencies:
369 "@legendapp/list@3.3.5": patches/@legendapp__list@3.3.5.patch
370 # Exports the dependency-light subpaths mobile and the web diff parser import, and keeps
371 # measured wrapped-row heights above an edit (fileEditorVirtualization.test.ts).
369 - "@pierre/diffs@1.5.2": patches/@pierre%2Fdiffs@1.5.2.patch
372 + "@pierre/diffs@1.6.1": patches/@pierre%2Fdiffs@1.6.1.patch
373 "@react-native-ai/apple@0.12.0": patches/@react-native-ai__apple@0.12.0.patch
374 "@react-native-menu/menu@2.0.0": patches/@react-native-menu__menu@2.0.0.patch
375 "@react-navigation/native-stack@7.21.0": patches/@react-navigation%2Fnative-stack@7.21.0.patch