Page MenuHomePhabricator

Implement viewer() and members(project) typeahead functions
ClosedPublic

Authored by epriestley on Apr 17 2015, 12:37 AM.

Details

Summary

Ref T4100. This is still a bit rough around the edges, but mostly does what we're after.

  • Implements viewer() and members(...) functions.
  • The new browse workflow makes these discoverable.
Test Plan

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

epriestley retitled this revision from to Implement viewer() and members(project) typeahead functions.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.

I think I'd ideally like to do this:

  • Give the function tokens a distinct silhouette (change their shape, give them a heavy outline, animate them, something like that).
  • Additionally, give them a consistent background and icon color.
  • Give project tokens their project colors.
  • Change disabled/closed tokens to grey with strikethrough.

I don't know if we can figure out a silhouette approach that doesn't look junky, though. If we can't and/or you don't like that, a less aggressive approach might be:

  • Give function tokens a background and icon color (yellow? yellow = function).
  • Give project tokens an icon color, but leave the token itself blue (blue = object)
  • Change disabled tokens to grey (maybe no strikethrough) (grey = disabled/closed object).
  • Change invalid tokens to red (red = invalid token).

That's a little less crazy than trying to do silhouette changes, and maybe better?

I'm not happy with them right now; I'd like them to be more distinct than they are.

Either of those color approaches would also let us vary the icons freely. I think it might be more natural to give "members(x)" a "users" icon than a "magic wand" icon.

As I think about it I'm less into the silhouette idea. Let's just try the colors first. I'll do that in a followup.

chad added a comment.Apr 17 2015, 12:47 AM

if we are using text, perhaps no icon to be truly distinctive?

btrahan accepted this revision.Apr 17 2015, 5:29 PM
btrahan edited edge metadata.

awesometown

src/applications/search/engine/PhabricatorApplicationSearchEngine.php
386–392

maybe look for a terminal ')' instead?

This revision is now accepted and ready to land.Apr 17 2015, 5:29 PM

I'm looking for "(" because I want this to count as a "function token" as the user types it out:

members(x

Specifically, that's sufficient for the "members" datasource to know that the user is calling the "members" function, and it should query for projects matching "x...".

That said, I can replace that call with PhabricatorTypeaheadDatasource::isFunctionToken().

epriestley updated this revision to Diff 29871.Apr 17 2015, 6:05 PM
epriestley edited edge metadata.
  • Use isFunctionToken().
  • Add a comment explaining the reasoning around "(".
This revision was automatically updated to reflect the committed changes.