-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: When using search-config-v2 make the order of engines behave the same as desktop (bug 1895740) #168
base: main
Are you sure you want to change the base?
Conversation
… same as desktop (bug 1895740).
if (a == defaultEngine) { | ||
return -1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest adding the same comment as the Desktop code:
The app default engine should always be first in the list (except
for distros, that we should respect).
if (privateDefault) { | ||
if (a == privateDefault && b == defaultEngine) { | ||
return -1; | ||
} | ||
if (a == defaultEngine && b == privateDefault) { | ||
return 1; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look equivalent to the desktop version.
How are we checking that privateDefault
is not the same as the defaultEngine
here?
I suggest to add the same comment as desktop here:
if there's a private default, and it is different to the normal
default, then it should be second in the list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added comments for review.
return 1; | ||
} | ||
} | ||
if (a._orderHint && b._orderHint) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might as well add this comment too?
We sort by highest orderHint first, then alphabetically by name.
Hi @Standard8 , IIRC, you're investigating on how to make Should we close out this PR then? |
I'll update the desktop code & this PR together. |
This adds search order handling to be the same as desktop. It is possible that we could move desktop's sort function to a function that we could call from the extension as well - but we would still need a fallback (at least in the short term) for the current versions of FF, and overall, I'm not sure if it is worth it as it isn't something we generally update.