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

Set an explicit height when drawing the dependent revision graph

Summary:
See PHI1900. Recent changes to how commit graphs are drawn made the height automatic in most cases, but it fails in Differential because the element isn't initially visible so the computed height is 0.

Just give them an explicit height so they show up again.

Test Plan: Viewed graphs in Maniphest, Differential, and Diffusion; saw them all render properly.

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

+45 -14
+8 -8
resources/celerity/map.php
··· 15 15 'differential.pkg.css' => '5c459f92', 16 16 'differential.pkg.js' => '5080baf4', 17 17 'diffusion.pkg.css' => '42c75c37', 18 - 'diffusion.pkg.js' => '8ee48a4b', 18 + 'diffusion.pkg.js' => '78c9885d', 19 19 'maniphest.pkg.css' => '35995d6d', 20 20 'maniphest.pkg.js' => 'c9308721', 21 21 'rsrc/audio/basic/alert.mp3' => '17889334', ··· 394 394 'rsrc/js/application/diffusion/ExternalEditorLinkEngine.js' => '48a8641f', 395 395 'rsrc/js/application/diffusion/behavior-audit-preview.js' => 'b7b73831', 396 396 'rsrc/js/application/diffusion/behavior-commit-branches.js' => '4b671572', 397 - 'rsrc/js/application/diffusion/behavior-commit-graph.js' => '3be6ef4f', 397 + 'rsrc/js/application/diffusion/behavior-commit-graph.js' => 'ac10c917', 398 398 'rsrc/js/application/diffusion/behavior-locate-file.js' => '87428eb2', 399 399 'rsrc/js/application/diffusion/behavior-pull-lastmodified.js' => 'c715c123', 400 400 'rsrc/js/application/doorkeeper/behavior-doorkeeper-tag.js' => '6a85bc5a', ··· 623 623 'javelin-behavior-differential-diff-radios' => '925fe8cd', 624 624 'javelin-behavior-differential-populate' => 'b86ef6c2', 625 625 'javelin-behavior-diffusion-commit-branches' => '4b671572', 626 - 'javelin-behavior-diffusion-commit-graph' => '3be6ef4f', 626 + 'javelin-behavior-diffusion-commit-graph' => 'ac10c917', 627 627 'javelin-behavior-diffusion-locate-file' => '87428eb2', 628 628 'javelin-behavior-diffusion-pull-lastmodified' => 'c715c123', 629 629 'javelin-behavior-document-engine' => '243d6c22', ··· 1250 1250 'phuix-button-view', 1251 1251 'javelin-external-editor-link-engine', 1252 1252 ), 1253 - '3be6ef4f' => array( 1254 - 'javelin-behavior', 1255 - 'javelin-dom', 1256 - 'javelin-stratcom', 1257 - ), 1258 1253 '3dc5ad43' => array( 1259 1254 'javelin-behavior', 1260 1255 'javelin-stratcom', ··· 1926 1921 'javelin-install', 1927 1922 'javelin-dom', 1928 1923 'phabricator-notification', 1924 + ), 1925 + 'ac10c917' => array( 1926 + 'javelin-behavior', 1927 + 'javelin-dom', 1928 + 'javelin-stratcom', 1929 1929 ), 1930 1930 'ac2b1e01' => array( 1931 1931 'javelin-behavior',
+5
src/applications/differential/controller/DifferentialRevisionViewController.php
··· 510 510 ->setLoadEntireGraph(true) 511 511 ->loadGraph(); 512 512 if (!$stack_graph->isEmpty()) { 513 + // See PHI1900. The graph UI element now tries to figure out the correct 514 + // height automatically, but currently can't in this case because the 515 + // element is not visible when the page loads. Set an explicit height. 516 + $stack_graph->setHeight(34); 517 + 513 518 $stack_table = $stack_graph->newGraphTable(); 514 519 515 520 $parent_type = DifferentialRevisionDependsOnRevisionEdgeType::EDGECONST;
+11 -1
src/infrastructure/diff/view/PHUIDiffGraphView.php
··· 4 4 5 5 private $isHead = true; 6 6 private $isTail = true; 7 + private $height; 7 8 8 9 public function setIsHead($is_head) { 9 10 $this->isHead = $is_head; ··· 21 22 22 23 public function getIsTail() { 23 24 return $this->isTail; 25 + } 26 + 27 + public function setHeight($height) { 28 + $this->height = $height; 29 + return $this; 30 + } 31 + 32 + public function getHeight() { 33 + return $this->height; 24 34 } 25 35 26 36 public function renderRawGraph(array $parents) { ··· 205 215 'diffusion-commit-graph', 206 216 array( 207 217 'count' => $count, 208 - 'autoheight' => true, 218 + 'height' => $this->getHeight(), 209 219 )); 210 220 211 221 return $graph;
+18 -2
src/infrastructure/graph/PhabricatorObjectGraph.php
··· 11 11 private $loadEntireGraph = false; 12 12 private $limit; 13 13 private $adjacent; 14 + private $height; 14 15 15 16 public function setViewer(PhabricatorUser $viewer) { 16 17 $this->viewer = $viewer; ··· 32 33 33 34 public function getLimit() { 34 35 return $this->limit; 36 + } 37 + 38 + public function setHeight($height) { 39 + $this->height = $height; 40 + return $this; 41 + } 42 + 43 + public function getHeight() { 44 + return $this->height; 35 45 } 36 46 37 47 final public function setRenderOnlyAdjacentNodes($adjacent) { ··· 193 203 194 204 $ancestry = array_select_keys($ancestry, $order); 195 205 196 - $traces = id(new PHUIDiffGraphView()) 197 - ->renderGraph($ancestry); 206 + $graph_view = id(new PHUIDiffGraphView()); 207 + 208 + $height = $this->getHeight(); 209 + if ($height !== null) { 210 + $graph_view->setHeight($height); 211 + } 212 + 213 + $traces = $graph_view->renderGraph($ancestry); 198 214 199 215 $ii = 0; 200 216 $rows = array();
+3 -3
webroot/rsrc/js/application/diffusion/behavior-commit-graph.js
··· 62 62 }; 63 63 64 64 var h; 65 - if (config.autoheight) { 66 - h = JX.Vector.getDim(nodes[ii].parentNode).y; 65 + if (config.height) { 66 + h = config.height; 67 67 } else { 68 - h = 34; 68 + h = JX.Vector.getDim(nodes[ii].parentNode).y; 69 69 } 70 70 71 71 var w = cell * config.count;