Skip to content

[diffs/editor] Support unified diff - #818

Merged
mdo merged 2 commits into
beta-1.3from
editor/unified-diff
Jun 17, 2026
Merged

[diffs/editor] Support unified diff#818
mdo merged 2 commits into
beta-1.3from
editor/unified-diff

Conversation

@ije

@ije ije commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator
  • Allow 'unified' layout on an editor attach to the file diff component
  • Inline-edit doesn't trigger re-render now
  • refresh view when typing

@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pierre-docs-diffs Ready Ready Preview Jun 17, 2026 5:17pm
pierre-docs-diffshub Ready Ready Preview Jun 17, 2026 5:17pm
pierre-docs-trees Ready Ready Preview Jun 17, 2026 5:17pm
pierrejs-diff-demo Ready Ready Preview Jun 17, 2026 5:17pm

Request Review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d71b89d5fd

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/diffs/src/editor/editor.ts
Comment thread packages/diffs/src/components/FileDiff.ts
mdo added 2 commits June 17, 2026 10:09
… edit

Allow the editor to edit unified diffs by syncing the render view against
the FileDiff metadata (additions) instead of a separate addition file, and
mark deletion/annotation lines non-editable in unified mode. Replace the
post-edit `updateLineType` path with `refreshDiffView`/`fastRefreshDiffView`
so the diff view re-renders correctly after edits.
Include `mode` in the editable surface memo deps so switching modes
recreates the surface instead of reusing a stale instance.
@mdo
mdo force-pushed the editor/unified-diff branch from 16f8a0f to de14318 Compare June 17, 2026 17:16
@mdo

mdo commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Tested this out locally in my own branch, so merging!

@mdo
mdo merged commit 5c1e03a into beta-1.3 Jun 17, 2026
8 checks passed
@mdo
mdo deleted the editor/unified-diff branch June 17, 2026 20:02
amadeus pushed a commit that referenced this pull request Jun 22, 2026
* [diffs/editor] Support editing unified diffs and refresh diff view on edit

Allow the editor to edit unified diffs by syncing the render view against
the FileDiff metadata (additions) instead of a separate addition file, and
mark deletion/annotation lines non-editable in unified mode. Replace the
post-edit `updateLineType` path with `refreshDiffView`/`fastRefreshDiffView`
so the diff view re-renders correctly after edits.

* Fix home live editor reset when toggling mode

Include `mode` in the editable surface memo deps so switching modes
recreates the surface instead of reusing a stale instance.

---------

Co-authored-by: Mark Otto <markdotto@gmail.com>
amadeus pushed a commit that referenced this pull request Jun 24, 2026
* [diffs/editor] Support editing unified diffs and refresh diff view on edit

Allow the editor to edit unified diffs by syncing the render view against
the FileDiff metadata (additions) instead of a separate addition file, and
mark deletion/annotation lines non-editable in unified mode. Replace the
post-edit `updateLineType` path with `refreshDiffView`/`fastRefreshDiffView`
so the diff view re-renders correctly after edits.

* Fix home live editor reset when toggling mode

Include `mode` in the editable surface memo deps so switching modes
recreates the surface instead of reusing a stale instance.

---------

Co-authored-by: Mark Otto <markdotto@gmail.com>
amadeus pushed a commit that referenced this pull request Jun 24, 2026
* [diffs/editor] Support editing unified diffs and refresh diff view on edit

Allow the editor to edit unified diffs by syncing the render view against
the FileDiff metadata (additions) instead of a separate addition file, and
mark deletion/annotation lines non-editable in unified mode. Replace the
post-edit `updateLineType` path with `refreshDiffView`/`fastRefreshDiffView`
so the diff view re-renders correctly after edits.

* Fix home live editor reset when toggling mode

Include `mode` in the editable surface memo deps so switching modes
recreates the surface instead of reusing a stale instance.

---------

Co-authored-by: Mark Otto <markdotto@gmail.com>
tjni pushed a commit to tjni/pierre that referenced this pull request Jun 25, 2026
* [diffs/editor] Support editing unified diffs and refresh diff view on edit

Allow the editor to edit unified diffs by syncing the render view against
the FileDiff metadata (additions) instead of a separate addition file, and
mark deletion/annotation lines non-editable in unified mode. Replace the
post-edit `updateLineType` path with `refreshDiffView`/`fastRefreshDiffView`
so the diff view re-renders correctly after edits.

* Fix home live editor reset when toggling mode

Include `mode` in the editable surface memo deps so switching modes
recreates the surface instead of reusing a stale instance.

---------

Co-authored-by: Mark Otto <markdotto@gmail.com>
amadeus pushed a commit that referenced this pull request Jul 21, 2026
* [diffs/editor] Support editing unified diffs and refresh diff view on edit

Allow the editor to edit unified diffs by syncing the render view against
the FileDiff metadata (additions) instead of a separate addition file, and
mark deletion/annotation lines non-editable in unified mode. Replace the
post-edit `updateLineType` path with `refreshDiffView`/`fastRefreshDiffView`
so the diff view re-renders correctly after edits.

* Fix home live editor reset when toggling mode

Include `mode` in the editable surface memo deps so switching modes
recreates the surface instead of reusing a stale instance.

---------

Co-authored-by: Mark Otto <markdotto@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants