Open Bug 1649513 Opened 4 years ago Updated 4 years ago

Only update the bookmark menu labels when menu panel is shown to avoid busy-work

Categories

(Firefox :: Bookmarks & History, task, P3)

task

Tracking

()

People

(Reporter: emmamalysz, Unassigned)

References

Details

We currently update menu labels in the menubar in updateBookmarkPageMenuItem (https://searchfox.org/mozilla-central/source/browser/base/content/browser-places.js#1700,1707).

In Bug 1648613, we are lazily loading this panel, so there is a chance that this could cause the old label to flicker (the l10nid has to update and that's async). We should move the updating work to onPanelMenuViewShowing instead.

I think in my comment I was not very clear: I don't think the current code would cause flickering (though it's certainly possible I'm wrong about this!). I think if we move the updating to happen only when the view is shown, that could in theory cause flickering. To work around this, when the ViewShowing event fires we have an opportunity to add a "blocker" promise, which could be one that waits for the translation to have been rendered (see an example of the blocker mechanism in e.g. https://searchfox.org/mozilla-central/rev/5a4aaccb28665807a6fd49cf48367d47fbb5a19a/browser/components/downloads/DownloadsSubview.jsm#241-255 )

An alternative solution could be to have 2 elements, one with each string, and just show/hide the "right" element.

The original motivation of the suggestion to update from the event was performance: the current code updates elements that are not visible, which is a waste of time.

Summary: Update bookmark menu labels when menu panel is shown to avoid flicker → Only update the bookmark menu labels when menu panel is shown to avoid busy-work

Note that the Mac native menubar cannot be updated when it's being shown, and likely that's why this is done like this.

Severity: -- → S3
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.