Closed Bug 1647890 Opened 4 years ago Closed 4 years ago

Replace token alias with indicator when the token alias is confirmed or fully typed

Categories

(Firefox :: Address Bar, enhancement, P2)

enhancement
Points:
3

Tracking

()

VERIFIED FIXED
81 Branch
Iteration:
81.1 - July 27 - Aug 09
Tracking Status
firefox81 --- fixed
firefox82 --- verified

People

(Reporter: bugzilla, Assigned: bugzilla)

References

Details

Attachments

(1 file)

This includes inserting the indicator when the user clicks on a search shortcut Top Site.

Severity: -- → S3
Priority: -- → P2

UX clarified that we're also going to replace bookmark keywords and user-defined aliases with the visual indicator.

Assignee: nobody → htwyford
Status: NEW → ASSIGNED
Iteration: --- → 81.1 - July 27 - Aug 09

This patch changes the paramters to setSearchMode. The original patch to introduce search mode passed engineName to setSearchMode instead of the entire engine object. It was suggested in review that the nsISearchEngine be passed so we could run instanceof to distinguish it from a RESULT_TYPE. This patch reverses this and passes engineName instead through a destructured parameter.

In pickResult, we need to enter search mode synchronously based on the information in a result payload. Result payloads can't/shouldn't pass around complex objects like an nsISearchEngine, so we just pass engineName and the alias as strings. Since pickResult is synchronous, we can't use UrlbarSearchUtils to look up the engine based on the engineName. Besides, setSearchMode only uses engineName, so looking up the engine only to just use its name seems like a waste of resources.

This patch also disables autofill in search mode queries. Autofill was interfering with alias replacement. We were already half doing this (https://searchfox.org/mozilla-central/rev/26b13464c2beb26e0d864d561c30e817a85c348a/browser/components/urlbar/UrlbarController.jsm#391) but adding the searchMode check to UrlbarInput._maybeAutofillOnInput should resolve bug 1655473.

There's still one more bug I'm working through where the placeholder disappears after alias replacement. I though I'd get this out to start review regardless since we want to get the three patches discussed in Thursday's meeting out ASAP.

Pushed by htwyford@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/527908cfaa56 Replace token alias with indicator when the token alias is confirmed or fully typed. r=adw
Regressions: 1658243
Pushed by htwyford@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/38b9924c6af2 Replace token alias with indicator when the token alias is confirmed or fully typed. r=adw
Flags: needinfo?(htwyford)
Blocks: 1658395
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
Regressions: 1658605

I verified this issue using 82.0a1 (2020-09-14) on macOS 10.13 and Windows 10 x64.
Adrian could you help me with Ubuntu verification? Here are the STR's:

A:

  1. Type @google. Note the text is highlighted in the Urlbar.
  2. Type a space. The blue Google search mode indicator should be inserted in the Urlbar and the text should be cleared.

B:

  1. Type @.
  2. Select one of the token alias engines from the list and press enter.
  3. The corresponding search mode indicator should be inserted.

C:

  1. Add a search shortcut Top Site to the new tab page.
  2. Select the search shortcut Top Site from the new tab page.
  3. The corresponding search mode indicator should be inserted.
  4. Clear search mode (press backspace or click the X button on the indicator)
  5. Open Top Sites in the Urlbar by focusing it with no query.
  6. Select the search shortcut Top Site from the Urlbar.
  7. The corresponding search mode indicator should be inserted. (edited)
Flags: needinfo?(adrian.florinescu)

Added verification on Ubuntu 20.04 with 82.0a1 2020-09-15. Summing up comment 7 and comment 8, marking this bug as verified excluding the scenario from bug 1665115.

Status: RESOLVED → VERIFIED
Flags: needinfo?(adrian.florinescu)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: