Skip to content

Commit 605508f

Browse files
chore(web): upgrade @pierre/diffs to 1.7 and use its built-in find
Pierre 1.7 ships Cmd/Ctrl+F for CodeView, so the find UI we carried in our patch is gone. The patch drops from 1096 to 298 lines and keeps only what upstream does not cover yet: - find also searches folded files and collapsed diff context, and asks the host to unfold a file through onRevealSearchMatch - with every file folded, the first match in document order is selected - closing the find panel returns focus to the viewer, so the shortcut keeps working - the unrelated fixes we already carried (collapsed headers without a full highlight, empty-selection clear, localized counts, subpath exports) The wrapped-row height hunk is dropped: 1.7 keeps measured heights across edits itself. @pierre/highlights moves to 0.5.0 with it, so the mobile native glue is regenerated for the new input offset and language table. Co-Authored-By: Claude Fable 5.2 <[email protected]>
1 parent ee59ab2 commit 605508f

21 files changed

Lines changed: 151901 additions & 79622 deletions

‎apps/mobile/modules/t3-highlights/Vendor/highlights/highlights.c‎

Lines changed: 151088 additions & 77815 deletions
Large diffs are not rendered by default.

‎apps/mobile/modules/t3-highlights/Vendor/highlights/highlights.h‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by apps/mobile/scripts/generate-highlights.mts from @pierre/highlights 0.2.0 (highlights.wasm sha256 cf5fc4d83e7c1ddab19d163de096f787f87efe61504909aa469434f61ef51e2e). Do not edit. */
1+
/* Generated by apps/mobile/scripts/generate-highlights.mts from @pierre/highlights 0.5.0 (highlights.wasm sha256 2fca61b661e57cb341d9ca1703780dab628f29594fee66c2919d0a0032b11290). Do not edit. */
22
/* Automatically generated by wasm2c */
33
#ifndef HIGHLIGHTS_H_GENERATED_
44
#define HIGHLIGHTS_H_GENERATED_
@@ -40,7 +40,7 @@ typedef struct w2c_highlights {
4040
u32 w2c_g8;
4141
u32 w2c_g9;
4242
u32 w2c_g10;
43-
u64 w2c_g11;
43+
u32 w2c_g11;
4444
u32 w2c_g12;
4545
u32 w2c_g13;
4646
u32 w2c_g14;
@@ -93,7 +93,7 @@ typedef struct w2c_highlights {
9393
u32 w2c_g61;
9494
u32 w2c_g62;
9595
u32 w2c_g63;
96-
u32 w2c_g64;
96+
u64 w2c_g64;
9797
u32 w2c_g65;
9898
u32 w2c_g66;
9999
u32 w2c_g67;
@@ -153,6 +153,11 @@ typedef struct w2c_highlights {
153153
u32 w2c_g121;
154154
u32 w2c_g122;
155155
u32 w2c_g123;
156+
u32 w2c_g124;
157+
u32 w2c_g125;
158+
u32 w2c_g126;
159+
u32 w2c_g127;
160+
u32 w2c_g128;
156161
wasm_rt_memory_t w2c_memory;
157162
wasm_rt_funcref_table_t w2c_T0;
158163
} w2c_highlights;

‎apps/mobile/modules/t3-highlights/cpp/t3_highlights.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
// The control block and buffer layout mirror the JavaScript glue in
1010
// @pierre/highlights (`HighlightsHighlighter` in dist/highlighter.js).
11-
#define INPUT_OFFSET WASM_DEFAULT_PAGE_SIZE
11+
// INPUT_OFFSET is its `inputPtr`: the lexers' static data ends there.
12+
#define INPUT_OFFSET 81920u
1213
#define INPUT_PADDING 96u
1314
#define MODE_UTF16_LINE_RECORDS 3u
1415
// Like the JavaScript glue, a small input after a large one gets a fresh
@@ -107,7 +108,9 @@ int64_t t3_highlights_tokenize(const uint8_t* source, size_t length, uint8_t lan
107108
ensure_instance();
108109

109110
wasm_rt_memory_t* memory = w2c_highlights_memory(&instance);
110-
uint64_t needed_pages = 1 + (length + INPUT_PADDING + WASM_DEFAULT_PAGE_SIZE - 1) / WASM_DEFAULT_PAGE_SIZE;
111+
uint64_t needed_pages =
112+
((uint64_t)INPUT_OFFSET + length + INPUT_PADDING + WASM_DEFAULT_PAGE_SIZE - 1) /
113+
WASM_DEFAULT_PAGE_SIZE;
111114
if (needed_pages > memory->pages &&
112115
wasm_rt_grow_memory(memory, needed_pages - memory->pages) == (uint64_t)-1) {
113116
return -1;

‎apps/mobile/src/features/review/reviewModel.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,9 @@ export function buildReviewParsedDiff(
609609
try {
610610
const cacheKey = buildPatchCacheKey(text, cacheScope);
611611
const patchId = getReviewPatchId(cacheKey);
612-
const parsedPatches = runDiffParserSilently(() => parsePatchFiles(text, cacheKey));
612+
const parsedPatches = runDiffParserSilently(() =>
613+
parsePatchFiles(text, { cacheKeyPrefix: cacheKey }),
614+
);
613615
const rawFiles = new Map<string, string | null>();
614616
if (!truncated) {
615617
for (const rawFile of text.split(/(?=^diff --git )/m)) {

0 commit comments

Comments
 (0)