mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
In Differential: when the file tree is enabled, default to the "History" tab instead of "Files"
Summary: Ref T13187. See PHI811. If the file tree is enabled and visible, set the default tab to "History". - This is a bit magic. - It won't work entirely on mobile (we can't tell that you're on mobile on the server, so we'll pick the "History" tab even though the file tree isn't actually visible on your device). - There's no corresponding logic in Diffusion. Diffusion doesn't have the same tab layout, but this makes things somewhat inconsistent. So I don't love this, but we can try it and see if it's confusing or helpful on the balance. Test Plan: With filetree on and off, reloaded revisions. Saw appropriate tab selected by default. Reviewers: amckinley Maniphest Tasks: T13187 Differential Revision: https://secure.phabricator.com/D19601
This commit is contained in:
parent
8a6d767843
commit
b584834b19
1 changed files with 26 additions and 20 deletions
|
@ -463,7 +463,7 @@ final class DifferentialRevisionViewController
|
|||
}
|
||||
}
|
||||
|
||||
$tab_group = id(new PHUITabGroupView());
|
||||
$tab_group = new PHUITabGroupView();
|
||||
|
||||
if ($toc_view) {
|
||||
$tab_group->addTab(
|
||||
|
@ -473,13 +473,26 @@ final class DifferentialRevisionViewController
|
|||
->appendChild($toc_view));
|
||||
}
|
||||
|
||||
$tab_group
|
||||
->addTab(
|
||||
$tab_group->addTab(
|
||||
id(new PHUITabView())
|
||||
->setName(pht('History'))
|
||||
->setKey('history')
|
||||
->appendChild($history))
|
||||
->addTab(
|
||||
->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')
|
||||
|
@ -601,22 +614,15 @@ final class DifferentialRevisionViewController
|
|||
$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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue