Page MenuHomePhabricator

D19601.diff
No OneTemporary

D19601.diff

diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php
--- a/src/applications/differential/controller/DifferentialRevisionViewController.php
+++ b/src/applications/differential/controller/DifferentialRevisionViewController.php
@@ -463,7 +463,7 @@
}
}
- $tab_group = id(new PHUITabGroupView());
+ $tab_group = new PHUITabGroupView();
if ($toc_view) {
$tab_group->addTab(
@@ -473,17 +473,30 @@
->appendChild($toc_view));
}
- $tab_group
- ->addTab(
- id(new PHUITabView())
- ->setName(pht('History'))
- ->setKey('history')
- ->appendChild($history))
- ->addTab(
- id(new PHUITabView())
- ->setName(pht('Commits'))
- ->setKey('commits')
- ->appendChild($local_table));
+ $tab_group->addTab(
+ id(new PHUITabView())
+ ->setName(pht('History'))
+ ->setKey('history')
+ ->appendChild($history));
+
+ $filetree_on = $viewer->compareUserSetting(
+ PhabricatorShowFiletreeSetting::SETTINGKEY,
+ PhabricatorShowFiletreeSetting::VALUE_ENABLE_FILETREE);
+
+ $collapsed_key = PhabricatorFiletreeVisibleSetting::SETTINGKEY;
+ $filetree_collapsed = (bool)$viewer->getUserSetting($collapsed_key);
+
+ // See PHI811. If the viewer has the file tree on, the files tab with the
+ // table of contents is redundant, so default to the "History" tab instead.
+ if ($filetree_on && !$filetree_collapsed) {
+ $tab_group->selectTab('history');
+ }
+
+ $tab_group->addTab(
+ id(new PHUITabView())
+ ->setName(pht('Commits'))
+ ->setKey('commits')
+ ->appendChild($local_table));
$stack_graph = id(new DifferentialRevisionGraph())
->setViewer($viewer)
@@ -601,22 +614,15 @@
$crumbs->addTextCrumb($monogram);
$crumbs->setBorder(true);
- $filetree_on = $viewer->compareUserSetting(
- PhabricatorShowFiletreeSetting::SETTINGKEY,
- PhabricatorShowFiletreeSetting::VALUE_ENABLE_FILETREE);
-
$nav = null;
if ($filetree_on && !$this->isVeryLargeDiff()) {
- $collapsed_key = PhabricatorFiletreeVisibleSetting::SETTINGKEY;
- $collapsed_value = $viewer->getUserSetting($collapsed_key);
-
$width_key = PhabricatorFiletreeWidthSetting::SETTINGKEY;
$width_value = $viewer->getUserSetting($width_key);
$nav = id(new DifferentialChangesetFileTreeSideNavBuilder())
->setTitle($monogram)
->setBaseURI(new PhutilURI($revision->getURI()))
- ->setCollapsed((bool)$collapsed_value)
+ ->setCollapsed($filetree_collapsed)
->setWidth((int)$width_value)
->build($changesets);
}

File Metadata

Mime Type
text/plain
Expires
Wed, May 15, 10:37 PM (2 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6296979
Default Alt Text
D19601.diff (2 KB)

Event Timeline