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

Improve rendering of history graph in "CommitGraphView"

Summary: Ref T13552. In the new combined "table/list" graph view, tidy up the graph rendering.

Test Plan: {F7633504}

Maniphest Tasks: T13552

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

+71 -38
+10 -10
resources/celerity/map.php
··· 15 15 'differential.pkg.css' => '5c459f92', 16 16 'differential.pkg.js' => '218fda21', 17 17 'diffusion.pkg.css' => '42c75c37', 18 - 'diffusion.pkg.js' => 'a98c0bf7', 18 + 'diffusion.pkg.js' => '8ee48a4b', 19 19 'maniphest.pkg.css' => '35995d6d', 20 20 'maniphest.pkg.js' => 'c9308721', 21 21 'rsrc/audio/basic/alert.mp3' => '17889334', ··· 73 73 'rsrc/css/application/diffusion/diffusion-icons.css' => '23b31a1b', 74 74 'rsrc/css/application/diffusion/diffusion-readme.css' => 'b68a76e4', 75 75 'rsrc/css/application/diffusion/diffusion-repository.css' => 'b89e8c6c', 76 - 'rsrc/css/application/diffusion/diffusion.css' => 'b54c77b0', 76 + 'rsrc/css/application/diffusion/diffusion.css' => 'a54bb336', 77 77 'rsrc/css/application/feed/feed.css' => 'd8b6e3f8', 78 78 'rsrc/css/application/files/global-drag-and-drop.css' => '1d2713a4', 79 79 'rsrc/css/application/flag/flag.css' => '2b77be8d', ··· 390 390 'rsrc/js/application/diffusion/ExternalEditorLinkEngine.js' => '48a8641f', 391 391 'rsrc/js/application/diffusion/behavior-audit-preview.js' => 'b7b73831', 392 392 'rsrc/js/application/diffusion/behavior-commit-branches.js' => '4b671572', 393 - 'rsrc/js/application/diffusion/behavior-commit-graph.js' => 'ef836bf2', 393 + 'rsrc/js/application/diffusion/behavior-commit-graph.js' => '3be6ef4f', 394 394 'rsrc/js/application/diffusion/behavior-locate-file.js' => '87428eb2', 395 395 'rsrc/js/application/diffusion/behavior-pull-lastmodified.js' => 'c715c123', 396 396 'rsrc/js/application/doorkeeper/behavior-doorkeeper-tag.js' => '6a85bc5a', ··· 567 567 'differential-revision-history-css' => '8aa3eac5', 568 568 'differential-revision-list-css' => '93d2df7d', 569 569 'differential-table-of-contents-css' => 'bba788b9', 570 - 'diffusion-css' => 'b54c77b0', 570 + 'diffusion-css' => 'a54bb336', 571 571 'diffusion-icons-css' => '23b31a1b', 572 572 'diffusion-readme-css' => 'b68a76e4', 573 573 'diffusion-repository-css' => 'b89e8c6c', ··· 615 615 'javelin-behavior-differential-diff-radios' => '925fe8cd', 616 616 'javelin-behavior-differential-populate' => 'b86ef6c2', 617 617 'javelin-behavior-diffusion-commit-branches' => '4b671572', 618 - 'javelin-behavior-diffusion-commit-graph' => 'ef836bf2', 618 + 'javelin-behavior-diffusion-commit-graph' => '3be6ef4f', 619 619 'javelin-behavior-diffusion-locate-file' => '87428eb2', 620 620 'javelin-behavior-diffusion-pull-lastmodified' => 'c715c123', 621 621 'javelin-behavior-document-engine' => '243d6c22', ··· 1249 1249 'javelin-behavior', 1250 1250 'phabricator-prefab', 1251 1251 ), 1252 + '3be6ef4f' => array( 1253 + 'javelin-behavior', 1254 + 'javelin-dom', 1255 + 'javelin-stratcom', 1256 + ), 1252 1257 '3dc5ad43' => array( 1253 1258 'javelin-behavior', 1254 1259 'javelin-stratcom', ··· 2172 2177 ), 2173 2178 'ee77366f' => array( 2174 2179 'aphront-dialog-view-css', 2175 - ), 2176 - 'ef836bf2' => array( 2177 - 'javelin-behavior', 2178 - 'javelin-dom', 2179 - 'javelin-stratcom', 2180 2180 ), 2181 2181 'f340a484' => array( 2182 2182 'javelin-install',
+38 -26
src/applications/diffusion/view/DiffusionCommitGraphView.php
··· 82 82 } 83 83 84 84 public function render() { 85 - $viewer = $this->getUser(); 86 - 87 - $drequest = $this->getDiffusionRequest(); 88 - $repository = $drequest->getRepository(); 85 + $viewer = $this->getViewer(); 89 86 90 87 require_celerity_resource('diffusion-css'); 91 - Javelin::initBehavior('phabricator-tooltips'); 92 88 93 89 $show_builds = $this->shouldShowBuilds(); 94 90 $show_revisions = $this->shouldShowRevisions(); ··· 107 103 $item_date = phabricator_date($item_epoch, $viewer); 108 104 if ($item_date !== $last_date) { 109 105 $last_date = $item_date; 110 - $content[] = $item_date; 106 + $content[] = phutil_tag( 107 + 'div', 108 + array( 109 + 'class' => 'diffusion-commit-graph-date-header', 110 + ), 111 + $item_date); 111 112 } 112 113 113 114 $commit_description = $this->getCommitDescription($commit); 114 - $commit_link = $this->getCommitURI($commit, $item_hash); 115 + $commit_link = $this->getCommitURI($item_hash); 115 116 116 - $short_hash = $this->getCommitObjectName($commit, $item_hash); 117 + $short_hash = $this->getCommitObjectName($item_hash); 117 118 $is_disabled = $this->getCommitIsDisabled($commit); 118 119 119 120 $author_view = $this->getCommitAuthorView($commit); ··· 156 157 157 158 $content[] = $view; 158 159 159 - $rows[] = array( 160 - $content, 161 - ); 160 + $rows[] = $content; 162 161 } 163 162 164 163 $graph = $this->newGraphView(); 165 - if ($graph) { 166 - $idx = 0; 167 - foreach ($rows as $key => $row) { 168 - array_unshift($row, $graph[$idx++]); 169 - $rows[$key] = $row; 170 - } 171 - } 172 - 173 - foreach ($rows as $key => $row) { 164 + foreach ($rows as $idx => $row) { 174 165 $cells = array(); 175 - foreach ($row as $cell) { 176 - $cells[] = phutil_tag('td', array(), $cell); 166 + 167 + if ($graph) { 168 + $cells[] = phutil_tag( 169 + 'td', 170 + array( 171 + 'class' => 'diffusion-commit-graph-path-cell', 172 + ), 173 + $graph[$idx]); 177 174 } 178 - $rows[$key] = phutil_tag('tr', array(), $cells); 175 + 176 + $cells[] = phutil_tag( 177 + 'td', 178 + array( 179 + 'class' => 'diffusion-commit-graph-content-cell', 180 + ), 181 + $row); 182 + 183 + $rows[$idx] = phutil_tag('tr', array(), $cells); 179 184 } 180 185 181 - $table = phutil_tag('table', array(), $rows); 186 + $table = phutil_tag( 187 + 'table', 188 + array( 189 + 'class' => 'diffusion-commit-graph-table', 190 + ), 191 + $rows); 182 192 183 193 return $table; 184 194 } ··· 275 285 return $commit->getCommitData()->getSummary(); 276 286 } 277 287 278 - private function getCommitURI($commit, $hash) { 288 + private function getCommitURI($hash) { 279 289 $repository = $this->getRepository(); 280 290 281 291 if ($repository) { 282 292 return $repository->getCommitURI($hash); 283 293 } 284 294 295 + $commit = $this->getCommit($hash); 285 296 return $commit->getURI(); 286 297 } 287 298 288 - private function getCommitObjectName($commit, $hash) { 299 + private function getCommitObjectName($hash) { 289 300 $repository = $this->getRepository(); 290 301 291 302 if ($repository) { ··· 294 305 $is_local = true); 295 306 } 296 307 308 + $commit = $this->getCommit($hash); 297 309 return $commit->getDisplayName(); 298 310 } 299 311
+1
src/infrastructure/diff/view/PHUIDiffGraphView.php
··· 205 205 'diffusion-commit-graph', 206 206 array( 207 207 'count' => $count, 208 + 'autoheight' => true, 208 209 )); 209 210 210 211 return $graph;
+14
webroot/rsrc/css/application/diffusion/diffusion.css
··· 237 237 border-right: none; 238 238 border-color: {$thinblueborder}; 239 239 } 240 + 241 + .diffusion-commit-graph-table td.diffusion-commit-graph-path-cell { 242 + padding: 0 4px 0 0; 243 + } 244 + 245 + .diffusion-commit-graph-table td.diffusion-commit-graph-path-cell > canvas { 246 + display: block; 247 + } 248 + 249 + .diffusion-commit-graph-date-header { 250 + color: {$darkgreytext}; 251 + font-weight: bold; 252 + padding: 4px 0; 253 + }
+8 -2
webroot/rsrc/js/application/diffusion/behavior-commit-graph.js
··· 61 61 return (col * cell) + (cell / 2); 62 62 }; 63 63 64 - var h = 34; 64 + var h; 65 + if (config.autoheight) { 66 + h = JX.Vector.getDim(nodes[ii].parentNode).y; 67 + } else { 68 + h = 34; 69 + } 70 + 65 71 var w = cell * config.count; 66 72 67 73 var canvas = JX.$N('canvas', {width: w, height: h}); ··· 147 153 } 148 154 } 149 155 150 - JX.DOM.setContent(nodes[ii], canvas); 156 + JX.DOM.replace(nodes[ii], canvas); 151 157 } 152 158 153 159