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

Provide hovercards for generic edge stories, and include more message information in commit hovercards

Summary:
Ref T13620.

- Make generic edge stories render links with hovercards. Other story types (like subscriptions) already do this so I'm fairly certain this is just old code from before hovercards.
- Include a longer commit message snippet in hovercards.

Test Plan: {F8465645}

Maniphest Tasks: T13620

Differential Revision: https://secure.phabricator.com/D21574

+22 -3
+15 -2
src/applications/diffusion/engineextension/DiffusionHovercardEngineExtension.php
··· 48 48 $handles = $viewer->loadHandles($phids); 49 49 50 50 $hovercard->setTitle($handle->getName()); 51 - $hovercard->setDetail($commit->getSummary()); 51 + 52 + // See T13620. Use a longer slice of the message than the "summary" here, 53 + // since we have at least a few lines of room in the UI. 54 + $commit_message = $commit->getCommitMessageForDisplay(); 55 + 56 + $message_limit = 512; 57 + 58 + $short_message = id(new PhutilUTF8StringTruncator()) 59 + ->setMaximumBytes($message_limit * 4) 60 + ->setMaximumGlyphs($message_limit) 61 + ->truncateString($commit_message); 62 + $short_message = phutil_escape_html_newlines($short_message); 63 + 64 + $hovercard->setDetail($short_message); 52 65 53 66 $repository = $handles[$repository_phid]->renderLink(); 54 67 $hovercard->addField(pht('Repository'), $repository); ··· 64 77 } 65 78 66 79 $date = phabricator_date($commit->getEpoch(), $viewer); 67 - $hovercard->addField(pht('Date'), $date); 80 + $hovercard->addField(pht('Commit Date'), $date); 68 81 69 82 if (!$commit->isAuditStatusNoAudit()) { 70 83 $status = $commit->getAuditStatusObject();
+6
src/applications/repository/storage/PhabricatorRepositoryCommit.php
··· 528 528 return $data->getCommitterString(); 529 529 } 530 530 531 + public function getCommitMessageForDisplay() { 532 + $data = $this->getCommitData(); 533 + $message = $data->getCommitMessage(); 534 + return $message; 535 + } 536 + 531 537 public function newCommitRef(PhabricatorUser $viewer) { 532 538 $repository = $this->getRepository(); 533 539
+1 -1
src/applications/transactions/storage/PhabricatorApplicationTransaction.php
··· 408 408 409 409 public function renderHandleLink($phid) { 410 410 if ($this->renderingTarget == self::TARGET_HTML) { 411 - return $this->getHandle($phid)->renderLink(); 411 + return $this->getHandle($phid)->renderHovercardLink(); 412 412 } else { 413 413 return $this->getHandle($phid)->getLinkName(); 414 414 }