From f047b90d938358c262cda7b755ec6da4162ce19f Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 22 Mar 2019 09:57:12 -0700 Subject: [PATCH] Don't draw the task graph line image on devices by default Summary: See downstream . On mobile, the task graph can take up most of the screen. Hide it on devices. Keep it on the standalone view if you're really dedicated and willing to rotate your phone or whatever to see the lines. Test Plan: Dragged window real narrow, saw graph hide. Reviewers: amckinley Reviewed By: amckinley Differential Revision: https://secure.phabricator.com/D20313 --- .../ManiphestTaskGraphController.php | 1 + .../graph/ManiphestTaskGraph.php | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/applications/maniphest/controller/ManiphestTaskGraphController.php b/src/applications/maniphest/controller/ManiphestTaskGraphController.php index 2f342a2d0f..f4655d1835 100644 --- a/src/applications/maniphest/controller/ManiphestTaskGraphController.php +++ b/src/applications/maniphest/controller/ManiphestTaskGraphController.php @@ -30,6 +30,7 @@ final class ManiphestTaskGraphController ->setViewer($viewer) ->setSeedPHID($task->getPHID()) ->setLimit($graph_limit) + ->setIsStandalone(true) ->loadGraph(); if (!$task_graph->isEmpty()) { $parent_type = ManiphestTaskDependedOnByTaskEdgeType::EDGECONST; diff --git a/src/infrastructure/graph/ManiphestTaskGraph.php b/src/infrastructure/graph/ManiphestTaskGraph.php index 99191760dd..74a1fe8701 100644 --- a/src/infrastructure/graph/ManiphestTaskGraph.php +++ b/src/infrastructure/graph/ManiphestTaskGraph.php @@ -4,6 +4,7 @@ final class ManiphestTaskGraph extends PhabricatorObjectGraph { private $seedMaps = array(); + private $isStandalone; protected function getEdgeTypes() { return array( @@ -24,6 +25,15 @@ final class ManiphestTaskGraph return $object->isClosed(); } + public function setIsStandalone($is_standalone) { + $this->isStandalone = $is_standalone; + return $this; + } + + public function getIsStandalone() { + return $this->isStandalone; + } + protected function newTableRow($phid, $object, $trace) { $viewer = $this->getViewer(); @@ -132,6 +142,14 @@ final class ManiphestTaskGraph array( true, !$this->getRenderOnlyAdjacentNodes(), + )) + ->setDeviceVisibility( + array( + true, + + // On mobile, we only show the actual graph drawing if we're on the + // standalone page, since it can take over the screen otherwise. + $this->getIsStandalone(), )); }