Recommended by pocket card context menu is cut off if opened on the right side
Categories
(Firefox :: Pocket, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr78 | --- | unaffected |
firefox-esr91 | --- | unaffected |
firefox91 | --- | unaffected |
firefox92 | --- | verified |
firefox93 | --- | verified |
People
(Reporter: atrif, Assigned: thecount)
References
(Regression)
Details
(Keywords: regression)
Attachments
(2 files)
120.74 KB,
image/png
|
Details | |
48 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details | Review |
Affected versions
- 92.0b2 (20210810185524)
- 93.0a1 (20210810213316)
Affected platforms
- macOS 10.13
- Windows 10x64
Preconditions
browser.search.region:US
Steps to reproduce
- Open Firefox and a new tab.
- Click on the Open Menu from the right side pocket card.
Expected result
- Menu is displayed as expected on the left side.
Actual result
- Menu is cut off and opened on the right side.
Regression range
- Last good revision: ff220475fee8b11104548853a74b021a1718f47e
First bad revision: 120f83c79d5c22ea8cf344bd901de79333dc035b
Pushlog:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=ff220475fee8b11104548853a74b021a1718f47e&tochange=120f83c79d5c22ea8cf344bd901de79333dc035b
Notes
- Attached a screenshot.
Reporter | ||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Comment 1•3 years ago
|
||
I suspect the sizing of the popup is not waiting for the UI to be localized and the recent change to l10n microtask exposed this bug.
The way to fix this is to improve the code to wait for DOM Fragment to be localized before sizing it.
Comment 2•3 years ago
|
||
:zbraniecki do you have thoughts on how to move this bug forward.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 4•3 years ago
|
||
I can take a look today.
Assignee | ||
Comment 5•3 years ago
|
||
The code in question is here.
I think I just need to know when the DOM Fragment is localized. Is there an event or some way to determine that?
Comment 6•3 years ago
|
||
I think I just need to know when the DOM Fragment is localized. Is there an event or some way to determine that?
Can you show where the l10n is applied?
I agree that rAF
is a perfect way to introduce intermittent bug, so I'm glad we're moving away from it. What it should be replaced with depends on how the l10n binding is constructed.
Assignee | ||
Comment 7•3 years ago
|
||
If I understand you, the l10n binding is happening with data-l10n-id
, these menu items get that set here: https://searchfox.org/mozilla-central/source/browser/components/newtab/content-src/components/ContextMenu/ContextMenu.jsx#170
Unfortunately, there is a significant amount of abstraction from the Pocket panel calling rAF
to the actual setting of data-l10n-id
, that I might need to work around.
Hopefully that helps answer the question.
Comment 8•3 years ago
|
||
Ok, that's quite imperfect because what you really would want to do is:
let fragment = document.createDocumentFragment(```
<div data-l10n-id="key1"/>
```);
await document.l10n.translateFragment(fragment);
root.appendChild(fragment);
this would guarantee that when you inject the fragment it is localized.
In the absence of that, you can just force-translate which will in the worst case re-translate a fragment:
await document.l10n.translateFragment(myFragment);
readTheSizing();
Comment 9•3 years ago
|
||
I'll see hat I can do with that tomorrow.
If that doesn't work well, we could also use a mutation observer on the element and resized once the mutation observer fires with a non 0 width?
A hack, but seems pretty straight forward.
In theory one the localization is done it should update the contents of the element, and trigger the mutation observer.
Comment 10•3 years ago
|
||
I can't see a reason that forced translation might not work, but a mutation observer would be an acceptable fallback if I'm wrong.
Assignee | ||
Comment 11•3 years ago
|
||
Assignee | ||
Comment 12•3 years ago
|
||
I think I've got a patch for this, with a test to cover this in the future. I put you down as an optional review, feel free to take a look if you want.
The solution to force-translate to re-translate a fragment actually worked pretty well, so went with that.
Updated•3 years ago
|
Assignee | ||
Comment 13•3 years ago
|
||
Comment on attachment 9237104 [details]
Bug 1725160 - Fixing newtab Pocket context menu position.
Beta/Release Uplift Approval Request
-
User impact if declined: User experience
-
Is this code covered by automated tests?: Yes
-
Has the fix been verified in Nightly?: No
-
Needs manual test from QE?: Yes
-
If yes, steps to reproduce: Steps to reproduce
Open Firefox and a new tab.
Click on the Open Menu from the right side pocket card.
Expected result
Menu is displayed as expected on the left side.
Actual result
Menu is cut off and opened on the right side.
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): It's a pretty small js change.
- String changes made/needed: none
Assignee | ||
Updated•3 years ago
|
Comment 14•3 years ago
|
||
Backed out for causing failures at browser_newtab_last_LinkMenu.js.
Backout link: https://hg.mozilla.org/integration/autoland/rev/fda866f16b6f8e8b24ac7869dc5c27af011143c5
Failure log: https://treeherder.mozilla.org/logviewer?job_id=349552301&repo=autoland&lineNumber=6372
Comment 15•3 years ago
|
||
Pushed by sdowne@getpocket.com: https://hg.mozilla.org/integration/autoland/rev/26433f71bd48 Fixing newtab Pocket context menu position. r=gvn,zbraniecki
Comment 16•3 years ago
|
||
bugherder |
Comment 17•3 years ago
|
||
Comment on attachment 9237104 [details]
Bug 1725160 - Fixing newtab Pocket context menu position.
Thanks for getting this fixed in time. Approved for 92.0b9.
Comment 18•3 years ago
|
||
bugherder uplift |
Updated•3 years ago
|
Reporter | ||
Comment 19•3 years ago
|
||
Verified fixed with 93.0a1 (20210829215733) and 92.0b9 (20210826192006) on Windows 10x64, macOS 10.15 and Ubuntu 21.04. The Pocket context menu is opened as expected if triggered from the right side.
Description
•