From cf048f4402feb6eddb6d97dd037bab5f77d845fe Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 19 Feb 2019 14:39:08 -0800 Subject: [PATCH] Tweak some display behaviors for indent indicators Summary: Ref T13161. - Don't show ">>" when the line indentation changed but the text also changed, this is just "the line changed". - The indicator seems a little cleaner if we just reuse the existing "bright" colors, which already have colorblind colors anyway. Test Plan: Got slightly better rendering for some diffs locally. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13161 Differential Revision: https://secure.phabricator.com/D20195 --- resources/celerity/map.php | 12 ++++++------ .../postprocessor/CelerityDefaultPostprocessor.php | 2 -- .../differential/parser/DifferentialHunkParser.php | 2 +- .../css/application/differential/changeset-view.css | 6 +++--- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 98d44804d3..0fb2a50904 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -11,7 +11,7 @@ return array( 'conpherence.pkg.js' => '020aebcf', 'core.pkg.css' => 'e3c1a8f2', 'core.pkg.js' => '2cda17a4', - 'differential.pkg.css' => '249b542d', + 'differential.pkg.css' => '9f215e54', 'differential.pkg.js' => '53f8d00c', 'diffusion.pkg.css' => '42c75c37', 'diffusion.pkg.js' => '91192d85', @@ -61,7 +61,7 @@ return array( 'rsrc/css/application/dashboard/dashboard.css' => '4267d6c6', 'rsrc/css/application/diff/inline-comment-summary.css' => '81eb368d', 'rsrc/css/application/differential/add-comment.css' => '7e5900d9', - 'rsrc/css/application/differential/changeset-view.css' => 'cc3fd795', + 'rsrc/css/application/differential/changeset-view.css' => 'de570228', 'rsrc/css/application/differential/core.css' => 'bdb93065', 'rsrc/css/application/differential/phui-inline-comment.css' => '48acce5b', 'rsrc/css/application/differential/revision-comment.css' => '7dbc8d1d', @@ -541,7 +541,7 @@ return array( 'conpherence-thread-manager' => 'aec8e38c', 'conpherence-transaction-css' => '3a3f5e7e', 'd3' => 'd67475f5', - 'differential-changeset-view-css' => 'cc3fd795', + 'differential-changeset-view-css' => 'de570228', 'differential-core-view-css' => 'bdb93065', 'differential-revision-add-comment-css' => '7e5900d9', 'differential-revision-comment-css' => '7dbc8d1d', @@ -1961,9 +1961,6 @@ return array( 'javelin-util', 'phabricator-keyboard-shortcut-manager', ), - 'cc3fd795' => array( - 'phui-inline-comment-view-css', - ), 'cf32921f' => array( 'javelin-behavior', 'javelin-dom', @@ -2010,6 +2007,9 @@ return array( 'javelin-uri', 'phabricator-notification', ), + 'de570228' => array( + 'phui-inline-comment-view-css', + ), 'dfa1d313' => array( 'javelin-behavior', 'javelin-dom', diff --git a/src/applications/celerity/postprocessor/CelerityDefaultPostprocessor.php b/src/applications/celerity/postprocessor/CelerityDefaultPostprocessor.php index d848fb81e8..61f6176f15 100644 --- a/src/applications/celerity/postprocessor/CelerityDefaultPostprocessor.php +++ b/src/applications/celerity/postprocessor/CelerityDefaultPostprocessor.php @@ -199,10 +199,8 @@ final class CelerityDefaultPostprocessor 'diff.background' => '#fff', 'new-background' => 'rgba(151, 234, 151, .3)', 'new-bright' => 'rgba(151, 234, 151, .6)', - 'new-background-strong' => 'rgba(151, 234, 151, 1)', 'old-background' => 'rgba(251, 175, 175, .3)', 'old-bright' => 'rgba(251, 175, 175, .7)', - 'old-background-strong' => 'rgba(251, 175, 175, 1)', 'move-background' => '#fdf5d4', 'copy-background' => '#f1c40f', diff --git a/src/applications/differential/parser/DifferentialHunkParser.php b/src/applications/differential/parser/DifferentialHunkParser.php index d59358bc82..8667c032b7 100644 --- a/src/applications/differential/parser/DifferentialHunkParser.php +++ b/src/applications/differential/parser/DifferentialHunkParser.php @@ -288,7 +288,7 @@ final class DifferentialHunkParser extends Phobject { $o_text = $o['text']; $n_text = $n['text']; - if ($o_text !== $n_text) { + if ($o_text !== $n_text && (ltrim($o_text) === ltrim($n_text))) { $o_depth = $this->getIndentDepth($o_text, $tab_width); $n_depth = $this->getIndentDepth($n_text, $tab_width); diff --git a/webroot/rsrc/css/application/differential/changeset-view.css b/webroot/rsrc/css/application/differential/changeset-view.css index 7d578ccc03..55cc5e8fd3 100644 --- a/webroot/rsrc/css/application/differential/changeset-view.css +++ b/webroot/rsrc/css/application/differential/changeset-view.css @@ -130,13 +130,13 @@ .differential-diff td span.depth-out { background-image: url(/rsrc/image/chevron-out.png); - background-color: {$old-background-strong}; + background-color: {$old-bright}; } .differential-diff td span.depth-in { - background-position: 2px center; + background-position: 1px center; background-image: url(/rsrc/image/chevron-in.png); - background-color: {$new-background-strong}; + background-color: {$new-bright}; }