@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Phriction: clarify its search results as "Wiki page"

Summary:
This patch changes a bit how your search results from Phriction
are described in the autocomplete component (the "Typehead"):

{F276843}

After this change, Phriction search results will also contain the word
"Wiki page" so that users can better understand what the result
actually is. Just like a Diffusion repository mentions that it's
a "Repository", and just like a Project mentions that it's a
"Project" and so on.

Before this change, the Typehead entries were only mentioning
the slug of that wiki page.

| Before | After |
| {F274820} | {F272278} |

It's unclear if the previous behavior was a mistake (since the
internal parameter of the Typehead is called "type", and so, it
is supposed to mention the application type, not the slug.

Anyway, as a compromise, the slug is still mentioned.

To be honest this is just an excuse to put the middle dot /
aka interpunct character in this project again. Yeah, here the
middle point was used as separator. The apparent reason is:
because the middle point was already in use elsewhere in Phorge.
The real reason is: I'm a lobbyist in a corporation that sells
interpuncts worldwide as our core business, and so, I designed
thisvil plan to put the following middle point - again - in
Phorge (evil laugh).

Closes T15213

Test Plan:
- Search "Change Log" in the up-right bar (or similar)
- You see "Wiki Page · change_log/" (or similar)

Reviewers: O1 Blessed Committers, Cigaryno, avivey

Reviewed By: O1 Blessed Committers, Cigaryno, avivey

Subscribers: avivey, speck, tobiaswiese, Matthew, Cigaryno

Tags: #phriction

Maniphest Tasks: T15213

Differential Revision: https://we.phorge.it/D25102

+17 -4
+17 -4
src/applications/phriction/typeahead/PhrictionDocumentDatasource.php
··· 18 18 public function loadResults() { 19 19 $viewer = $this->getViewer(); 20 20 21 + $app_type = pht('Wiki Document'); 22 + $mid_dot = "\xC2\xB7"; 23 + 21 24 $query = id(new PhrictionDocumentQuery()) 22 25 ->setViewer($viewer) 23 26 ->needContent(true); ··· 34 37 foreach ($documents as $document) { 35 38 $content = $document->getContent(); 36 39 37 - if (!$document->isActive()) { 38 - $closed = $document->getStatusDisplayName(); 39 - } else { 40 + if ($document->isActive()) { 40 41 $closed = null; 42 + } else { 43 + $closed = $document->getStatusDisplayName(); 41 44 } 42 45 43 46 $slug = $document->getSlug(); 44 47 $title = $content->getTitle(); 45 48 49 + // For some time the search result was 50 + // just mentioning the document slug. 51 + // Now, it also mentions the application type. 52 + // Example: "Wiki Document - /foo/bar" 53 + $display_type = sprintf( 54 + '%s %s %s', 55 + $app_type, 56 + $mid_dot, 57 + $slug); 58 + 46 59 $sprite = 'phabricator-search-icon phui-font-fa phui-icon-view fa-book'; 47 60 $autocomplete = '[[ '.$slug.' ]]'; 48 61 ··· 51 64 ->setDisplayName($title) 52 65 ->setURI($document->getURI()) 53 66 ->setPHID($document->getPHID()) 54 - ->setDisplayType($slug) 67 + ->setDisplayType($display_type) 55 68 ->setPriorityType('wiki') 56 69 ->setImageSprite($sprite) 57 70 ->setAutocomplete($autocomplete)