1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 08:42:41 +01:00

Allow navigation breadcrumbs to be marked as "always visible" so they show up on phones

Summary:
See PHI624. Some of the mobile navigation and breadcrumbs in support pacts aren't as good as they could be.

In particular, we generally collapse crumbs on mobile to just the first and last crumbs. The first crumb is the application; the last is the current page.

On `/PHIxxx` pages, the first crumb isn't very useful since the Support landing page is two levels up: you usually want to go back to the pact, not all the way back to the Support landing page.

We also don't need the space since the last crumb (`PHIxxx`) is always small.

Allow Support and other similar applications to tailor the crumb behavior more narrowly if they end up in situations like this.

Test Plan:
  - With an additional change to instances (see next diff), viewed a support issue page (`/PHI123`) on mobile and desktop.
  - Saw a link directly back to the pact on both mobile and desktop.

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D19438
This commit is contained in:
epriestley 2018-05-09 11:25:08 -07:00
parent 5b640a434c
commit 26c0db8dd7
3 changed files with 26 additions and 3 deletions

View file

@ -9,7 +9,7 @@ return array(
'names' => array( 'names' => array(
'conpherence.pkg.css' => 'e68cf1fa', 'conpherence.pkg.css' => 'e68cf1fa',
'conpherence.pkg.js' => '15191c65', 'conpherence.pkg.js' => '15191c65',
'core.pkg.css' => 'cb8ae4dc', 'core.pkg.css' => '8be474cc',
'core.pkg.js' => 'e1f0f7bd', 'core.pkg.js' => 'e1f0f7bd',
'differential.pkg.css' => '06dc617c', 'differential.pkg.css' => '06dc617c',
'differential.pkg.js' => 'c2ca903a', 'differential.pkg.js' => 'c2ca903a',
@ -144,7 +144,7 @@ return array(
'rsrc/css/phui/phui-cms.css' => '504b4b23', 'rsrc/css/phui/phui-cms.css' => '504b4b23',
'rsrc/css/phui/phui-comment-form.css' => 'ac68149f', 'rsrc/css/phui/phui-comment-form.css' => 'ac68149f',
'rsrc/css/phui/phui-comment-panel.css' => 'f50152ad', 'rsrc/css/phui/phui-comment-panel.css' => 'f50152ad',
'rsrc/css/phui/phui-crumbs-view.css' => '6ece3bbb', 'rsrc/css/phui/phui-crumbs-view.css' => '10728aaa',
'rsrc/css/phui/phui-curtain-view.css' => '2bdaf026', 'rsrc/css/phui/phui-curtain-view.css' => '2bdaf026',
'rsrc/css/phui/phui-document-pro.css' => '8af7ea27', 'rsrc/css/phui/phui-document-pro.css' => '8af7ea27',
'rsrc/css/phui/phui-document-summary.css' => '9ca48bdf', 'rsrc/css/phui/phui-document-summary.css' => '9ca48bdf',
@ -810,7 +810,7 @@ return array(
'phui-cms-css' => '504b4b23', 'phui-cms-css' => '504b4b23',
'phui-comment-form-css' => 'ac68149f', 'phui-comment-form-css' => 'ac68149f',
'phui-comment-panel-css' => 'f50152ad', 'phui-comment-panel-css' => 'f50152ad',
'phui-crumbs-view-css' => '6ece3bbb', 'phui-crumbs-view-css' => '10728aaa',
'phui-curtain-view-css' => '2bdaf026', 'phui-curtain-view-css' => '2bdaf026',
'phui-document-summary-view-css' => '9ca48bdf', 'phui-document-summary-view-css' => '9ca48bdf',
'phui-document-view-css' => '878c2f52', 'phui-document-view-css' => '878c2f52',

View file

@ -8,6 +8,7 @@ final class PHUICrumbView extends AphrontView {
private $isLastCrumb; private $isLastCrumb;
private $workflow; private $workflow;
private $aural; private $aural;
private $alwaysVisible;
public function setAural($aural) { public function setAural($aural) {
$this->aural = $aural; $this->aural = $aural;
@ -18,6 +19,22 @@ final class PHUICrumbView extends AphrontView {
return $this->aural; return $this->aural;
} }
/**
* Make this crumb always visible, even on devices where it would normally
* be hidden.
*
* @param bool True to make the crumb always visible.
* @return this
*/
public function setAlwaysVisible($always_visible) {
$this->alwaysVisible = $always_visible;
return $this;
}
public function getAlwaysVisible() {
return $this->alwaysVisible;
}
public function setWorkflow($workflow) { public function setWorkflow($workflow) {
$this->workflow = $workflow; $this->workflow = $workflow;
return $this; return $this;
@ -98,6 +115,10 @@ final class PHUICrumbView extends AphrontView {
$classes[] = 'phabricator-last-crumb'; $classes[] = 'phabricator-last-crumb';
} }
if ($this->getAlwaysVisible()) {
$classes[] = 'phui-crumb-always-visible';
}
$tag = javelin_tag( $tag = javelin_tag(
$this->href ? 'a' : 'span', $this->href ? 'a' : 'span',
array( array(

View file

@ -55,6 +55,8 @@
} }
.device-phone .phui-crumb-view.phabricator-last-crumb .phui-crumb-name, .device-phone .phui-crumb-view.phabricator-last-crumb .phui-crumb-name,
.device-phone .phui-crumb-view.phui-crumb-always-visible .phui-crumb-name,
.device-phone .phui-crumb-view.phui-crumb-always-visible + .phui-crumb-divider,
.device-phone .phui-crumb-view.phui-crumb-has-icon, .device-phone .phui-crumb-view.phui-crumb-has-icon,
.device-phone .phui-crumb-has-icon + .phui-crumb-divider { .device-phone .phui-crumb-has-icon + .phui-crumb-divider {
display: inline-block; display: inline-block;