chore(deps): upgrade @pierre/diffs to 1.5.2 and @pierre/trees to beta.6 #16644
main fromrefs/pull/16644/head·merged by juliusmarminge View on GitHubProblem#
We pinned @pierre/diffs at 1.3.0-beta.10 with a five-hunk local patch, and @pierre/trees at 1.0.0-beta.4. Since then Pierre shipped 1.3 through 1.5.2, with parser, worker and virtualization fixes. 1.4 also replaced the editor API that the editable Files panel uses.
Bumping it directly causes two regressions:
- Since 1.3.6, Pierre highlights an active edit session on the main thread. Our Files panel is always in edit mode, so opening ChatView.tsx (11.7k lines) froze the UI for 3.9–4.4 s (#8356 again).
- The wrapped-row height fix from #10018 is not upstream. Without it, the scroll jump in #7907 returns.
Change#
- Bump:
@pierre/diffs1.5.2 and@pierre/trees1.0.0-beta.6. - Files editor: moved to the 1.4 edit API (
@pierre/diffs/edit,edit,onEditChange,EditProvider createEditor).- The panel stays read-only until the worker's highlight has painted, then attaches the editor. The editor reuses that result, so no file is highlighted on the main thread.
- Plain text, files past Pierre's tokenize limit, and failed worker highlights become editable immediately, as before.
- The editor owns the draft. Our own saves echoing back keep the file's identity; a change from elsewhere replaces it.
- Patch: cut from five hunks to two.
- Quoted file names: the parser now decodes git-quoted names itself, including
---/+++-only patches. SoresolveFileDiffPathand mobilereviewModelno longer unquote a second time. That second pass turnedback\slash.txtintobackslash.txt.
Upstream changes that come with the bump:
src/Dockerfile,build/Makefile,tools/BUILD,.starand.odinfiles get syntax highlighting.- Hunk counts in truncated patches are repaired.
- A worker that fails to start gives up after 10 s instead of loading forever.
Scope and approval#
Maintainer-requested dependency bump (Julius). It touches web and mobile only because they import the same Pierre packages. #10508 edits the old patch file and will need rebasing onto this one.
Verification#
Main-thread time while opening the 11.7k-line ChatView.tsx in the Files panel. Measured with a longtask observer, same scratch repo, headless Chromium, three runs each.
| Build | Longest task while opening | Becomes editable after click |
|---|---|---|
main (beta.10) | 228, 118, 110 ms | immediately; highlight lands ~2 s later |
| this PR, editor attached on open | 4403, 3868 ms | ~4.5 s |
| this PR | 156, 118, 109 ms | when the highlight paints, ~2.2 s |
Highlighting for a nested docker/Dockerfile. Same file and viewport.
Before (main) | After |
|---|---|
![]() | ![]() |
Real browser, scratch repo (no real files edited), with no console errors:
- Typing saves to disk and focus stays in the editor.
- An external edit on disk is adopted without a manual refresh.
- Undo walks back the in-app edits and stops at the external change.
- A review comment on L5–L7 follows its lines when lines are inserted above it, and the composer gets the matching chip.
Tests:
fileEditorVirtualization.test.ts: 29/29 pass with the patch; 15 fail without its wrapped-row hunks.diffRendering.test.tsadds a literal-backslash case.StyledDiffCodeView.test.tsxnow expects Pierre's 10 s worker-start timeout for a held pool.fileEditorHighlight.test.tsandfileEditorLanguageReadiness.test.tsare deleted. They exercised the two patch hunks upstream now owns, by driving renderer internals that 1.5 replaced.- Focused run: 104 tests across the 8 touched files pass. Web and mobile typecheck pass, the web production build passes, and no new lint warnings.
Not verified:
- Mobile on a device. Covered only by typecheck and
reviewModel/shikiReviewHighlightertests. - A recording of the freeze. I couldn't capture one reliably headless, so the long-task table stands in for it.
Behavior change: the undo history no longer survives closing a file and reopening it; edits within a session undo as before.
🤖 Generated with Claude Code — Claude Opus 5.5 (1M context)
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XL
juliusmarminge added labelsmacroscope-review
Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Provider Metric Main baseline This PR Impact PR ceiling Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅ Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅ Codex Live turn WebSocket decoded 20.9 KiB 20.9 KiB 0 B (0.0%) 29.3 KiB ✅ Codex Live turn messages 2 2 0 (0.0%) 8 ✅ Claude Total thread wire 5.0 KiB 5.0 KiB −24 B (−0.5%) 6.8 KiB ✅ Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB −24 B (−2.0%) 2.0 KiB ✅ Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB −41 B (−0.2%) 29.3 KiB ✅ Claude Live turn messages 2 1 −1 (−50.0%) 8 ✅ Baseline:
517188b· PR result:799d365· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 108.5 KiB
- Claude decoded thread snapshot: 108.8 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Team
- Run ID:
22351285-37c9-441d-a84b-bb0c4958b680
📥 Commits
Reviewing files that changed from the base of the PR and between 517188b3caa135bc09ec0a4f93474ef17c8b5c4f and 799d36569e149ec994ea3f658604cda71ee239f7.
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (21)
apps/mobile/package.jsonapps/mobile/src/features/review/reviewModel.tsapps/web/package.jsonapps/web/src/components/diffs/AnnotatableCodeView.tsxapps/web/src/components/diffs/StyledDiffCodeView.test.tsxapps/web/src/components/diffs/StyledDiffCodeView.tsxapps/web/src/components/files/FilePreviewPanel.tsxapps/web/src/components/files/ReadOnlySourcePreview.tsxapps/web/src/components/files/fileContentRevision.test.tsapps/web/src/components/files/fileContentRevision.tsapps/web/src/components/files/fileEditorHighlight.test.tsapps/web/src/components/files/fileEditorLanguageReadiness.test.tsapps/web/src/components/files/fileEditorVirtualization.test.tsapps/web/src/components/files/projectFilesQueryState.tsapps/web/src/components/pullRequest/PullRequestCodeTab.tsxapps/web/src/lib/diffRendering.test.tsapps/web/src/lib/diffRendering.tsapps/web/vite.config.tspatches/@pierre%2Fdiffs@1.3.0-beta.10.patchpatches/@pierre%2Fdiffs@1.5.2.patchpnpm-workspace.yaml
💤 Files with no reviewable changes (4)
- apps/web/src/components/files/fileEditorHighlight.test.ts
- apps/web/src/components/files/fileContentRevision.ts
- apps/web/src/components/files/fileEditorLanguageReadiness.test.ts
- patches/@pierre%2Fdiffs@1.3.0-beta.10.patch
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
📝 Walkthrough
Walkthrough#
The PR upgrades Pierre packages and updates their local diff patch. It migrates editable file previews to the edit API, updates diff viewer types, and changes mobile and web review path mapping to use parser-provided names directly.
Changes#
Pierre editor and diff integration
Layer / File(s) Summary Upgrade Pierre packages and patch
apps/mobile/package.json,apps/web/package.json,pnpm-workspace.yaml,patches/*,apps/web/vite.config.ts,apps/web/src/components/files/fileEditorVirtualization.test.tsThe @pierre/diffscatalog version changes to 1.5.2, and its local patch is updated with partial layout-cache invalidation, resize reconciliation, and package exports. The app dependency and Vite entry point are updated. Virtualization tests use the new edit API.Update diff viewer types and tests
apps/web/src/components/diffs/*,apps/web/src/components/files/ReadOnlySourcePreview.tsx,apps/web/src/components/pullRequest/PullRequestCodeTab.tsxDiff viewer props, handles, and callback types specify undefinedas the second generic argument. The worker initialization timeout test expects a rejection.Migrate editable file previews
apps/web/src/components/files/FilePreviewPanel.tsx,apps/web/src/components/files/projectFilesQueryState.ts,apps/web/src/components/files/fileContentRevision*,apps/web/src/components/files/fileEditor*Readiness.test.ts,apps/web/src/components/files/fileEditorHighlight.test.tsFilePreviewPaneluses the edit API and tracks editor changes and highlight readiness. Query state exposes the current project file contents. The editor-specific cache-key helper and two editor test files are removed.Preserve parser-provided Git paths
apps/mobile/src/features/review/reviewModel.ts,apps/web/src/lib/diffRendering.ts,apps/web/src/lib/diffRendering.test.tsMobile and web path mapping no longer unquotes parser-provided names. A web test checks that a quoted path containing an escaped backslash resolves with a literal backslash. Priority: ➖ Normal
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Other
Sequence Diagram(s)#
sequenceDiagram participant FilePreviewPanel participant WorkerPool participant FileRenderer participant ProjectFileQuery participant SaveQueue FilePreviewPanel->>WorkerPool: Prime highlighting WorkerPool->>FilePreviewPanel: Return highlight result FilePreviewPanel->>FileRenderer: Provide file contents and edit readiness FileRenderer->>FilePreviewPanel: Send editor change FilePreviewPanel->>ProjectFileQuery: Update optimistic contents FilePreviewPanel->>SaveQueue: Queue changed contentsSuggested reviewers:
t3dotgg,maria-rcksMerge Risk: ⚪ Minimal · up to
799d3No actionable merge-blocking issue remains after the reviewed changes and normal checks.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation Title check ✅ Passed The title clearly and concisely identifies the dependency upgrades, which are the primary changes in the pull request. Description check ✅ Passed The description covers the problem, changes, scope and approval, verification results, unverified items, and the undo-history behavior change. It provides focused test and build results and includes U… Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request. ✨ Finishing Touches
📝 Generate docstrings
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
- Commit to this branch
- Create a new PR
- Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment `@coderabbitai help` to get the list of available commands.juliusmarminge merged thisf8ed2a0
juliusmarminge closed this
Sign in to join this conversation.


Approvability#
Verdict: Not approved
Macroscope's review found this PR not approvable — This dependency upgrade also rewires the production file editor and diff renderer, including worker-highlight readiness, edit synchronization, virtualization, and cache behavior. The changes span user-facing web and mobile review paths and are broader than routine dependency maintenance.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).