Page MenuHomePhabricator

Provide easier way to search within any Application when in it
Closed, ResolvedPublic

Description

I get a lot of complaints from users that when they're in a tool and do a search, they do not get the results they want. Basically, I think the expected behavior (at least of our users) is that if you're in Phriction, a search will default to Phriction and can be expanded if necessary; similarly, if you're in Maniphest, a lot of people expect search to default to just covering Maniphest tasks. It's obviously just a minor feature, but an extra two clicks per search tends to add up when multiplied over hundreds of people.

If nothing else, it'd be nice to have a site-wide preference like "Scope searches to the current component by default".

Event Timeline

jbrown raised the priority of this task from to Needs Triage.
jbrown updated the task description. (Show Details)
jbrown added subscribers: jbrown, WyseNynja, bigo.
epriestley triaged this task as Wishlist priority.Feb 24 2014, 11:14 PM
epriestley added a subscriber: epriestley.

We had this a while ago, in two forms. One was a old php.net-style dropdown:

Search for ( querytext            ) in [Maniphest tasks     V]
                                       [Phriction documents  ]
                                       [Everywhere           ]

This was huge and ugly and inconvenient. Here's a screenshot of what it looked like:

Screen_Shot_2014-02-24_at_3.08.32_PM.png (149×583 px, 76 KB)

We got rid of this at some point and made search automatically contextual, so search from Maniphest meant "Search Maniphest Tasks". This was indicated by the placeholder text, which would change from "Search" to "Search Tasks", "Search Revisions", etc. There was no way to execute an alternate or global search in these cases.

This was not really based on user demand or anything, it just seemed like a maybe-useful feature. In practice, it was kind of messy and complicated from an implementation perspective (I think it at least partially predated real applications) and it didn't feel very good/natural in use, at least to me (I would often hit contextual search and mean full search). I removed it bit by bit over time and no one complained.

Maybe a better fix would be to do this kind of thing:

( querytext            )
+----------------------------------------------+
| Search for "querytext" in Maniphest Tasks... |
| Search for "querytext" in all documents...   |
+----------------------------------------------+

...where you get a typeahead, the default behavior remains "whatever your default search filter has been configured as", and then you can down-enter to get explicit contextual search.

the typahead approach seems like it'd work very well for our use-case.

Yeah, I agree with Evan. Trying to be 'magical' here just ends up frustrating as many users as it helps. I would always have to orient myself before doing a search, and then make the decision manually to search in global or local scope. Amazon has this interface and I think it's quite terrible. I always have to look to see where I am, make a decision to change whether I'm searching globally or per department, then take the action. I do, though, think the search experience right now could use some deeper thinking.

chad renamed this task from allow making search scope default to the currently-selected component to Provide shortcuts in Search Typeahead to searching just within the current Application.Nov 2 2014, 11:15 PM
chad added a project: Search.

at the very least, the filter should be set when I am in one of the subareas of Phabricator. I.e. when I am in Maniphest (looking at a bug), the search should be limited to bugs; when I am in Diffusion, the search should be limited to commits.

Compare how e.g. Github works: when you are in a repo, the search box has a little "This repository" tag in it (which can be cleared by backspace) which limits the search to the current repo. Something similar could be done in Phabricator with the applications: when you are e.g. in Maniphest, show a little "Tasks" prefix which can be removed, and if it is not removed, the quicksearch should send you to the Maniphest search form (which has different controls, so filtering is not the only reason why it is far superior to the general search form) instead of the generic search form.

We had that, almost exactly:

We ... made search automatically contextual, so search from Maniphest meant "Search Maniphest Tasks".

It didn't work very well in this application. There are a lot more contexts and cross-context searches than on GitHub.

I have fiddled a bit with this, and I've got a few implementation questions.

I have roughly added a 'search typeahead' as PhabricatorTypeaheadResult:

$results[] = id(new PhabricatorTypeaheadResult())
    ->setName($raw_query) //'Search for '.$raw_query.' in Maniphest')
    ->setURI('/maniphest/query')
    ->setPHID($raw_query)
    ->setPriorityString($raw_query)
    ->setDisplayName('Maniphest Advanced Search')
    ->setDisplayType('Search for '.$raw_query)
    ->setImageURI(null)
    ->setPriorityType('apps')
    ->setImageSprite('phabricator-search-icon sprite-apps-large apps-maniphest-dark-large');

in PhabricatorApplicationDatasource::loadResults(), as a temporary test. This works to show the result, but already has two issues:

  • the PHID has to be different for every result, or the javascript side will completely ignore the changed result
  • the suggestion now disappears and reappears every time the user types something, which is confusing....

Adding the suggestion on the Javascript side might result in a better user experience in the end, but my Javascript-fu is even weaker than my PHP-fu ;-)

I haven't yet figured out:

  • How to hook the typeahead up to Maniphest's advanced search, as 'fulltext' cannot be passed as GET parameter.
  • How to only show this typeahead when we are currently viewing the Maniphest application

but these might actually also be easier from a Javascript perspective...

This is what the result looks like:

pasted_file (101×373 px, 9 KB)

chad renamed this task from Provide shortcuts in Search Typeahead to searching just within the current Application to Provide easier way to search within any Application when in it.Jan 23 2015, 8:45 PM
angie added a project: Restricted Project.May 20 2015, 5:23 PM
angie moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Jun 3 2015, 8:35 PM
jhurwitz moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Jun 6 2015, 3:36 AM