@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.

Feed Differential retitled: do not repeat the title twice

Summary:
This is a cosmetic modification for a specific Feed.

https://we.phorge.it/T15183

If you retitle a Diff (and you do nothing else), its Feed
is somehow too much verbose:

... retitled NEW_TITLE from OLD_TITLE to NEW_TITLE

In this specific case, the Feed now becomes shorter so that
the NEW_TITLE is not repeated twice:

... retitled NEW_TITLE from OLD_TITLE

Note that, if the title changes again, the Feed naturally comes
back as before so to mention the change and obviously without
any repetition. Example:

... retitled CURRENT_TITLE from OLD_TITLE to NEW_TITLE

Closes T15183

Test Plan:
- take a Diff named "OLD_TITLE" and retitle to "NEW_TITLE"
- visit the homepage and see "retitled NEW_TITLE from OLD_TITLE"
(this means the new behavior works)
- retitle the Diff from "NEW_TITLE" to "CURRENT_TITLE"
- visit the homepage again and see "retitled CURRENT_TITLE from OLD_TITLE to NEW_TITLE"
(this means the old behavior still works)

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: avivey, speck, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15183

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

+11
+11
src/applications/differential/xaction/DifferentialRevisionTitleTransaction.php
··· 23 23 } 24 24 25 25 public function getTitleForFeed() { 26 + $obj = $this->getObject(); 27 + 28 + // To avoid verbose messages we mention the current title just once 29 + if ($obj && $obj->getTitle() === $this->getNewValue()) { 30 + return pht( 31 + '%s retitled %s from %s', 32 + $this->renderAuthor(), 33 + $this->renderObject(), 34 + $this->renderOldValue()); 35 + } 36 + 26 37 return pht( 27 38 '%s retitled %s from %s to %s.', 28 39 $this->renderAuthor(),