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

Update blame view in Diffusion

Summary: Ref T12824, adds more information to the blame view, exposes date, commit summary, lighter colors.

Test Plan:
Review many diffs with and without blame on.

{F5111758}

{F5111759}

Reviewers: epriestley

Reviewed By: epriestley

Spies: Korvin

Maniphest Tasks: T12824

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

+78 -77
+2 -2
resources/celerity/map.php
··· 74 74 'rsrc/css/application/diffusion/diffusion-icons.css' => '0c15255e', 75 75 'rsrc/css/application/diffusion/diffusion-readme.css' => '419dd5b6', 76 76 'rsrc/css/application/diffusion/diffusion-repository.css' => 'ee6f20ec', 77 - 'rsrc/css/application/diffusion/diffusion-source.css' => '750add59', 77 + 'rsrc/css/application/diffusion/diffusion-source.css' => '48d222a6', 78 78 'rsrc/css/application/diffusion/diffusion.css' => 'ceacf994', 79 79 'rsrc/css/application/feed/feed.css' => 'ecd4ec57', 80 80 'rsrc/css/application/files/global-drag-and-drop.css' => 'b556a948', ··· 574 574 'diffusion-icons-css' => '0c15255e', 575 575 'diffusion-readme-css' => '419dd5b6', 576 576 'diffusion-repository-css' => 'ee6f20ec', 577 - 'diffusion-source-css' => '750add59', 577 + 'diffusion-source-css' => '48d222a6', 578 578 'diviner-shared-css' => '896f1d43', 579 579 'font-fontawesome' => 'e838e088', 580 580 'font-lato' => 'c7ccd872',
+32 -58
src/applications/diffusion/controller/DiffusionBrowseController.php
··· 1116 1116 )); 1117 1117 } 1118 1118 1119 - $skip_text = pht('Skip Past This Commit'); 1120 1119 foreach ($display as $line_index => $line) { 1121 1120 $row = array(); 1122 1121 ··· 1132 1131 $revision_link = null; 1133 1132 $commit_link = null; 1134 1133 $before_link = null; 1134 + $commit_date = null; 1135 1135 1136 - $style = 'background: '.$line['color'].';'; 1136 + $style = 'border-right: 2px solid '.$line['color'].';'; 1137 1137 1138 1138 if ($identifier && !$line['duplicate']) { 1139 1139 if (isset($commit_links[$identifier])) { 1140 - $commit_link = $commit_links[$identifier]; 1140 + $commit_link = $commit_links[$identifier]['link']; 1141 + $commit_date = $commit_links[$identifier]['date']; 1141 1142 } 1142 1143 1143 1144 if (isset($revision_map[$identifier])) { ··· 1148 1149 } 1149 1150 1150 1151 $skip_href = $line_href.'?before='.$identifier.'&view=blame'; 1152 + $skip_text = pht('Skip Past This Commit'); 1153 + $icon = id(new PHUIIconView()) 1154 + ->setIcon('fa-caret-square-o-left'); 1155 + 1151 1156 $before_link = javelin_tag( 1152 1157 'a', 1153 1158 array( ··· 1159 1164 'size' => 300, 1160 1165 ), 1161 1166 ), 1162 - "\xC2\xAB"); 1167 + $icon); 1163 1168 } 1164 1169 1165 1170 if ($show_blame) { ··· 1183 1188 'class' => 'diffusion-rev-link', 1184 1189 ), 1185 1190 $object_links); 1191 + 1192 + $row[] = phutil_tag( 1193 + 'th', 1194 + array( 1195 + 'class' => 'diffusion-blame-date', 1196 + ), 1197 + $commit_date); 1186 1198 } 1187 1199 1188 1200 $line_link = phutil_tag( 1189 1201 'a', 1190 1202 array( 1191 1203 'href' => $line_href, 1192 - 'style' => $style, 1193 1204 ), 1194 1205 $line_number); 1195 1206 1196 1207 $row[] = javelin_tag( 1197 1208 'th', 1198 1209 array( 1199 - 'class' => 'diffusion-line-link', 1210 + 'class' => 'diffusion-line-link ', 1200 1211 'sigil' => 'phabricator-source-line', 1201 1212 'style' => $style, 1202 1213 ), ··· 1510 1521 return head($parents); 1511 1522 } 1512 1523 1513 - private function renderRevisionTooltip( 1514 - DifferentialRevision $revision, 1515 - $handles) { 1516 - $viewer = $this->getRequest()->getUser(); 1517 - 1518 - $date = phabricator_date($revision->getDateModified(), $viewer); 1519 - $id = $revision->getID(); 1520 - $title = $revision->getTitle(); 1521 - $header = "D{$id} {$title}"; 1522 - 1523 - $author = $handles[$revision->getAuthorPHID()]->getName(); 1524 - 1525 - return "{$header}\n{$date} \xC2\xB7 {$author}"; 1526 - } 1527 - 1528 - private function renderCommitTooltip( 1529 - PhabricatorRepositoryCommit $commit, 1530 - $author) { 1531 - 1532 - $viewer = $this->getRequest()->getUser(); 1533 - 1534 - $date = phabricator_date($commit->getEpoch(), $viewer); 1535 - $summary = trim($commit->getSummary()); 1536 - 1537 - return "{$summary}\n{$date} \xC2\xB7 {$author}"; 1538 - } 1539 - 1540 1524 protected function markupText($text) { 1541 1525 $engine = PhabricatorMarkupEngine::newDiffusionMarkupEngine(); 1542 1526 $engine->setConfig('viewer', $this->getRequest()->getUser()); ··· 1737 1721 ->setViewer($viewer) 1738 1722 ->withRepository($repository) 1739 1723 ->withIdentifiers($identifiers) 1740 - // TODO: We only fetch this to improve author display behavior, but 1741 - // shouldn't really need to? 1742 - ->needCommitData(true) 1743 1724 ->execute(); 1744 1725 $commits = mpull($commits, null, 'getCommitIdentifier'); 1745 1726 } else { ··· 1751 1732 1752 1733 private function renderCommitLinks(array $commits, $handles) { 1753 1734 $links = array(); 1735 + $viewer = $this->getViewer(); 1754 1736 foreach ($commits as $identifier => $commit) { 1755 - $tooltip = $this->renderCommitTooltip( 1756 - $commit, 1757 - $commit->renderAuthorShortName($handles)); 1737 + $date = phabricator_date($commit->getEpoch(), $viewer); 1738 + $summary = trim($commit->getSummary()); 1758 1739 1759 - $commit_link = javelin_tag( 1740 + $commit_link = phutil_tag( 1760 1741 'a', 1761 1742 array( 1762 1743 'href' => $commit->getURI(), 1763 - 'sigil' => 'has-tooltip', 1764 - 'meta' => array( 1765 - 'tip' => $tooltip, 1766 - 'align' => 'E', 1767 - 'size' => 600, 1768 - ), 1769 1744 ), 1770 - $commit->getLocalName()); 1745 + $summary); 1771 1746 1772 - $links[$identifier] = $commit_link; 1747 + $commit_date = phutil_tag( 1748 + 'a', 1749 + array( 1750 + 'href' => $commit->getURI(), 1751 + ), 1752 + $date); 1753 + 1754 + $links[$identifier]['link'] = $commit_link; 1755 + $links[$identifier]['date'] = $commit_date; 1773 1756 } 1774 1757 1775 1758 return $links; ··· 1780 1763 1781 1764 foreach ($revisions as $revision) { 1782 1765 $revision_id = $revision->getID(); 1783 - 1784 - $tooltip = $this->renderRevisionTooltip($revision, $handles); 1785 - 1786 - $revision_link = javelin_tag( 1766 + $revision_link = phutil_tag( 1787 1767 'a', 1788 1768 array( 1789 1769 'href' => '/'.$revision->getMonogram(), 1790 - 'sigil' => 'has-tooltip', 1791 - 'meta' => array( 1792 - 'tip' => $tooltip, 1793 - 'align' => 'E', 1794 - 'size' => 600, 1795 - ), 1796 1770 ), 1797 1771 $revision->getMonogram()); 1798 1772
+44 -17
webroot/rsrc/css/application/diffusion/diffusion-source.css
··· 7 7 background: {$page.content}; 8 8 } 9 9 10 - .diffusion-source tr.phabricator-source-highlight { 11 - background: {$sh-yellowbackground}; 10 + .diffusion-source tr.phabricator-source-highlight th, 11 + .diffusion-source tr.phabricator-source-highlight td { 12 + background: {$gentle.highlight}; 12 13 } 13 14 14 15 .diffusion-source th { 15 16 text-align: right; 16 17 vertical-align: top; 17 - background: {$lightgreybackground}; 18 - color: {$bluetext}; 18 + color: {$darkbluetext}; 19 19 border-right: 1px solid {$thinblueborder}; 20 20 } 21 21 22 22 .diffusion-source td { 23 23 vertical-align: top; 24 24 white-space: pre-wrap; 25 - padding-top: 1px; 26 - padding-bottom: 1px; 27 - padding-left: 8px; 25 + padding: 3px 12px; 28 26 width: 100%; 29 27 word-break: break-all; 30 28 } ··· 34 32 } 35 33 36 34 .diffusion-blame-link, 37 - .diffusion-rev-link { 35 + .diffusion-rev-link, 36 + .diffusion-blame-date { 38 37 white-space: nowrap; 39 38 } 40 39 41 - .diffusion-blame-link { 42 - min-width: 28px; 40 + .diffusion-blame-date { 41 + background: {$lightgreybackground}; 42 + font: {$basefont}; 43 + font-size: {$smallestfontsize}; 44 + } 45 + 46 + .diffusion-blame-link, 47 + .diffusion-line-link { 48 + background: {$lightgreybackground}; 43 49 } 44 50 45 51 .diffusion-source th.diffusion-rev-link { 46 52 text-align: left; 47 53 min-width: 130px; 54 + background: {$lightgreybackground}; 55 + font: {$basefont}; 56 + font-size: {$smallestfontsize}; 48 57 } 49 58 50 - .diffusion-blame-link a, 51 - .diffusion-rev-link a, 52 - .diffusion-line-link a { 59 + .diffusion-source a { 53 60 color: {$darkbluetext}; 54 61 } 55 62 63 + .diffusion-rev-link a { 64 + max-width: 340px; 65 + overflow: hidden; 66 + white-space: nowrap; 67 + text-overflow: ellipsis; 68 + } 69 + 56 70 .diffusion-rev-link a, 57 - .diffusion-rev-link span { 58 - margin: 2px 8px 0; 59 - display: inline-block; 71 + .diffusion-rev-link span, 72 + .diffusion-blame-date a { 73 + margin: 3px 8px; 74 + display: block; 60 75 } 61 76 62 77 .diffusion-rev-link span { ··· 69 84 .diffusion-line-link a { 70 85 /* Give the user a larger click target. */ 71 86 display: block; 72 - padding: 2px 8px; 87 + padding: 4px 8px 3px; 88 + } 89 + 90 + .diffusion-line-link a { 91 + color: {$lightgreytext}; 92 + } 93 + 94 + .diffusion-blame-link a .phui-icon-view { 95 + color: {$bluetext}; 96 + } 97 + 98 + .diffusion-blame-link a:hover .phui-icon-view { 99 + color: {$sky}; 73 100 } 74 101 75 102 .diffusion-line-link {