Skip to content

Feat/highlight engine improvements#4

Merged
SamridhiShreyaa merged 2 commits into
mainfrom
feat/highlight-engine-improvements
Jun 18, 2026
Merged

Feat/highlight engine improvements#4
SamridhiShreyaa merged 2 commits into
mainfrom
feat/highlight-engine-improvements

Conversation

@SamridhiShreyaa

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings June 18, 2026 06:09
@SamridhiShreyaa
SamridhiShreyaa merged commit ef25103 into main Jun 18, 2026
1 check passed

Copilot AI 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.

Pull request overview

This PR improves the highlight/selection UX in the content script by adjusting where the floating toolbar appears, preventing it from appearing in editable inputs, and blocking highlight creation while an AI response is streaming (to avoid DOM/range instability).

Changes:

  • Reposition the floating selection toolbar to appear below the selection and clamp it to viewport bounds.
  • Add “streaming” detection to prevent creating highlights while the page is actively updating response content.
  • Suppress the toolbar when the selection occurs inside input-like/editable areas; increase mouseup debounce delay.

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

Comment thread content.js
Comment on lines +473 to +477
top = Math.min(top, scrollY + viewportHeight - toolbarHeight - 8);
left = Math.max(4, Math.min(left, scrollX + viewportWidth - toolbarWidth - 8));

tb.style.top = top + "px";
tb.style.left = left + "px";
Comment thread content.js
Comment on lines +497 to +503
function isNodeInInputArea(node) {
if (!node) return false;
let el = node.nodeType === Node.TEXT_NODE ? node.parentElement : node;
return !!el.closest(
'[contenteditable="true"], textarea, input, [data-testid*="input"], [role="textbox"], [role="combobox"]'
);
}
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