Skip to content

Commit e3e00f0

Browse files
authored
feat(code): replace diff editor with unified review panel (#1410)
## Problem - current diff viewing experience is rough - we have a ton of cloud vs. local branching logic that shouldn't _really_ be necessary <!-- Who is this for and what problem does it solve? --> <!-- Closes #ISSUE_ID --> ## Changes | review panel | split view | deferred rendering | | --- | --- | --- | | ![Screenshot 2026-03-31 at 6.04.35 PM.png](https://app.graphite.com/user-attachments/assets/49ba2693-6872-45c6-a1b9-841fd103d928.png)<br><br> | ![Screenshot 2026-03-31 at 8.16.04 PM.png](https://app.graphite.com/user-attachments/assets/7cbcbe6f-c855-4fc5-bb11-2b7616506d76.png)<br> | ![Screenshot 2026-03-31 at 8.16.13 PM.png](https://app.graphite.com/user-attachments/assets/c0d09315-45d5-4b9b-9040-b54564c5e0ac.png)<br><br>![Screenshot 2026-03-31 at 8.16.20 PM.png](https://app.graphite.com/user-attachments/assets/51ee75a8-892f-4c91-9033-666b466bf700.png)<br> | | | | | - adds a new "review" panel that renders all diffs in one scrollable view - swaps codemirror for `@pierre/diffs` ([diffs.com](https://diffs.com/)) - shadow dom rendering w/ [web workers](https://diffs.com/docs#worker-pool) 🤓 - defers large diffs (generated, deleted, just big) - removes a ton of codemirror stuff that is no longer needed - sorta-kinda-almost unifies the rendering for cloud and local diffs - local and cloud have seperate diff views, but both share as much as possible via `ReviewShell` - removed the separate `diff` and `cloud-diff` panel types/logic, uses a single `review` tab now ## next - this is pretty fast because we're using web workers and only making a single git query to get the initial diff content for all files. HOWEVER it could be FASTER... i want to use [diffs' built-in virtualization](https://diffs.com/docs#virtualization), but could not get it to work yet, so i'll follow up on that - [#1414] will probably swap the in-chat diff for this new view, then we will only need codemirror for full file viewing (and hopefully editing at some point...) - i asked the pierre team and they are planning to make diffs editable to some extent... 👀 - adding a "comment" button per line in the diff that allows you to "ask for followups" w/ that file ref <!-- What did you change and why? --> <!-- If there are frontend changes, include screenshots. --> ## How did you test this? manually, a bunch <!-- Describe what you tested -- manual steps, automated tests, or both. --> <!-- If you're an agent, only list tests you actually ran. -->
1 parent 41d47e2 commit e3e00f0

32 files changed

Lines changed: 1667 additions & 1952 deletions

apps/code/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@
125125
"@opentelemetry/semantic-conventions": "^1.39.0",
126126
"@parcel/watcher": "^2.5.6",
127127
"@phosphor-icons/react": "^2.1.10",
128+
"@pierre/diffs": "^1.1.7",
128129
"@posthog/agent": "workspace:*",
129130
"@posthog/electron-trpc": "workspace:*",
130131
"@posthog/git": "workspace:*",

apps/code/src/renderer/features/code-editor/components/CloudDiffEditorPanel.tsx

Lines changed: 0 additions & 59 deletions
This file was deleted.

apps/code/src/renderer/features/code-editor/components/CodeMirrorDiffEditor.stories.tsx

Lines changed: 0 additions & 181 deletions
This file was deleted.

0 commit comments

Comments
 (0)