From f3754271777471fec30919995d7884398ab962b2 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 8 Jun 2018 07:59:28 -0700 Subject: [PATCH] Use more consistent diff coloration in unified diffs Summary: Ref T13151. See PHI701. Unified diffs are currently missing the logic to apply the "old-full" and "new-full" classes, which results in a too-light coloration for fully added or removed lines. Make this logic consistent with the two-up renderer so we use the same colors in both. Test Plan: Viewed diffs and swapped between 1-up and 2-up renderers, now saw the same coloration. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13151 Differential Revision: https://secure.phabricator.com/D19482 --- .../render/DifferentialChangesetOneUpRenderer.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/applications/differential/render/DifferentialChangesetOneUpRenderer.php b/src/applications/differential/render/DifferentialChangesetOneUpRenderer.php index 586680d1b8..90c3977907 100644 --- a/src/applications/differential/render/DifferentialChangesetOneUpRenderer.php +++ b/src/applications/differential/render/DifferentialChangesetOneUpRenderer.php @@ -68,7 +68,11 @@ final class DifferentialChangesetOneUpRenderer $cells = array(); if ($is_old) { if ($p['htype']) { - $class = 'left old'; + if (empty($p['oline'])) { + $class = 'left old old-full'; + } else { + $class = 'left old'; + } $aural = $aural_minus; } else { $class = 'left'; @@ -106,7 +110,11 @@ final class DifferentialChangesetOneUpRenderer $cells[] = $no_coverage; } else { if ($p['htype']) { - $class = 'right new'; + if (empty($p['oline'])) { + $class = 'right new new-full'; + } else { + $class = 'right new'; + } $cells[] = phutil_tag('th', array('class' => $class)); $aural = $aural_plus; } else {