Open Bug 1822297 Opened 1 year ago Updated 1 year ago

Remove search suggestions dependency on satchel

Categories

(Firefox :: Search, task, P3)

task

Tracking

()

People

(Reporter: standard8, Unassigned)

References

Details

In bug we are simplifying some of the search suggestion code, but this also exposes a direct dependency on satchel. Marco suggested that we could probably replace that in this manner:

Implement nsIAutocompleteSearch (and we have it in SearchSuggesions.sys.mjs), we can just create an instance of Ci.nsIAutoCompleteSimpleResult, and put results into it. Though that means we would have to write our own nsIAutoCompleteSimpleResult implementation.

Having our own implementation would mean that we would have to handle removeValueAt for the search bar case.

Overall this would probably help to avoid confusion between the two FormAutoCompleteResult definitions that exist in satchel.

We are currently wrapping results in FormAutoCompleteResult from FormAutoComplete.sys.mjs, then we take that result and wrap it into FormAutoCompleteResult from nsFormAutoCompleteResult.sys.mjs.
We could instead implement our own SearchHistoryResult (implementation of nsIAutoCompleteSimpleResult) and handle removeValueAt directly using FormHistory.update, without the need of any wrapper from Satchel.

You need to log in before you can comment on or make changes to this bug.