Closed Bug 1747973 Opened 2 years ago Closed 2 years ago

Cache the top sites query context

Categories

(Firefox :: Address Bar, enhancement, P3)

enhancement
Points:
2

Tracking

()

VERIFIED FIXED
97 Branch
Tracking Status
firefox97 --- verified

People

(Reporter: adw, Assigned: adw)

References

Details

Attachments

(3 files)

The urlbar view looks a little janky to me recently when it opens. There are a few different things that appear on screen at different points in the process, and altogether they add up to a lack of fluidity.

One of the problems is that when the input is focused while the pageproxystate is valid or there's no search string, there's a gap of time between when the input is focused and its background turns white to when the view opens and shows the top sites. This does not happen when the pageproxystate is invalid because we have a nice context-caching system that allows the view to immediately open and show the cached results.

The cache currently ignores the empty search string so it does not cache the top sites context, but there's no reason not to cache it AFAICT. Caching it fixes the problem.

This caches the top-sites context like we cache other contexts. Please see the
bug for more.

It also removes the early return from QueryContextCache.put() when the context
has no results because that doesn't seem necessary. If a context doesn't have
any results, that's a valid outcome and it's OK to open and update the view
immediately.

Pushed by dwillcoxon@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a6af5cff5adf
Cache the top-sites query context like we cache other contexts. r=harry
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch
Flags: qe-verify+
Flags: in-testsuite+

Hi Drew,
Are there any steps for us to reproduce and verify the changes here? Also, any possible risks/regression area to be taken into account?
Thank you!

Flags: needinfo?(adw)
Attached image bug1747973-after.gif

Hi Petruta, this fix should make the urlbar panel open more quickly when it shows the top sites, except for the first time it opens in a new window. STR:

  1. Open a new window, or use the window immediately after starting Firefox
  2. Click the urlbar (or use the Ctrl+L shortcut)
  3. Close the urlbar panel (e.g., press Esc or click outside it)
  4. Click the urlbar again

After step 4, the panel should open at the same time the urlbar input is focused and turns white. What should not happen is: the input turns white and then later the panel opens. I'll attach a slowed-down gif to show what it should look like.

As for regressions, the panel should not show top sites or have any flickering of the top sites when it opens in other cases. e.g., if you press Ctrl+K to enter search mode.

Flags: needinfo?(adw)
Attached image bug1747973-before.gif

Here's a slowed-down gif of what it looked like before the fix. Opening the panel the first time in a window (after step 2 in the STR above) also looks like this, even with the fix.

Thank you for the gifs and the detailed explanation.
Verified as fixed using latest Nightly 97.01 2022-01-07 under Win 10 64-bit and Mac OSX 11.6.2.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
Blocks: 1804121
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: