Closed
Bug 1098649
Opened 10 years ago
Closed 4 years ago
Show context menu when clicking on folders on the file result page.
Categories
(Webtools Graveyard :: DXR, defect)
Webtools Graveyard
DXR
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: tomasz, Unassigned)
Details
Clicking on directories here: http://dxr.mozilla.org/mozilla-central/search?case=false&q=initDOMRequestHelper shows a menu where you can select like "limit search to folder".
Show the same menu when I click on folders here: http://dxr.mozilla.org/mozilla-central/source/dom/base/DOMRequestHelper.jsm.
Even better: show it on right click.
To think: let me write "path:.". But since there is live reload while typing this does not really work.
Comment 1•10 years ago
|
||
I'm new to DXR, but I could look into doing this if it's a feature that people want.
Comment 2•10 years ago
|
||
Tomasz, would a feature like https://wiki.mozilla.org/DXR_UI_Refresh#Search_Within suffice for your needs? That's something we meant to do last year but never got around to.
Reporter | ||
Comment 3•10 years ago
|
||
That would help a little bit. But it was confusing for me that those two pages with pahts listed in comment 0 have different behavior hence this issue. Nonetheless, "search within" would help.
Comment 4•10 years ago
|
||
Okay. Sounds like we have some tricky UI decisions to make. Let me know if the right choice is clearer to you than it is to me.
1. Consistency is good. It's very observant of you to notice that the breadcrumbs in the source view and in the search results look the same. I had not. They should thus indeed act the same.
2. The most common use of the breadcrumbs in the source view is to navigate. Adding a left-click context menu would make change this from "click" to "click-target-click". However, if we move all context menus to right-click (with JS or http://davidwalsh.name/demo/html5-context-menu.php), the user loses access to the browser's built in context menu, with useful things like Open In New Window.
We could do some other crazy thing, like having an additional handle appear on mouseover and having the user click that to activate the context menu. But I hesitate to stray that deep into novelty without hard consideration.
Comment 5•10 years ago
|
||
Perhaps more self-explanatory and less surprising would be to show our custom menu on right-click but bubble up the event and let the browser handle it if some modifier key is down. We could stick a note about the modifier key in the menu.
Comment 6•10 years ago
|
||
And, of course, all context-menu-having elements should change the cursor to the "hey, there's a context menu here" one on hover.
Reporter | ||
Comment 7•10 years ago
|
||
Most natural for me would be:
left) just opens directory/file
right) open context menu. Html5 context menu looks like a good way to do it: we don't loose right-click browser context-menu and get the menu we want. And we don't have to add any modifier or anything.
Comment 8•10 years ago
|
||
The HTML5 menu seems a lot cleaner than the context menu implemented in the first page linked in the OP. I'm in favor of implementing the context menu for both pages as an HTML5 context menu.
Comment 9•10 years ago
|
||
Joe, yep, it's certainly easier to implement. :-)
Tomasz, how do you feel about the naturalness of having your suggested behavior extend to the in-source-code context menus as well? Whatever we choose, we should be consistent.
I initially shied away from HTML 5 context menus since they work only in Firefox (and we like to keep our non-FF contribs happy), but it occurs to me that we could fall back gracefully to plain JS. Also, they're working on adding support in Chromium (https://code.google.com/p/chromium/issues/detail?id=87553), so it may not be an issue for long.
Here's a strawman "final state" for this bug:
1. Normal-clicking a folder name (in search results or breadcrumbs) browses to that folder.
2. Context-clicking a folder name brings up a context menu with (only) "Limit search to folder" and "Exclude from search" items.
3. Normal-clicking a reference in source code either does nothing or jumps to its definition.
4. Context-clicking a reference in source code brings up the context menu as exists currently.
5. Mousing over anything that has a context menu changes the cursor to "context-menu" so users have some hint.
The stock browser options add a lot of noise to HTML 5 context menus—things you rarely want to choose. However, if we set off the DXR ones using icons (as they currently have (and those should be revised)), the drawback will be lessened.
What do the two of you think?
Reporter | ||
Comment 10•10 years ago
|
||
Sounds good for me.
Comment 11•10 years ago
|
||
Alright, Joe, let's do it! We will need to fall back to plain JS, at least until Chrome grows support for the HTML 5 menus, so keep that in mind.
Comment 12•10 years ago
|
||
Sounds good. I'll get started on it.
Comment 13•10 years ago
|
||
I've finished up everything but cases 3 and 4 in Erik's strawman of the final state. However, I can't seem to get around an issue I'm having with context clicking source code in Firefox.
As currently implemented, the source code context menu depends on the click event to set the window's selection, which is used to generate a context menu. When I change the triggering event to contextmenu (right click), the selection is not set, and thus the information needed to generate a new context menu cannot be obtained.
Oddly enough, the selection is set when you right click on Chrome. Searching for a solution to the problem hasn't produced anything useful. Does anyone have any suggestions on how to resolve this?
Comment 14•4 years ago
|
||
DXR is no longer available. Searchfox is now replacing it.
See meta bug 1669906 & https://groups.google.com/g/mozilla.dev.platform/c/jDRjrq3l-CY for more details.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
Updated•4 years ago
|
Product: Webtools → Webtools Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•