DXR UI Refresh: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(comments from jcranmer)
(Move everything that isn't done onto DXR Roadmap.)
 
(44 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Once upon a time, [[User:SchalkNeethling|Schalk Neethling]] surveyed the userbase and heuristically analyzed the UI, resulting in [[Webtools/DXR_User_Research|some nifty mockups]].
== History ==
Once upon a time, [[User:SchalkNeethling|Schalk Neethling]] surveyed the [[DXR]] userbase and heuristically analyzed the UI, resulting in [[Webtools/DXR_User_Research|some nifty mockups]].


Then [[User:Erikrose|Erik Rose]] came along and did another round of wireframes adding these simplifications:
Later, [[User:Erikrose|Erik Rose]] came along and did another round of wireframes adding these simplifications:


* Removing the front page, which not a soul remembers the reason for and which complicates the implementation and visually destabilizes the UI when it goes "poof". (I think the UI was inspired by Google. But, unlike them, we don't have other properties to advertise, so we don't need a place to park a navbar.)
* Removing the front page, which not a soul remembers the reason for and which complicates the implementation and visually destabilizes the UI when it goes "poof". (I think the UI was inspired by Google. But, unlike them, we don't have other properties to advertise, so we don't need a place to park a navbar.)
Line 7: Line 8:
* Making a few improvements to the multi-tree story
* Making a few improvements to the multi-tree story


Feel free to comment on [[Talk:DXR_UI_Refresh]] and factor up the results of discussion to this page.
Then Erik [https://groups.google.com/forum/#!topic/mozilla.dev.platform/TW8If68UYZw mailed dev-platform] and got tons of feedback about what they need from DXR and what their usage patterns are, and he realized that the textual query interface cannot be discarded; it is just too handy for custom keyword searches and search-box plugins. Erik, Schalk, Jonas, and rhelmer got together at the Santa Clara Mozilla Summit, chewed through all the dev-platform feedback and that from the DXR Innovation Fair booth, and came to the conclusions under [[#Plans_And_Priorities]]. The raw feedback is categorized and sorted under [[#Feedback]].


== Basic Search ==
== Plans And Priorities ==
* The basic search panel gets an always-present case-sensitivity checkbox, with an accesskey so it can be toggled quickly and without leaving the keyboard.
* A pop-up menu exposes most of the 24 filter types. Users no longer have to check a manual (which never existed) or the source code to see what's available. Also, the presence of a single menu encourages the use of only one filter per query, which is all that makes sense with most filters. (Filters that do make sense in combination with others are available in the advanced search panel.)


[[File:Dxr_basic_search.png]]
=== Top of the Heap ===
 
Here are the first several improvements we'll do. They either make DXR a lot better for some or a little better for all—again biased toward being able to retire MXR. I've attached the high-ROI items from [[#Feedback]] that made them bubble to the top of the list.
 
These will turn into filed bugs, not necessarily with a 1-to-1 correspondence.
 
* <strike>Squash the last few bugs in multi-tree support</strike>, and [https://bugzilla.mozilla.org/show_bug.cgi?id=820531 index more trees].
* <strike>Support [https://bugzilla.mozilla.org/show_bug.cgi?id=813524 case-insensitivity].</strike>
* <strike>Implement [https://github.com/erikrose/dxr/blob/query-parser/docs/queries.rst a real query parser].</strike>
** <strike>(1) Docs (mostly user-facing) about how the query language is spelled and what it means</strike>
** <strike>(1) Don't require delimiters around a regex when entered into the Advanced Search Regex field</strike>
** <strike>(1) In the new UI, keep a text-only representation or some other way to be usable from custom search plugins or URL-bar keywords.</strike>
** <strike>(2) A way to semantically include double quotes in the search string: the parser shouldn't always eat them.</strike>
* <strike>Quit auto-focusing the search field [as much].</strike>
 
=== Decisions ===
 
Here are some decisions the 4 people in the room (jonasf, ErikRose, rhelmer, and Schalk) agreed on at the 2013 Summit, recorded so we don't forget:
 
* <strike>We'll write a search query parser that supports Python-style quoting for regexes and everything else. Use double quotes or single quotes. Each can contain the other. If you really need to go crazy, you can backslash-escape the kind of quote you're using.</strike>
* <strike>Regex search will support barewords. If you need to use a pattern that contains a space or quotes, put it in single or double quotes (see above). There's no reason to require quotes all the time, since we don't need to hang a "replace" pattern off the end a la vi.</strike>
* <strike>Advanced search and textual search should either be mutually exclusively shown (in which case we'd act like Google's advanced search, snapping back to textual mode when showing results), or we can have server-side code send back the textual equivalent to the advanced search (or the advanced equivalent to the textual search) along with the search results. That way, we don't immediately need to write a JS query parser, though we could add one later and get better latency. We'll have examples of what each advanced field takes in dimmed text in the field, demonstrating a few of the interesting features: for instance, '"main(const int, ...)"'.</strike>
* Improve our filter names so they're shorter and more memorable ("subclass" vs. "derived").
* <strike>Take the "l" out of line-number URL fragments. It looks like a 1. You can just start them with numbers.</strike>
 
== Feedback ==
 
Here we've collected user feedback, largely from the [https://groups.google.com/forum/#!topic/mozilla.dev.platform/TW8If68UYZw dev-platform thread]. We use the following numbers (and letter) to rank items with regard to MXR retireability. These express nothing about difficulty. Order of attack will of course take this and other factors into account.
 
# Must have. Everybody will be mad otherwise. Not having would be silly. MXR retirement blocker.
# Must have for >= 10% of the audience. Likely MXR blocker.
# Can wait but should get to to feel proud of the project. Might be able to turn off MXR without it.
# A useful thing for later
# A rare edge case, out of scope, or there's probably a better solution
 
B: Behind the scenes. A non-user-visible change that will enable other changes.
 
Now that we've landed the UI branch, the remaining items have migrated to the [[DXR Roadmap]].
 
=== More Trees, More Often ===
 
* <strike>(3) "Right now I think mxr updates from mozilla-central faster than daily. I've used that on a number of occasions to figure out what has broken my build/patch."</strike> [We now update every 6 hours.]
 
=== Search ===
 
* <strike>(2) A way to semantically include double quotes in the search string: the parser shouldn't always eat them.</strike>
 
=== Blame/VCS integration ===
 
* <strike>(4) Show hash or other VCS revision identifier, perhaps with the "Built 6 days ago" indicator. (easy)</strike>
 
=== UI/UX ===
 
* <strike>(1) Don't require delimiters around a regex when entered into the Advanced Search Regex field</strike>
* <strike>(1) In the new UI, keep a text-only representation or some other way to be usable from custom search plugins or URL-bar keywords.</strike>
* <strike>(1) Optional case sensitivity</strike>
* <strike>(1) The Navigation pane, also something which shows up apparently at random, should be more predictable and should have whatever kind of disclosure control we decide upon for the Advanced Search form.</strike>
* <strike>(2) When navigating down the directory/file tree, it keeps autofocusing the search field, which is super-annoying if you're using keyboard-only navigation (with quickfind and enter) to do the traversal.</strike>
* <strike>(3) Change line-number fragment from #l5 to just #5. Lowercase Ls look like ones. (easy)</strike>
* <strike>(3) More obviously indicate when the search results are out of date. Dim them?</strike> [Added a spinner in the search field.]
 
=== Just Bugs ===
 
* <strike>(3) Fix redundant "mozilla-central/search?tree=mozilla-central"</strike>


== Initial Page ==
== Initial Page ==
DXR's current front page goes away, replaced with a code-browsing view. If we'd like to add a tree description page, a la MXR, we could do it at the root of the browsing hierarchy. Breadcrumbs make clear where you are in the tree and are separated from the search panel to make clearer that browsing location has no effect on search scope.
DXR's current front page goes away, replaced with a redirect to a browse view of a default tree. Breadcrumbs make clear where you are in the tree. The filters menu as pictured here is newer than the question-mark-and-down-arrow in the other figures: it provides a larger click target and, for the keen of sight, a label.
 
If we need further documentation on the query syntax, don't add a help link and clutter up the page. Instead, stick the help link (or embed the help itself) in the filters menu: that's what you're looking for help on anyway. You'll scroll down the list of things, they won't answer your question, and then keep scrolling and hit the help. Or, if people slam the menu closed before they hit the bottom, put the help link on the right side, spanning all the rows. See the Scraps canvas in the OmniGraffle for some presentation ideas.


[[File:Dxr_front_page.png]]
[[File:Dxr_front_page.png]]


== Advanced Search ==
== Search ==
Currently, nobody understands when the advanced search panel shows up. It seems rather random. Now, it'll always be accessible via a disclosure control on the basic search panel.
The search panel gets an ever-present case-sensitivity checkbox, with an accesskey so it can be toggled quickly and without leaving the keyboard.
 
A help pane, accessed by clicking an icon in the search field, describes the available filters. Users no longer have to check a manual (which never existed) or the source code to uncover them.
 
[[File:Dxr_search_menu.png]]
 
An unambiguous Switch Tree menu is available. It now occurs in most contexts throughout the site.
 
[[File:Dxr_folder_tree_menu.png]]


[[File:Dxr_advanced_search.png]]


=== Open Questions ===
=== Open Questions ===
* Should we add a textual signifier to the main search field when something other than ''text'' is chosen—<code>function:foo</code> rather than <code>foo</code>, for instance? There is little reason to support such syntax at all with the pop-up there, since you can select something from the pop-up at least as efficiently as typing out the signifier, assuming type-to-select in the user agent. If DXR grows to support arbitrary boolean expressions (<code>(function:foo OR function:bar) regexp:sme+p</code>), then syntax becomes more useful again. If we do decide to keep the syntax, we'll have to decide what to do with the menu if the user manually changes a signifier—change its selection, dim it, etc.
* Can we detect when a qualified name is entered and do a fully-qualified search only then? What of global symbols?
* Can we detect when a qualified name is entered and do a fully-qualified search only then? What of global symbols?
* I'm not thrilled with that one, big field doubling as a place for fancy, multi-term queries ''and'' the simplest of terms. It makes for a lot of complicated edge cases when the user frobs either the field or the other controls that feed into it. Google takes the easy way out, moving its advanced-search fields to a separate page, which doesn't do find-as-you-type. Also, it has only words to deal with; our terms are more complex, having a variety of filter types.


== Search Within ==
== Search Within ==
Line 38: Line 107:
== File View ==
== File View ==
[[File:Dxr_file_view.png]]
[[File:Dxr_file_view.png]]
 
[[File:Dxr_file_tree_menu.png]]
== Other Considerations & Use Cases ==
* The Navigation pane, also something which shows up apparently at random, should be more predictable and should have whatever kind of disclosure control we decide upon for the Advanced Search form.
* Mook (and Dave Townsend) switches trees a lot while looking at a single file in MXR. He'd like to be able to do that without losing his scroll position, as it typically lands him at a similar-enough place in the code that he can reorient himself. We'll add a tree switcher to the navigation panel, which appears when a file is being viewed. The nav panel will be pinned.
 
=== Please help refactor these. ===
 
* Index multiple trees (starting with comm-central and mozilla-aurora, the most commonly used ones on MXR. The UX branch has been requested, too.) (some impact from IT, possibly) - this is the dependency for turn-off-MXR
* Fix UI bloopers.
** Needing to put delimiters around a regex even when entered into the Advanced Search Regex field
** Astonishing search behavior. Move to a line-based search, as proposed in https://github.com/mozilla/dxr/pull/161#issuecomment-25201532.
** Optional case sensitivity
** etc., etc., etc.
* Remove the C++ assumptions from the core so we can support structured queries on other languages. Python keeps coming up. Java and Scala did once as well. People mentioned JS a long time ago.
* In the new UI, keep a text-only representation or some other way to be usable from custom search plugins or URL-bar keywords.
* permanent code links i.e. code links to a particular hg changeset, not to "tip", so that I can paste code links on a bug and they stay valid. Currently I fall back to hg.mozilla.org for that use case
* "Right now I think mxr updates from mozilla-central faster than daily. I've used that on a number of occasions to figure out what has broken my build/patch."
* "One of the neat things with mxr and multiple trees is that when viewing a file on say mozilla-central I can easily switch to the mozilla-aurora version to see how it looks there, this is really useful for figuring out how a bug affects different branchs. Bonus points might include a file diff between the trees
* Docs (mostly user-facing)
* DXR permanent code links i.e. code links to a particular hg changeset, not to "tip", so that I can paste code links on a bug and they stay valid. Currently I fall back to hg.mozilla.org for that use case.
* Easy access to hg annotate, as in mxr (could be better than mxr even, by integrating into the existing view instead of being a separate view).
* A way to semantically include double quotes in the search string: the parser shouldn't always eat them.
* Let us structurally query stuff that gets #ifdef'd out on x86, like ARM stuff.
* Direct results: some love them, some hate them (because they just want to see the file pathname (don't we show that with the file? Is it bothersome because it's slow to load?)
* Search for substrings or patterns of file paths. Even just typing a filename (or path segment?) without a file: specifier should find files by name or path.
* Just plain old bugs:
** I find the call graph information to be wrong some of the time, I have never been able to tell why.  See this query for example: <http://dxr.mozilla.org/mozilla-central/search?q=%2Bcallers%3A%22mozilla%3A%3AAudioNodeStream%3A%3ASetDoubleParameter%28uint32_t%2C+double%29%22>.  Do you have any idea what the source of these problems is, and if yes, is that on track to get fixed?
* Count of search results, so we can use DXR to gather continuous metrics
* Stop differentiating between macros, functions, consts, etc.: just find me an *anything* called "fred". People coming up the booth were confused that they had to know the kind of the target.
* Show context around results (after a click? by saying "context:3[lines]" in the query?)
* More obviously indicate that the search results are out of date. Dim them?
* Be able to refer to specific revisions of code somehow, so links don't rot.
* Be able to navigate blame history better, stepping back and back in time until we find the change we were looking for.
* Better ranking: if you type an exact identifier name, put the definition at the top.
* Limiting searches to a particular file type. (eg, "image" in CSS files)
* As a jump point when I know a filename (eg, "nsILogin", click search, click the particular IDL I wanted).
* Limiting searches to a subtree (in one step), or to a directory pattern (eg "test").
** A basic "file:" keyword hint with simple wildcard globing could do most of it well enogh, I think... "file:*.css", "file:nsILogin*", "file:/test*"
* Support for image browsing would be super helpful for front-end stuff.
** Compare http://dxr.mozilla.org/mozilla-central/source/toolkit/themes/windows/global/icons with http://mxr.mozilla.org/mozilla-central/source/toolkit/themes/windows/global/icons/
** (Maybe this is just a bug? In general I'd expect all files to show up when browsing a directory.)
 
* MXR things I use constantly that don't seem to have obvious dxr counterparts:
** Search on the "firefox" tree to follow pre-hg blame.
 
* Features that are really handy at times (though the discoverability in mxr is terrible, so maybe dxr just has the same issue):
** Linking to particular versions.
** Marking particular lines.
 
* Things that drive me nuts about mxr when I've tried to use it:
** When navigating down the directory/file tree, it keeps autofocusing the search field, which is super-annoying if you're using keyboard-only navigation (with quickfind and enter) to do the traversal.
 
* Merge multiple build configuration databases somehow.
* Include Doxygen/Javadocs-like documentation. For C, C++, IDL, Java, JS, etc.
* Support for generated files in indexing
* Better support for JS, Python, etc.


== Drill-Down Advanced Search: A Dead End? ==
== Drill-Down Advanced Search: A Dead End? ==
Line 108: Line 122:


In the end, this style has some nice things going for it, but I think it takes too much clicking around for the tastes of our audience. Plus, it would likely be lower-performance than the current system, at least without redesigning the data storage. Finally, we're not a web search engine: our users have a pretty good idea what kind of entity they're searching for up front, and making them sort through a bunch of noise to specify that constraint (along with tolerating the mental switching inherent in dialogue) strikes me as impolite.
In the end, this style has some nice things going for it, but I think it takes too much clicking around for the tastes of our audience. Plus, it would likely be lower-performance than the current system, at least without redesigning the data storage. Finally, we're not a web search engine: our users have a pretty good idea what kind of entity they're searching for up front, and making them sort through a bunch of noise to specify that constraint (along with tolerating the mental switching inherent in dialogue) strikes me as impolite.
[Coming back to this after a few months have passed and we've had a lot more thoughts, inputs, and experiments on the subject...] The best part of the drill-down search—its thought-free searching—can be delivered by...
# An "id" filter which finds any identifier, regardless of type
# Better ranking of search results and handling of text searches: rank identifier matches first, then proceed to plain-text hits, etc.


== Gallery of Unwanted Advanced-Search Widgets ==
== Gallery of Unwanted Advanced-Search Widgets ==

Latest revision as of 21:17, 11 February 2014

History

Once upon a time, Schalk Neethling surveyed the DXR userbase and heuristically analyzed the UI, resulting in some nifty mockups.

Later, Erik Rose came along and did another round of wireframes adding these simplifications:

  • Removing the front page, which not a soul remembers the reason for and which complicates the implementation and visually destabilizes the UI when it goes "poof". (I think the UI was inspired by Google. But, unlike them, we don't have other properties to advertise, so we don't need a place to park a navbar.)
  • Teaching the query syntax via live feedback from the advanced search form rather than through written instructions. It's a little more JS, but users won't have to pogo-stick back and forth to a help page.
  • Making a few improvements to the multi-tree story

Then Erik mailed dev-platform and got tons of feedback about what they need from DXR and what their usage patterns are, and he realized that the textual query interface cannot be discarded; it is just too handy for custom keyword searches and search-box plugins. Erik, Schalk, Jonas, and rhelmer got together at the Santa Clara Mozilla Summit, chewed through all the dev-platform feedback and that from the DXR Innovation Fair booth, and came to the conclusions under #Plans_And_Priorities. The raw feedback is categorized and sorted under #Feedback.

Plans And Priorities

Top of the Heap

Here are the first several improvements we'll do. They either make DXR a lot better for some or a little better for all—again biased toward being able to retire MXR. I've attached the high-ROI items from #Feedback that made them bubble to the top of the list.

These will turn into filed bugs, not necessarily with a 1-to-1 correspondence.

  • Squash the last few bugs in multi-tree support, and index more trees.
  • Support case-insensitivity.
  • Implement a real query parser.
    • (1) Docs (mostly user-facing) about how the query language is spelled and what it means
    • (1) Don't require delimiters around a regex when entered into the Advanced Search Regex field
    • (1) In the new UI, keep a text-only representation or some other way to be usable from custom search plugins or URL-bar keywords.
    • (2) A way to semantically include double quotes in the search string: the parser shouldn't always eat them.
  • Quit auto-focusing the search field [as much].

Decisions

Here are some decisions the 4 people in the room (jonasf, ErikRose, rhelmer, and Schalk) agreed on at the 2013 Summit, recorded so we don't forget:

  • We'll write a search query parser that supports Python-style quoting for regexes and everything else. Use double quotes or single quotes. Each can contain the other. If you really need to go crazy, you can backslash-escape the kind of quote you're using.
  • Regex search will support barewords. If you need to use a pattern that contains a space or quotes, put it in single or double quotes (see above). There's no reason to require quotes all the time, since we don't need to hang a "replace" pattern off the end a la vi.
  • Advanced search and textual search should either be mutually exclusively shown (in which case we'd act like Google's advanced search, snapping back to textual mode when showing results), or we can have server-side code send back the textual equivalent to the advanced search (or the advanced equivalent to the textual search) along with the search results. That way, we don't immediately need to write a JS query parser, though we could add one later and get better latency. We'll have examples of what each advanced field takes in dimmed text in the field, demonstrating a few of the interesting features: for instance, '"main(const int, ...)"'.
  • Improve our filter names so they're shorter and more memorable ("subclass" vs. "derived").
  • Take the "l" out of line-number URL fragments. It looks like a 1. You can just start them with numbers.

Feedback

Here we've collected user feedback, largely from the dev-platform thread. We use the following numbers (and letter) to rank items with regard to MXR retireability. These express nothing about difficulty. Order of attack will of course take this and other factors into account.

  1. Must have. Everybody will be mad otherwise. Not having would be silly. MXR retirement blocker.
  2. Must have for >= 10% of the audience. Likely MXR blocker.
  3. Can wait but should get to to feel proud of the project. Might be able to turn off MXR without it.
  4. A useful thing for later
  5. A rare edge case, out of scope, or there's probably a better solution

B: Behind the scenes. A non-user-visible change that will enable other changes.

Now that we've landed the UI branch, the remaining items have migrated to the DXR Roadmap.

More Trees, More Often

  • (3) "Right now I think mxr updates from mozilla-central faster than daily. I've used that on a number of occasions to figure out what has broken my build/patch." [We now update every 6 hours.]

Search

  • (2) A way to semantically include double quotes in the search string: the parser shouldn't always eat them.

Blame/VCS integration

  • (4) Show hash or other VCS revision identifier, perhaps with the "Built 6 days ago" indicator. (easy)

UI/UX

  • (1) Don't require delimiters around a regex when entered into the Advanced Search Regex field
  • (1) In the new UI, keep a text-only representation or some other way to be usable from custom search plugins or URL-bar keywords.
  • (1) Optional case sensitivity
  • (1) The Navigation pane, also something which shows up apparently at random, should be more predictable and should have whatever kind of disclosure control we decide upon for the Advanced Search form.
  • (2) When navigating down the directory/file tree, it keeps autofocusing the search field, which is super-annoying if you're using keyboard-only navigation (with quickfind and enter) to do the traversal.
  • (3) Change line-number fragment from #l5 to just #5. Lowercase Ls look like ones. (easy)
  • (3) More obviously indicate when the search results are out of date. Dim them? [Added a spinner in the search field.]

Just Bugs

  • (3) Fix redundant "mozilla-central/search?tree=mozilla-central"

Initial Page

DXR's current front page goes away, replaced with a redirect to a browse view of a default tree. Breadcrumbs make clear where you are in the tree. The filters menu as pictured here is newer than the question-mark-and-down-arrow in the other figures: it provides a larger click target and, for the keen of sight, a label.

If we need further documentation on the query syntax, don't add a help link and clutter up the page. Instead, stick the help link (or embed the help itself) in the filters menu: that's what you're looking for help on anyway. You'll scroll down the list of things, they won't answer your question, and then keep scrolling and hit the help. Or, if people slam the menu closed before they hit the bottom, put the help link on the right side, spanning all the rows. See the Scraps canvas in the OmniGraffle for some presentation ideas.

Dxr front page.png

Search

The search panel gets an ever-present case-sensitivity checkbox, with an accesskey so it can be toggled quickly and without leaving the keyboard.

A help pane, accessed by clicking an icon in the search field, describes the available filters. Users no longer have to check a manual (which never existed) or the source code to uncover them.

Dxr search menu.png

An unambiguous Switch Tree menu is available. It now occurs in most contexts throughout the site.

Dxr folder tree menu.png


Open Questions

  • Can we detect when a qualified name is entered and do a fully-qualified search only then? What of global symbols?

Search Within

Dxr search within.png

Search Results

Dxr results page.png

File View

Dxr file view.png Dxr file tree menu.png

Drill-Down Advanced Search: A Dead End?

This style lets you start a search quickly, without a lot of up-front thinking about constraints or DXR syntax. Like a web search engine, it returns a mixture of matches, across various filter types, and invites you to drill down further if you don't see what you want.

Dxr drill down.png

Problems

  • If we divide the results by filter type, we can't also divide them by extension or path, unless we hierarchalize, organizing extension subdivisions under filter-type ones. But what if we combine the interactive approach with an explicit couple of disclosable fields for truly extradimensional filters? If somebody loves that, I'll sketch it.
  • Any symbolic-filter result is also going to show up in the plain-text result section. Should we de-dupe or something?

Notes

  • As now, Caller or Bases or Members results would show once the query matched a full function or class name.

In the end, this style has some nice things going for it, but I think it takes too much clicking around for the tastes of our audience. Plus, it would likely be lower-performance than the current system, at least without redesigning the data storage. Finally, we're not a web search engine: our users have a pretty good idea what kind of entity they're searching for up front, and making them sort through a bunch of noise to specify that constraint (along with tolerating the mental switching inherent in dialogue) strikes me as impolite.

[Coming back to this after a few months have passed and we've had a lot more thoughts, inputs, and experiments on the subject...] The best part of the drill-down search—its thought-free searching—can be delivered by...

  1. An "id" filter which finds any identifier, regardless of type
  2. Better ranking of search results and handling of text searches: rank identifier matches first, then proceed to plain-text hits, etc.

Gallery of Unwanted Advanced-Search Widgets

Just for fun, here's a slagheap of discarded advanced-search disclosers. :-)

Dxr advanced disclosers.png