@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 commit branching graph

Summary:
Fixes T9323. Two minor fixes:

- On the first commit, don't render a downward line.
- Clean up a 1px spacing issue that had cropped up a while ago when we added icons or something, I think.

Test Plan:
Before:

{F1057248}

After:

{F1057249}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9323

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

+40 -17
+8 -8
resources/celerity/map.php
··· 13 13 'differential.pkg.css' => '2de124c9', 14 14 'differential.pkg.js' => '64e69521', 15 15 'diffusion.pkg.css' => 'f45955ed', 16 - 'diffusion.pkg.js' => 'ca1c8b5a', 16 + 'diffusion.pkg.js' => '3a9a8bfa', 17 17 'maniphest.pkg.css' => '4845691a', 18 18 'maniphest.pkg.js' => '949a7498', 19 19 'rsrc/css/aphront/aphront-bars.css' => '231ac33c', ··· 391 391 'rsrc/js/application/diffusion/DiffusionLocateFileSource.js' => 'b42eddc7', 392 392 'rsrc/js/application/diffusion/behavior-audit-preview.js' => 'd835b03a', 393 393 'rsrc/js/application/diffusion/behavior-commit-branches.js' => 'bdaf4d04', 394 - 'rsrc/js/application/diffusion/behavior-commit-graph.js' => '9007c197', 394 + 'rsrc/js/application/diffusion/behavior-commit-graph.js' => '5a0b1a64', 395 395 'rsrc/js/application/diffusion/behavior-jump-to.js' => '73d09eef', 396 396 'rsrc/js/application/diffusion/behavior-load-blame.js' => '42126667', 397 397 'rsrc/js/application/diffusion/behavior-locate-file.js' => '6d3e1947', ··· 598 598 'javelin-behavior-differential-toggle-files' => 'ca3f91eb', 599 599 'javelin-behavior-differential-user-select' => 'a8d8459d', 600 600 'javelin-behavior-diffusion-commit-branches' => 'bdaf4d04', 601 - 'javelin-behavior-diffusion-commit-graph' => '9007c197', 601 + 'javelin-behavior-diffusion-commit-graph' => '5a0b1a64', 602 602 'javelin-behavior-diffusion-jump-to' => '73d09eef', 603 603 'javelin-behavior-diffusion-locate-file' => '6d3e1947', 604 604 'javelin-behavior-diffusion-pull-lastmodified' => 'f01586dc', ··· 1218 1218 'javelin-vector', 1219 1219 'javelin-dom', 1220 1220 ), 1221 + '5a0b1a64' => array( 1222 + 'javelin-behavior', 1223 + 'javelin-dom', 1224 + 'javelin-stratcom', 1225 + ), 1221 1226 '5b2e3e2b' => array( 1222 1227 'javelin-stratcom', 1223 1228 'javelin-request', ··· 1522 1527 'javelin-stratcom', 1523 1528 'javelin-dom', 1524 1529 'javelin-workflow', 1525 - ), 1526 - '9007c197' => array( 1527 - 'javelin-behavior', 1528 - 'javelin-dom', 1529 - 'javelin-stratcom', 1530 1530 ), 1531 1531 '901935ef' => array( 1532 1532 'javelin-behavior',
+1
src/applications/diffusion/controller/DiffusionHistoryController.php
··· 52 52 if ($show_graph) { 53 53 $history_table->setParents($history_results['parents']); 54 54 $history_table->setIsHead(!$pager->getOffset()); 55 + $history_table->setIsTail(!$pager->getHasMorePages()); 55 56 } 56 57 57 58 $history_panel = new PHUIObjectBoxView();
+16
src/applications/diffusion/view/DiffusionHistoryTableView.php
··· 6 6 private $revisions = array(); 7 7 private $handles = array(); 8 8 private $isHead; 9 + private $isTail; 9 10 private $parents; 10 11 11 12 public function setHistory(array $history) { ··· 57 58 58 59 public function setIsHead($is_head) { 59 60 $this->isHead = $is_head; 61 + return $this; 62 + } 63 + 64 + public function setIsTail($is_tail) { 65 + $this->isTail = $is_tail; 60 66 return $this; 61 67 } 62 68 ··· 342 348 'split' => $splits, 343 349 'join' => $joins, 344 350 ); 351 + } 352 + 353 + // If this is the last page in history, replace the "o" with an "x" so we 354 + // do not draw a connecting line downward, and replace "^" with an "X" for 355 + // repositories with exactly one commit. 356 + if ($this->isTail && $graph) { 357 + $last = array_pop($graph); 358 + $last['line'] = str_replace('o', 'x', $last['line']); 359 + $last['line'] = str_replace('^', 'X', $last['line']); 360 + $graph[] = $last; 345 361 } 346 362 347 363 // Render into tags for the behavior.
+4
src/view/phui/PHUIPagerView.php
··· 58 58 return $this->hasMorePages; 59 59 } 60 60 61 + public function getHasMorePages() { 62 + return $this->hasMorePages; 63 + } 64 + 61 65 public function setSurroundingPages($pages) { 62 66 $this->surroundingPages = max(0, $pages); 63 67 return $this;
+11 -9
webroot/rsrc/js/application/diffusion/behavior-commit-graph.js
··· 37 37 38 38 // Stroke with fill (for commit circles). 39 39 function fstroke(c) { 40 + cxt.lineWidth = 1; 40 41 cxt.fillStyle = color(c); 41 42 cxt.strokeStyle = '#ffffff'; 42 43 cxt.fill(); ··· 52 53 return (col * cell) + (cell / 2); 53 54 }; 54 55 55 - var h = 30; 56 + var h = 32; 56 57 var w = cell * config.count; 57 58 58 59 var canvas = JX.$N('canvas', {width: w, height: h}); ··· 117 118 case 'o': 118 119 case '^': 119 120 case '|': 120 - if (c == 'o' || c == '^') { 121 - origin = xpos(jj); 121 + case 'x': 122 + case 'X': 123 + 124 + if (c !== 'X') { 125 + cxt.beginPath(); 126 + cxt.moveTo(xpos(jj), (c == '^' ? h/2 : 0)); 127 + cxt.lineTo(xpos(jj), (c == 'x' ? h/2 : h)); 128 + lstroke(jj); 122 129 } 123 130 124 - cxt.beginPath(); 125 - cxt.moveTo(xpos(jj), (c == '^' ? h/2 : 0)); 126 - cxt.lineTo(xpos(jj), h); 127 - lstroke(jj); 128 - 129 - if (c == 'o' || c == '^') { 131 + if (c == 'o' || c == '^' || c == 'x' || c == 'X') { 130 132 cxt.beginPath(); 131 133 cxt.arc(xpos(jj), h/2, 3, 0, 2 * Math.PI, true); 132 134 fstroke(jj);