Page MenuHomePhabricator

Implement a scope selector for the global search
ClosedPublic

Authored by epriestley on Apr 22 2015, 7:11 PM.

Details

Summary

See M1433. Fixes T7266. Fixes T4475. Ref T7314.

Future work/notes/etc:

  • Write the User Guide (see TODO).
  • This might needs some design tweaks -- I think it's functionally almost-equivalent to the mock, but the UI isn't quite the same.
  • (Mobile design is a touch off-looking I think?)
  • When you use a custom query, the duplicate "magnifying glass" icons are a little weird. Maybe change one or the other.
  • Maybe worth adding an "Open Documents in Current Application" option? Planning to wait for feedback on that.
  • Need a Quicksand integration to change the current application at some point.
  • Searching in "Current Application" from, e.g., the 404 page just searches all documents. Current plan is to just document this behavior, since the icon is a pretty good callout and it seems plausible that this is intuitive enough that users won't have a hard time with it.
Test Plan

New dropdown:

Device-ish:

Normal search (current application, from maniphest, selects tasks):

Application search from non-application:

Diff Detail

Repository
rP Phabricator
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Contextually, this is vaguely adjacent to T4100, since I plan to write search user guides next and this saves me from rewriting this stuff after we implement this.

This looks awesome!

chad edited edge metadata.Apr 22 2015, 7:20 PM

dat puzzle piece tho. ?

chad added a comment.Apr 22 2015, 7:21 PM

(patching locally to play with)

Yeah the puzzle piece is a bit sketch ("globe" seemed best for "all documents", but maybe something like "fa-files-o" would work better), and the double-magnifying-glass is even worse, but nothing jumped out at me as clearly the right pick in 10 seconds of looking.

chad added a comment.Apr 22 2015, 7:35 PM

Oh, I see, in the mock I had it dynamic to the application, but really we're just setting a preference.

Yeah, it's just a secret preference.

I could make the menu item say "Current Application (Maniphest)" or whatever, but I worry that will be kind of confusing since you're really setting a preference for "always search the current application, whatever that application might be".

chad added a comment.Apr 22 2015, 7:38 PM

Actually a dynamic icon I don't think would be too confusing. At least, when I'm in Maniphest, I'll see and be reminded its a local search before any dropdown.

Oh, yeah, that's a great idea.

I still need a default icon for when you aren't in an application (e.g., 404 page) or the application isn't searchable (e.g., Auth), do you see a better option than this to get rid of the puzzle piece?

  • All Documents
  • Curent Application
chad added a comment.Apr 22 2015, 7:42 PM

I still like Globe for Global

chad added a comment.Apr 22 2015, 7:45 PM

Maybe move the notice to be after the list of results?

When you get a full page of results it's really easy to miss the notice since it's so far below the fold.

We could try just removing it and see if it's actually confusing. It's possible that it won't be, but I'm worried that's might be too optimistic.

epriestley updated this revision to Diff 30034.Apr 22 2015, 7:48 PM
epriestley edited edge metadata.
  • Change "current application" icon dynamically.

The fa-file-o default icon actually stands out pretty well, so maybe that's enough of a hint. We can try no notice + document behavior and see if users run into trouble?

epriestley updated this revision to Diff 30035.Apr 22 2015, 7:50 PM
  • Try with no janky notice, at least until users complain.
epriestley updated this revision to Diff 30036.Apr 22 2015, 7:59 PM
  • Implement hooks for all the other applications.
epriestley updated this object.Apr 22 2015, 8:00 PM
epriestley updated this object.
chad accepted this revision.Apr 22 2015, 9:05 PM
chad edited edge metadata.

let's do this.

This revision is now accepted and ready to land.Apr 22 2015, 9:05 PM

leeeeeeeroy jenkinssssssss

This revision was automatically updated to reflect the committed changes.

It's already in production here... wow, looks nothing short of amazing :)

chad added a comment.Apr 22 2015, 11:14 PM

Short thoughts:

  • probably do want the "Current Application (Open) option
  • Not sure saved searches are useful?
  • On non application pages, since we're doing a global search, show globe instead?

probably do want the "Current Application (Open) option

Or maybe "Current Application" should always imply "Open"?

Not sure saved searches are useful?

I use "Open Tasks" as my default; this is the most common (non-typeahead) thing I use global search for by a reasonable margin.

On non application pages, since we're doing a global search, show globe instead?

Maybe -- I worry showing two globes that do different things (although the same thing on the current page) might be confusing rather than helpful.

If we add "Current Application (Open)" as distinct from "Current Application" we'll also have two copies of the same icon that do different things, I suppose.

This still looks weird to me, too (double magnifying glass icons):

chad added a comment.Apr 22 2015, 11:21 PM

Yeah I think custom searches should use the custom icon like in policies.