Skip to content

MouseEventManager / LineSelectionManager -> InteractionManager Refactor#362

Merged
amadeus merged 5 commits intomainfrom
amadeus/interaction-manager
Feb 27, 2026
Merged

MouseEventManager / LineSelectionManager -> InteractionManager Refactor#362
amadeus merged 5 commits intomainfrom
amadeus/interaction-manager

Conversation

@amadeus
Copy link
Member

@amadeus amadeus commented Feb 27, 2026

Basically LineSelectionManager and MouseEventManager were doing very similar but different things, and were starting to need similar types of state to react to, so I decided to merge them into a singular manager.

This was mostly done with AI and a lot of back and forth. I think it's definitely an improvement, and will fix up some of the functionality with some of the existing features (like allowing drag select from the gutter utility)

@vercel
Copy link

vercel bot commented Feb 27, 2026

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

Project Deployment Actions Updated (UTC)
pierrejs-diff-demo Ready Ready Preview Feb 27, 2026 1:53am
pierrejs-docs Ready Ready Preview Feb 27, 2026 1:53am

Request Review

* combines MouseEventManager & InteractionManager
* Mostly because there was a lot of shared logic and it keeps a lot of
  things better combines.
* This was mostly an AI refactor, but I think it should be in a good
  place
Copy link
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
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

Copilot reviewed 18 out of 18 changed files in this pull request and generated 5 comments.


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

@amadeus amadeus merged commit a2f5ee9 into main Feb 27, 2026
8 checks passed
@amadeus amadeus deleted the amadeus/interaction-manager branch February 27, 2026 01:54
Copy link
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

Copilot reviewed 18 out of 18 changed files in this pull request and generated 5 comments.


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

// onLineSelectionEnd(props) {
// console.log('onLineSelectionEnd', props);
// },
// Super noisy, but for debuggin
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

Typo in comment: "debuggin" should be "debugging".

Suggested change
// Super noisy, but for debuggin
// Super noisy, but for debugging

Copilot uses AI. Check for mistakes.
const len = content.children.length;
if (len !== gutter.children.length) {
throw new Error(
'InteractionManager.renderSelection: gutter and content children dont match, something is wrong'
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

Typo in error message: "dont" should be "don't".

Suggested change
'InteractionManager.renderSelection: gutter and content children dont match, something is wrong'
"InteractionManager.renderSelection: gutter and content children don't match, something is wrong"

Copilot uses AI. Check for mistakes.
if (this.queuedSelectionRender != null) {
cancelAnimationFrame(this.queuedSelectionRender);
this.queuedSelectionRender = undefined;
}
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

The attribute 'data-interactive-line-numbers' is removed twice in the cleanUp method - once at line 192 and again at line 204. This is redundant and should be removed.

Copilot uses AI. Check for mistakes.
// console.log('onLineLeave', props.annotationSide, props.lineNumber);
// console.log('onLineLeave', props);
// },
// __debugMouseEvents: 'click',
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

The option name has changed from __debugMouseEvents to __debugPointerEvents in the InteractionManager, but this commented-out code still references the old name. This should be updated to __debugPointerEvents for consistency.

Suggested change
// __debugMouseEvents: 'click',
// __debugPointerEvents: 'click',

Copilot uses AI. Check for mistakes.
// onLineSelectionEnd(props) {
// console.log('onLineSelectionEnd', props);
// },
// Super noisy, but for debuggin
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

Typo in comment: "debuggin" should be "debugging".

Suggested change
// Super noisy, but for debuggin
// Super noisy, but for debugging

Copilot uses AI. Check for mistakes.
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