Open Bug 1136131 Opened 10 years ago Updated 8 months ago

Provide access to all search providers in context menu selection

Categories

(Firefox :: Search, enhancement, P5)

Unspecified
All
enhancement

Tracking

()

People

(Reporter: agrigas, Unassigned)

References

Details

(Whiteboard: [ui][fxsearch])

Attachments

(1 file, 1 obsolete file)

Flags: firefox-backlog?
Depends on: 1107194
See attachment on bug 1107194. Sub-menu is used to list providers. If user has more providers than default set, native scroll pattern for each platform (Mac OS, Windows, etc) should be used to support scrolling and navigation.
So this is essentially "implement attachment 8568096 [details], ignoring the bit about scrolling behavior being different than standard menu behavior".
yes
Flags: firefox-backlog? → firefox-backlog+
Priority: -- → P3
Whiteboard: [fxsearch][searchui]
Rank: 35
Whiteboard: [fxsearch][searchui] → [ui][fxsearch]
I've asked my intern, Nihanth, to work on this.
Assignee: nobody → nhnt11
Status: NEW → ASSIGNED
OS: Mac OS X → All
Hardware: x86 → Unspecified
Attached patch Patch (obsolete) — Splinter Review
I modified the _loadSearch API to accept an optional engine parameter so that allows it to be used with any search engine. Not sure if this approach is best - let me know!
Attachment #8607941 - Flags: review?(adw)
This patch generates the list of alternate providers every time the context menu is opened, by the way, because I figured it was overkill to populate the menuitems once and then add/remove items when the user modifies the list of search engines.
Attached patch Patch v1.1Splinter Review
Added a comment where we return early when there's only one visible provider.
Attachment #8607941 - Attachment is obsolete: true
Attachment #8607941 - Flags: review?(adw)
Attachment #8607944 - Flags: review?(adw)
Comment on attachment 8607944 [details] [diff] [review] Patch v1.1 Review of attachment 8607944 [details] [diff] [review]: ----------------------------------------------------------------- This looks great. I would r+ it but there are some tests we need to fix as part of this patch. We should also check with Mike that using the "contextmenu" search purpose for this new menu is OK with our search partners. (I should have done that yesterday but didn't think of it, sorry.) ::: browser/base/content/browser-context.inc @@ +316,5 @@ > accesskey="&keywordfield.accesskey;" > oncommand="AddKeywordForSearchField();"/> > <menuitem id="context-searchselect" > oncommand="BrowserSearch.loadSearchFromContext(this.searchTerms);"/> > + <menu id="context-otherProviders" label="&otherProvidersMenu.label;"/> I think both the ID and the DTD entity should have "search" in them. How about context-searchselect-otherproviders and searchOtherProvidersMenu.label? ::: browser/base/content/browser.js @@ +3534,5 @@ > * This should only be called from the context menu. See > * BrowserSearch.loadSearch for the preferred API. > */ > + loadSearchFromContext: function (terms, engine) { > + if (BrowserSearch._loadSearch(terms, true, "contextmenu", engine)) Let's keep the braces on this if since they're already there. (You'll find that different people on the team have different opinions on this, but most of the code I've seen recently uses braces. However, generally reviewers on our team don't make a big deal about it -- from what I've seen anyway. FYI, there is a Mozilla-wide style guide that I guess we generally follow, but people definitely do deviate from it sometimes: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Control_Structures) ::: browser/base/content/nsContextMenu.js @@ +1782,5 @@ > + let listener = event => { > + let name = event.target.getAttribute("label"); > + BrowserSearch.loadSearchFromContext(selectedText, > + Services.search.getEngineByName(name)); > + } Nit: }; @@ +1787,5 @@ > + for (let engine of engines) { > + if (engine == currentEngine) > + continue; > + let item = document.createElementNS( > + "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menuitem"); Please put this string in a variable where you first use it above, and then use the variable in both places.
Attachment #8607944 - Flags: review?(adw) → feedback+
Comment on attachment 8607944 [details] [diff] [review] Patch v1.1 Mike, this patch adds a new "Search other providers" submenu in the context menu. See comment 2 for the UX spec. It uses the existing "contextmenu" search purpose for clicks on those providers. Is that cool?
Attachment #8607944 - Flags: feedback?(mconnor)
Based on IRC discussion, I'd like us to hold off on this change. Adding a 7-10 item submenu to a 6 item menu feels super heavy. This isn't frequently-used UI, so giving it even more UI affordance feels like a step in the wrong direction. In addition, there are competing plans in conjunction with partners to explore a richer, more DWIM-y alternative, so I'd like to avoid churn until that's sorted. cc-ing Kev to make sure this is on his radar as well.
Mike, one reason you gave in IRC for this UX feeling heavy is that context menus shouldn't have submenus as a general rule. It should be pointed out that our context menu already has submenus for some contexts: media playback, video casting, frames, dictionaries, and the links and pages marking feature of the social API: http://mxr.mozilla.org/mozilla-central/source/browser/base/content/browser-context.inc#318 That's not a rebuttal to the idea that submenus are bad in the context menu. It's just to say there's precedent for it. Those contexts are probably much less frequent for most people than the search context would be, though.
Attachment #8607944 - Flags: feedback?(mconnor)
Unassigning myself. I don't think this is WONTFIX (there's an alternative planned right?) so I'm leaving it as NEW.
Assignee: nhnt11 → nobody
Status: ASSIGNED → NEW
If the competing plans you are talking about are discussed in an open bug, would you mind putting the link here so we can follow what's going on ? Thanks :)
Severity: normal → minor

I'd really like this still.

What about allowing search providers to be toggled into or out of the context menu? By default, only the default search provider could be listed and the default UI wouldn't be any heavier, but, if you want others to be available, you can go to about:preferences#search and flip their bits.

Severity: minor → N/A
Type: defect → enhancement
Rank: 35
Priority: P3 → P5
Summary: [implement] Provide access to search providers in context menu selection → Provide access to all search providers in context menu selection

Source code for the extension which did this very nicely is located here:

https://github.com/benbasson/contextsearch

See Also: → 1804357
Duplicate of this bug: 1877003
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: