Closed Bug 1984214 Opened 1 year ago Closed 1 year ago

Selecting a market result with the keyboard blanks out the input

Categories

(Firefox :: Address Bar, defect, P1)

defect

Tracking

()

VERIFIED FIXED
144 Branch
Tracking Status
firefox143 --- verified
firefox144 --- verified

People

(Reporter: adw, Assigned: adw)

References

Details

(Whiteboard: [sng])

Attachments

(1 file)

Selecting a market result with keyboard blanks out the urlbar input. The input should show the query that will be performed when you hit Enter. if you then hit Enter, nothing happens.

See Also: → 1984262

I can't reproduce this now. The input is blanked out, but pressing Enter does search for the right query. I could have sworn nothing happened. Maybe I had my own WIP applied that messed it up.

I already wrote a patch that makes some other changes, so I'll go ahead and post it anyway.

Summary: Picking a market result with the keyboard doesn't work → Selecting a market result with the keyboard blanks out the input

DYNAMIC results can already define payload.input in order to tell
UrlbarInput the value that should be set in the input when the result is
selected [1]. We can't use that here because market results can have many items
that all have their own query.

So this patch lets DYNAMIC results also set element.dataset.query on their
child elements, and it modifies the code at [1] so that it checks the query
defined on the element. I had to modify the related code paths so that the
selected element is passed in.

Since I was doing that, I thought it also made sense to hook up
element.dataset.query to the URL-loading path in UrlbarInput.pickElement().
Now DYNAMIC results can define payload.engine and either payload.query or
element.dataset.query, and UrlbarInput will automatically load the
appropriate search URL, just like it does for SEARCH results.

This also makes some other improvements:

  • Incorporate dataset into the UrlbarView method that updates an element in
    a DYNAMIC row (renamed from #setDynamicAttributes() to
    #updateElementForDynamicType())

  • I moved some things from MarketSuggestion.getViewTemplate() to
    getViewUpdate() because the intended purpose of getViewTemplate() (and
    view templates generally) is that they are only the DOM structure without any
    "interior" data that depends on a given UrlbarResult. Really the only reason
    that getViewTemplate() exists at all is to support DOM structures with a
    variable number of children.

  • In the MarketSuggestions view template, I renamed item to item_${i}
    because names should be unique within a view template.

[1] https://searchfox.org/firefox-main/rev/d683b2b2ed86192b3a87150c21fc51ba02a93142/browser/components/urlbar/UrlbarInput.sys.mjs#2655

See Also: → 1984522
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 144 Branch

Comment on attachment 9508373 [details]
Bug 1984214 - Update the urlbar input when a market result is selected.

Beta/Release Uplift Approval Request

  • User impact if declined/Reason for urgency: This is required for the "carrots" realtime-suggestions Suggest feature in 143.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): This is a little higher risk than the other "carrots" uplifts I've been requesting because it modifies general urlbar code and not only code specific to the carrots feature, but the changes are still relatively small and the urlbar test suite is extensive.
  • String changes made/needed:
  • Is Android affected?: No
Attachment #9508373 - Flags: approval-mozilla-beta?

Actually this should be QA verified.

Flags: qe-verify+
Blocks: 1982843
Flags: in-testsuite+

Comment on attachment 9508373 [details]
Bug 1984214 - Update the urlbar input when a market result is selected.

Approved for 143.0b4.

Attachment #9508373 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [qa-triage-done-c144/b143]

I have verified this issue on the latest Firefox Nightly 144.0a1 (Build ID: 20250825091413) on Windows 11, macOS 15.3, and Ubuntu 24.04 x64.

  • The urlbar shows the market keyword in the “<TICKER> stock” format when focusing the market suggestion.
  • The “<TICKER> stock” string is still displayed in the urlbar after selecting the market suggestion using keyboard navigation and the SERP is displayed.

I have verified this issue on the latest Firefox Beta 143.0b4 (Build ID: 20250825091315) on Windows 11, macOS 15.3, and Ubuntu 24.04 x64.

  • The urlbar shows the market keyword in the “<TICKER> stock” format when focusing the market suggestion.
  • The “<TICKER> stock” string is still displayed in the urlbar after selecting the market suggestion using keyboard navigation and the SERP is displayed.
Status: RESOLVED → VERIFIED
Flags: qe-verify+
Regressions: 1991585
See Also: → 1997680
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: