Closed Bug 1811373 Opened 1 year ago Closed 1 year ago

Weather suggestion text pops in and causes flicker

Categories

(Firefox :: Address Bar, defect, P1)

defect

Tracking

()

VERIFIED FIXED
111 Branch
Tracking Status
firefox111 --- verified
firefox112 --- verified
firefox113 --- verified

People

(Reporter: adw, Assigned: adw)

References

Details

Attachments

(2 files)

Attached image screenshot

The weather suggestion should cache its strings so they don't pop in and cause flicker, including the "Top Pick" label. I'll attach a screenshot from a screen recording that shows how no text at all can sometimes appear at first except for the URL, which isn't an l10n string.

The icon can also pop in and cause the text to shift, but I'd like to handle that in a different bug.

Depends on: 1808974
Summary: Weather suggest text pops in and causes flicker → Weather suggestion text pops in and causes flicker

This caches weather suggestion l10n strings by adding cacheable: true to the
view update object returned by the provider. Doing so hooks into UrlbarView's
dynamic result type functionality here.

w/r/t l10n strings and caching, weather suggestions are a bit of a new case
because most of these strings take arguments that can't be known in advance and
that will change over time. For a string with arguments, L10nCache creates a
cache key by concating the string's ID and the values of its arguments. That
makes sense for strings whose values are things like search engine names, where
the set of possible argument values is small and where we may need to show
different translated strings when for example the search engine changes. For
those strings, we want to cache the translated strings separately using
different keys.

Weather suggestion strings like "20°C" are a different story. The ideal UX for
these strings is: While the UI is waiting for the string to be re-localized with
new argument values, it should show the previous localized string with the old
argument values. If the argument values have changed, there will still be some
flicker as the old values are replaced with the new ones, but it's the best we
can do, and at least there won't be empty space in the UI.

This isn't possible with L10nCache right now due to how it creates cache keys,
as mentioned earlier. So I added a new option that tells it to cache strings by
ID only, excluding argument values. That way only one translated string is
cached regardless of whatever argument values it was cached with.

Pushed by dwillcoxon@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dbbe0fa9a116
Cache weather suggestion l10n strings and allow L10nCache to cache strings only by ID. r=dao

For QA: In this bug, the text of the weather suggestion pops in a split second after the suggestion is shown (see screenshot). It might help to make a screen recording so you can slow it down. That should not happen anymore except possibly the first time the suggestion is shown in a new window. After the first time, the text should not pop in anymore in that window.

Flags: qe-verify+
Flags: in-testsuite+
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
Regressions: 1814318
Blocks: 1815018

I have verified this issue on Firefox Release 111.0.1 (Build ID: 20230321111920) on Firefox Beta 112.0b9 (Build ID: 20230330182947) and the latest Nightly 113.0a1 (Build ID: 20230402214746) on Windows 10 x64, macOS 12.4 and Linux Ubuntun 20.04 x64.

  • All the strings of the weather result and also the “Top Pick” label are displayed correctly, without popping in and without causing any flicker.
Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: