diff --git a/src/applications/phriction/typeahead/PhrictionDocumentDatasource.php b/src/applications/phriction/typeahead/PhrictionDocumentDatasource.php --- a/src/applications/phriction/typeahead/PhrictionDocumentDatasource.php +++ b/src/applications/phriction/typeahead/PhrictionDocumentDatasource.php @@ -18,6 +18,9 @@ public function loadResults() { $viewer = $this->getViewer(); + $app_type = pht('Wiki Document'); + $mid_dot = "\xC2\xB7"; + $query = id(new PhrictionDocumentQuery()) ->setViewer($viewer) ->needContent(true); @@ -34,15 +37,25 @@ foreach ($documents as $document) { $content = $document->getContent(); - if (!$document->isActive()) { - $closed = $document->getStatusDisplayName(); - } else { + if ($document->isActive()) { $closed = null; + } else { + $closed = $document->getStatusDisplayName(); } $slug = $document->getSlug(); $title = $content->getTitle(); + // For some time the search result was + // just mentioning the document slug. + // Now, it also mentions the application type. + // Example: "Wiki Document - /foo/bar" + $display_type = sprintf( + '%s %s %s', + $app_type, + $mid_dot, + $slug); + $sprite = 'phabricator-search-icon phui-font-fa phui-icon-view fa-book'; $autocomplete = '[[ '.$slug.' ]]'; @@ -51,7 +64,7 @@ ->setDisplayName($title) ->setURI($document->getURI()) ->setPHID($document->getPHID()) - ->setDisplayType($slug) + ->setDisplayType($display_type) ->setPriorityType('wiki') ->setImageSprite($sprite) ->setAutocomplete($autocomplete)