From 3a8ee271d9df1797c8a0926f18a97b8ba9970c9e Mon Sep 17 00:00:00 2001 From: Valerio Bozzolan Date: Thu, 6 Apr 2023 14:44:02 +0200 Subject: [PATCH] Render all Removed Comments a little more docile Summary: This small restyle makes any Removed Comment a little less prominent than normal ones, with the goal of decreasing a bit your in-page distractions and increase your individual productivity in your business by at least 250 milliseconds every 48 hours of hard work in front of your monitor. | Before | After | |---------------------|---------------------| | {F274834,size=full} | {F274835,size=full} | This implementation (which is called "Kasper on Diet") contains these specific changes for Removed Comments: - user icon visibility: reduced by ~50% (-> Kasper) - black "trash" icon: reduced by ~50% (-> Diet) - texts: visibility reduced by ~50% - vertical padding: reduced from 16px down to 4px Note that if your Phorge is under the Serious Business Mode, it seems it is still technically possible to manually activate the "Decaying Curse" proposal mentioned in the Task. Closes T15192 Test Plan: - Add a Comment "I love Phorge" - Add a Comment "I love Phabricator" - Mark the second Comment as Removed - Call a person at your desk - Plug that person to an eyeball tracker If the general attention focuses first on a normal Comment and then on the Removed Comment, this change works perfectly. Reviewers: O1 Blessed Committers, Cigaryno, avivey Reviewed By: O1 Blessed Committers, Cigaryno, avivey Subscribers: speck, tobiaswiese, Matthew, Cigaryno Tags: #comments Maniphest Tasks: T15192 Differential Revision: https://we.phorge.it/D25096 --- resources/celerity/map.php | 6 +++--- .../PhabricatorApplicationTransaction.php | 2 +- .../PhabricatorApplicationTransactionView.php | 5 +++++ webroot/rsrc/css/phui/phui-timeline-view.css | 20 +++++++++++++++++++ 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index d11174a1d2..89425d6cc4 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -9,7 +9,7 @@ return array( 'names' => array( 'conpherence.pkg.css' => '0e3cf785', 'conpherence.pkg.js' => '020aebcf', - 'core.pkg.css' => 'bb377509', + 'core.pkg.css' => '6590cb9f', 'core.pkg.js' => '66c49ca1', 'dark-console.pkg.js' => '187792c2', 'differential.pkg.css' => '609e63d4', @@ -178,7 +178,7 @@ return array( 'rsrc/css/phui/phui-spacing.css' => 'b05cadc3', 'rsrc/css/phui/phui-status.css' => '293b5dad', 'rsrc/css/phui/phui-tag-view.css' => 'fb811341', - 'rsrc/css/phui/phui-timeline-view.css' => '2d32d7a9', + 'rsrc/css/phui/phui-timeline-view.css' => 'cc554a79', 'rsrc/css/phui/phui-two-column-view.css' => 'f96d319f', 'rsrc/css/phui/workboards/phui-workboard-color.css' => '3a1c21ff', 'rsrc/css/phui/workboards/phui-workboard.css' => '74fc9d98', @@ -880,7 +880,7 @@ return array( 'phui-status-list-view-css' => '293b5dad', 'phui-tag-view-css' => 'fb811341', 'phui-theme-css' => '35883b37', - 'phui-timeline-view-css' => '2d32d7a9', + 'phui-timeline-view-css' => 'cc554a79', 'phui-two-column-view-css' => 'f96d319f', 'phui-workboard-color-css' => '3a1c21ff', 'phui-workboard-view-css' => '74fc9d98', diff --git a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php index e32fe92983..56079efaf2 100644 --- a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php +++ b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php @@ -539,7 +539,7 @@ abstract class PhabricatorApplicationTransaction case PhabricatorTransactions::TYPE_COMMENT; $comment = $this->getComment(); if ($comment && $comment->getIsRemoved()) { - return 'black'; + return 'grey'; } break; case PhabricatorTransactions::TYPE_EDGE: diff --git a/src/applications/transactions/view/PhabricatorApplicationTransactionView.php b/src/applications/transactions/view/PhabricatorApplicationTransactionView.php index ee2020f890..180ba071a9 100644 --- a/src/applications/transactions/view/PhabricatorApplicationTransactionView.php +++ b/src/applications/transactions/view/PhabricatorApplicationTransactionView.php @@ -493,6 +493,11 @@ class PhabricatorApplicationTransactionView extends AphrontView { $xaction->getComment() && $xaction->getComment()->getIsRemoved(); + // Make designers happy to make CSS customizations + if ($has_removed_comment) { + $event->addClass('phui-timeline-shell-removed'); + } + if ($xaction->getCommentVersion() > 1 && !$has_removed_comment) { $event->setIsEdited(true); } diff --git a/webroot/rsrc/css/phui/phui-timeline-view.css b/webroot/rsrc/css/phui/phui-timeline-view.css index e08373d589..59caec7fea 100644 --- a/webroot/rsrc/css/phui/phui-timeline-view.css +++ b/webroot/rsrc/css/phui/phui-timeline-view.css @@ -189,9 +189,29 @@ overflow-x: auto; } +/* + * Start Customization for removed comments + * https://we.phorge.it/T15192 + */ + .phui-timeline-core-content .comment-deleted { font-style: italic; } +.phui-timeline-shell-removed .phui-timeline-image { + opacity: 0.5; +} +.phui-timeline-shell-removed, +.phui-timeline-shell-removed a, +.phui-timeline-shell-removed .phui-timeline-title { + color:#888; /* grey */ +} +.phui-timeline-shell-removed + .phui-timeline-major-event + .phui-timeline-content .phui-timeline-core-content { + padding:4px 16px; /* reduce vertical space from 16px */ +} + +/* End Customization for removed comments */ .device .phui-timeline-event-view { min-height: 23px;