AI shortcut doesn't appear near the selected text when the page is not 50% zoomed
Categories
(Core :: Machine Learning, defect, P1)
Tracking
()
People
(Reporter: cpeterson, Assigned: ngrato)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [genai])
Attachments
(5 files)
Steps to reproduce
- Enable the AI shortcut and set page zoom to 100% (default).
- Load a page (such as https://example.com) and double-click to select some text on a web page.
- See that the AI shortcut is displayed below and to the right of the selected text.
- Increase page zoom to 200% (using
Ctrl
++
) - Double-click to select some text on the page again.
Expected result
The AI shortcut should still be displayed below and to the right of the selected text.
Actual result
The AI shortcut is display far above and to the left of the selected text. The more you zoom the page, the farther above and to the left the AI shortcut is displayed. See the attached screenshot.
Comment 1•6 months ago
|
||
The severity field is not set for this bug.
:tarek, could you have a look please?
For more information, please visit BugBot documentation.
Updated•6 months ago
|
Updated•6 months ago
|
Updated•5 months ago
|
Comment 2•4 months ago
•
|
||
https://phabricator.services.mozilla.com/D226847#inline-1266845
review comment in bug 1922623 suggests this might want to be scaled with * this.contentWindow.devicePixelRatio
Comment 3•4 months ago
|
||
Updated•4 months ago
|
Comment 4•28 days ago
•
|
||
bug 1922623 landed with some devicePixelRatio calculation, but it seems to be quite wrong now when not zoomed. it's correct when zooming out to 50% https://searchfox.org/mozilla-central/rev/548b6981501f59e3c9f2f7851c013e7d53c4e72f/browser/components/genai/GenAI.sys.mjs#629-641
Comment 5•28 days ago
|
||
Comment 6•28 days ago
|
||
Comment 7•28 days ago
|
||
also, the position seems to be quite wrong for external monitors that i can't even see where it's opening up
Comment 8•28 days ago
|
||
there was a recent change perhaps bug 1931692 that seemed to break the behavior that landed with bug 1922623 that was working fine a month ago (but didn't make it to m-c yet). turns out event.screenX changes between the original mouseup event and when we access it via a setTimeout debounce
so we'll just grab the value before setTimeout
Zoom functionality was taken care of in another patch, however there was a new bug in nightly that distorted the formula to create the popup destitation. This patch fixes some scoping issues with the variables to keep the intentional values and produce an accurate placement of the popup
Comment 10•27 days ago
|
||
Comment 11•27 days ago
|
||
bugherder |
Description
•