Skip to content

[diffs/edit] Update editor API#942

Merged
ije merged 6 commits into
beta-1.3from
editor/udpate-api
Jul 7, 2026
Merged

[diffs/edit] Update editor API#942
ije merged 6 commits into
beta-1.3from
editor/udpate-api

Conversation

@ije

@ije ije commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator
  • Add onFocus and onBlur callback options
  • Add setOptions method
  • Allow paste repeat for File component
  • Ignore paste repeat if custom clipboard provided

@vercel

vercel Bot commented Jul 6, 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 Jul 7, 2026 8:36am
pierre-docs-diffshub Ready Ready Preview Jul 7, 2026 8:36am
pierre-docs-trees Ready Ready Preview Jul 7, 2026 8:36am
pierrejs-diff-demo Ready Ready Preview Jul 7, 2026 8:36am

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: d4e60ddd76

ℹ️ 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 Outdated
Comment on lines +1232 to +1234
if (this.#options.clipboard !== undefined) {
e.preventDefault();
queueRender(this.#handleCustomPasteEvent);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Suppress repeated custom clipboard pastes

When a diff editor is configured with a custom clipboard provider, holding Cmd/Ctrl+V sends repeated keydown events with e.repeat === true. This branch returns before the repeat guard below, so every repeat queues #handleCustomPasteEvent, duplicating the paste and re-running the expensive diff update that the guard is meant to avoid.

Useful? React with 👍 / 👎.

@ije ije Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

handleCustomPasteEvent is for fixing repeat if a custom clipboard provide. this is recommend for electron apps which have the native clipboard API.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AFAIK a custom clipboard doesn't fix the fundamental reason for the lagging repeat paste

@ije ije Jul 7, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

reverted the repeat paste change in a185233

@ije ije merged commit 3550fcf into beta-1.3 Jul 7, 2026
8 checks passed
@ije ije deleted the editor/udpate-api branch July 7, 2026 17:31
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