diff --git a/src/applications/differential/controller/diffview/DifferentialDiffViewController.php b/src/applications/differential/controller/diffview/DifferentialDiffViewController.php index b8aa6e6ede..cfbab87f2f 100644 --- a/src/applications/differential/controller/diffview/DifferentialDiffViewController.php +++ b/src/applications/differential/controller/diffview/DifferentialDiffViewController.php @@ -105,7 +105,8 @@ final class DifferentialDiffViewController extends DifferentialController { $changesets = msort($changesets, 'getSortKey'); $table_of_contents = id(new DifferentialDiffTableOfContentsView()) - ->setChangesets($changesets); + ->setChangesets($changesets) + ->setVisibleChangesets($changesets); $refs = array(); foreach ($changesets as $changeset) { diff --git a/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php b/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php index 1a6ff3ab6b..322e682d9c 100644 --- a/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php @@ -267,6 +267,7 @@ final class DifferentialRevisionViewController extends DifferentialController { $toc_view = new DifferentialDiffTableOfContentsView(); $toc_view->setChangesets($changesets); + $toc_view->setVisibleChangesets($visible_changesets); $toc_view->setUnitTestData(idx($props, 'arc:unit', array())); if ($repository) { $toc_view->setRepository($repository); diff --git a/src/applications/differential/view/difftableofcontents/DifferentialDiffTableOfContentsView.php b/src/applications/differential/view/difftableofcontents/DifferentialDiffTableOfContentsView.php index 9a46626011..51970f4937 100644 --- a/src/applications/differential/view/difftableofcontents/DifferentialDiffTableOfContentsView.php +++ b/src/applications/differential/view/difftableofcontents/DifferentialDiffTableOfContentsView.php @@ -19,6 +19,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView { private $changesets = array(); + private $visibleChangesets = array(); private $repository; private $diff; private $user; @@ -33,6 +34,11 @@ final class DifferentialDiffTableOfContentsView extends AphrontView { return $this; } + public function setVisibleChangesets($visible_changesets) { + $this->visibleChangesets = $visible_changesets; + return $this; + } + public function setRepository(PhabricatorRepository $repository) { $this->repository = $repository; return $this; @@ -99,7 +105,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView { $changesets = $this->changesets; $paths = array(); - foreach ($changesets as $changeset) { + foreach ($changesets as $id => $changeset) { $type = $changeset->getChangeType(); $ftype = $changeset->getFileType(); $link = $this->renderChangesetLink($changeset); @@ -163,7 +169,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView { 'id' => 'differential-mcoverage-'.md5($fname), 'class' => 'differential-mcoverage-loading', ), - 'Loading...'); + (isset($this->visibleChangesets[$id]) ? 'Loading...' : '?')); } $rows[] =