Skip to content

feat(editor): Add rounded selection#757

Merged
ije merged 8 commits into
beta-1.3from
editor/rounded-selection
Jun 2, 2026
Merged

feat(editor): Add rounded selection#757
ije merged 8 commits into
beta-1.3from
editor/rounded-selection

Conversation

@ije
Copy link
Copy Markdown
Collaborator

@ije ije commented Jun 1, 2026

Screenshot 2026-06-01 at 08 54 36

image

Can be disabled by adding:

import { Editor } from "@pierre/diffs/editor"
const editor = new Editor({ roundedSelection: false })

Copilot AI review requested due to automatic review settings June 1, 2026 01:05
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

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

Project Deployment Actions Updated (UTC)
pierre-docs-diffshub Ready Ready Preview Jun 2, 2026 2:29am
pierre-docs-trees Ready Ready Preview Jun 2, 2026 2:29am
pierrejs-diff-demo Ready Ready Preview Jun 2, 2026 2:29am
pierrejs-docs Ready Ready Preview Jun 2, 2026 2:29am

Request Review

Copy link
Copy Markdown

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

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: 292fc8c32b

ℹ️ 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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds configurable rounded selection rendering to the diffs editor, updating selection range rendering and CSS while also reorganizing nearby editor-related types.

Changes:

  • Adds roundedSelection to EditorOptions.
  • Reworks selection range rendering to support rounded-corner overlays.
  • Adds CSS selectors for rounded selection corners and renames component option types.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
packages/diffs/src/types.ts Renames/reorders editor and component-related exported interfaces.
packages/diffs/src/editor/editor.ts Adds rounded-selection option and rewrites selection rendering/caching logic.
packages/diffs/src/editor/css.ts Adds CSS rules for rounded selection corner rendering.
Comments suppressed due to low confidence (1)

packages/diffs/src/types.ts:896

  • Renaming the exported DiffsEditorOptions type without leaving an alias is a public API break: types.ts is re-exported from src/index.ts, and there are no remaining DiffsEditorOptions exports. Existing consumers importing this type will fail to compile even though this PR is about selection rendering.
export interface DiffsComponentOptions extends BaseCodeOptions {
  enableGutterUtility?: boolean;
  enableLineSelection?: boolean;
  expandUnchanged?: boolean;
  lineHoverHighlight?: 'disabled' | 'both' | 'number' | 'line';
}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/diffs/src/editor/editor.ts Outdated
Comment thread packages/diffs/src/editor/editor.ts Outdated
Comment thread packages/diffs/src/editor/editor.ts
Comment thread packages/diffs/src/editor/editor.ts
Comment thread packages/diffs/src/editor/css.ts Outdated
Comment thread packages/diffs/src/editor/editor.ts Outdated
Comment thread packages/diffs/src/editor/editor.ts
Copy link
Copy Markdown
Member

@amadeus amadeus left a comment

Choose a reason for hiding this comment

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

lookin sharp!

Comment thread packages/diffs/src/editor/editor.ts Outdated
return;
}
const lineIndex = Number(lineNumber) - 1;
const line = Number(lineNumber) - 1;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would it be worth doing parseInt(lineNumber, 10) on this and error/silently fail if isNaN(line)?

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.

fixed

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.

3 participants