mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 23:02:42 +01:00
Mention the "inline comments" rule in the callout for "Large" diffs
Summary: See PHI638. When a diff is large (between 100 and 1000 files), we collapse content by default unless a change also has inline comments. This rule isn't explicitly explained anywhere. Although it's not really a critical rule, it fits easily enough into the UI callout. Also render the UI callout in a slightly more modern way and avoid `hsprintf()`. Test Plan: {F5596496} - Also, clicked the "Expand" link and saw everything expand properly. Reviewers: amckinley Reviewed By: amckinley Differential Revision: https://secure.phabricator.com/D19430
This commit is contained in:
parent
4a98e0ff65
commit
a4a22dd2f8
1 changed files with 22 additions and 16 deletions
|
@ -182,25 +182,31 @@ final class DifferentialRevisionViewController
|
|||
if ($large_warning) {
|
||||
$count = $this->getChangesetCount();
|
||||
|
||||
$warning = new PHUIInfoView();
|
||||
$warning->setTitle(pht('Large Diff'));
|
||||
$warning->setSeverity(PHUIInfoView::SEVERITY_WARNING);
|
||||
$warning->appendChild(hsprintf(
|
||||
'%s <strong>%s</strong>',
|
||||
$expand_uri = $request_uri
|
||||
->alter('large', 'true')
|
||||
->setFragment('toc');
|
||||
|
||||
$message = array(
|
||||
pht(
|
||||
'This diff is large and affects %s files. '.
|
||||
'You may load each file individually or ',
|
||||
'This large diff affects %s files. Files without inline '.
|
||||
'comments have been collapsed.',
|
||||
new PhutilNumber($count)),
|
||||
' ',
|
||||
phutil_tag(
|
||||
'a',
|
||||
array(
|
||||
'class' => 'button button-grey',
|
||||
'href' => $request_uri
|
||||
->alter('large', 'true')
|
||||
->setFragment('toc'),
|
||||
),
|
||||
pht('Show All Files Inline'))));
|
||||
$warning = $warning->render();
|
||||
'strong',
|
||||
array(),
|
||||
phutil_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => $expand_uri,
|
||||
),
|
||||
pht('Expand All Files'))),
|
||||
);
|
||||
|
||||
$warning = id(new PHUIInfoView())
|
||||
->setTitle(pht('Large Diff'))
|
||||
->setSeverity(PHUIInfoView::SEVERITY_WARNING)
|
||||
->appendChild($message);
|
||||
|
||||
$old = array_select_keys($changesets, $old_ids);
|
||||
$new = array_select_keys($changesets, $new_ids);
|
||||
|
|
Loading…
Reference in a new issue