@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove "days fresh" / "days stale" indictator in Differential revision list

Summary:
Ref T10939. I'm not //totally// opposed to the existence of this element, but I think it's the kind of thing that would never make it upstream today. I think this should just be a T418 custom sort of thing in the long run, not a mainline upstream feature.

Overall, I think this thing is nearly useless and just adds visual clutter. My dashboard is about 100% red. This also sort of teaches users that it's fine to let revisions sit for a couple of days, which isn't what I'd like the UI to teach. Finally, removing it helps the UI feel a little less cluttered after the visually busy changes in D15926.

Test Plan: Grepped for removed config. Viewed revision list.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10939

Differential Revision: https://secure.phabricator.com/D15927

+8 -89
-18
src/applications/calendar/storage/PhabricatorCalendarHoliday.php
··· 21 21 ) + parent::getConfiguration(); 22 22 } 23 23 24 - public static function getNthBusinessDay($epoch, $n) { 25 - // Sadly, there are not many holidays. So we can load all of them. 26 - $holidays = id(new PhabricatorCalendarHoliday())->loadAll(); 27 - $holidays = mpull($holidays, null, 'getDay'); 28 - $interval = ($n > 0 ? 1 : -1) * 24 * 60 * 60; 29 - 30 - $return = $epoch; 31 - for ($i = abs($n); $i > 0; ) { 32 - $return += $interval; 33 - $weekday = date('w', $return); 34 - if ($weekday != 0 && $weekday != 6 && // Sunday and Saturday 35 - !isset($holidays[date('Y-m-d', $return)])) { 36 - $i--; 37 - } 38 - } 39 - return $return; 40 - } 41 - 42 24 }
-20
src/applications/calendar/storage/__tests__/PhabricatorCalendarHolidayTestCase.php
··· 16 16 ->save(); 17 17 } 18 18 19 - public function testNthBusinessDay() { 20 - $map = array( 21 - array('2011-12-30', 1, '2012-01-03'), 22 - array('2012-01-01', 1, '2012-01-03'), 23 - array('2012-01-01', 0, '2012-01-01'), 24 - array('2012-01-01', -1, '2011-12-30'), 25 - array('2012-01-04', -1, '2012-01-03'), 26 - ); 27 - foreach ($map as $val) { 28 - list($date, $n, $expect) = $val; 29 - $actual = PhabricatorCalendarHoliday::getNthBusinessDay( 30 - strtotime($date), 31 - $n); 32 - $this->assertEqual( 33 - $expect, 34 - date('Y-m-d', $actual), 35 - pht("%d business days since '%s'", $n, $date)); 36 - } 37 - } 38 - 39 19 }
+7
src/applications/config/check/PhabricatorExtraConfigSetupCheck.php
··· 186 186 'Configuration of the notification server has changed substantially. '. 187 187 'For discussion, see T10794.'); 188 188 189 + $stale_reason = pht( 190 + 'The Differential revision list view age UI elements have been removed '. 191 + 'to simplify the interface.'); 192 + 189 193 $ancient_config += array( 190 194 'phid.external-loaders' => 191 195 pht( ··· 314 318 'metamta.differential.unified-comment-context' => pht( 315 319 'Inline comments are now always rendered with a limited amount '. 316 320 'of context.'), 321 + 322 + 'differential.days-fresh' => $stale_reason, 323 + 'differential.days-stale' => $stale_reason, 317 324 ); 318 325 319 326 return $ancient_config;
-19
src/applications/differential/config/PhabricatorDifferentialConfigOptions.php
··· 229 229 "\n\n". 230 230 'This sort of workflow is very unusual. Very few installs should '. 231 231 'need to change this option.')), 232 - $this->newOption('differential.days-fresh', 'int', 1) 233 - ->setSummary( 234 - pht( 235 - "For how many business days should a revision be considered ". 236 - "'fresh'?")) 237 - ->setDescription( 238 - pht( 239 - 'Revisions newer than this number of days are marked as fresh in '. 240 - 'Action Required and Revisions Waiting on You views. Only work '. 241 - 'days (not weekends and holidays) are included. Set to 0 to '. 242 - 'disable this feature.')), 243 - $this->newOption('differential.days-stale', 'int', 3) 244 - ->setSummary( 245 - pht("After this many days, a revision will be considered 'stale'.")) 246 - ->setDescription( 247 - pht( 248 - "Similar to `%s` but marks stale revisions. ". 249 - "If the revision is even older than it is when marked as 'old'.", 250 - 'differential.days-fresh')), 251 232 $this->newOption( 252 233 'metamta.differential.subject-prefix', 253 234 'string',
+1 -32
src/applications/differential/view/DifferentialRevisionListView.php
··· 65 65 public function render() { 66 66 $viewer = $this->getViewer(); 67 67 68 - $fresh = PhabricatorEnv::getEnvConfig('differential.days-fresh'); 69 - if ($fresh) { 70 - $fresh = PhabricatorCalendarHoliday::getNthBusinessDay( 71 - time(), 72 - -$fresh); 73 - } 74 - 75 - $stale = PhabricatorEnv::getEnvConfig('differential.days-stale'); 76 - if ($stale) { 77 - $stale = PhabricatorCalendarHoliday::getNthBusinessDay( 78 - time(), 79 - -$stale); 80 - } 81 - 82 68 $this->initBehavior('phabricator-tooltips', array()); 83 69 $this->requireResource('aphront-tooltip-css'); 84 70 ··· 109 95 $modified = $revision->getDateModified(); 110 96 111 97 $status = $revision->getStatus(); 112 - $show_age = ($fresh || $stale) && 113 - $this->highlightAge && 114 - !$revision->isClosed(); 115 - 116 - if ($stale && $modified < $stale) { 117 - $object_age = PHUIObjectItemView::AGE_OLD; 118 - } else if ($fresh && $modified < $fresh) { 119 - $object_age = PHUIObjectItemView::AGE_STALE; 120 - } else { 121 - $object_age = PHUIObjectItemView::AGE_FRESH; 122 - } 123 - 124 98 $status_name = 125 99 ArcanistDifferentialRevisionStatus::getNameForRevisionStatus($status); 126 100 ··· 143 117 $item->addAttribute($draft); 144 118 } 145 119 146 - /* Most things 'Need Review', so accept it's the default */ 147 - if ($status != ArcanistDifferentialRevisionStatus::NEEDS_REVIEW) { 148 - $item->addAttribute($status_name); 149 - } 150 - 151 120 // Author 152 121 $author_handle = $this->handles[$revision->getAuthorPHID()]; 153 122 $item->addByline(pht('Author: %s', $author_handle->renderLink())); ··· 164 133 } 165 134 166 135 $item->addAttribute(pht('Reviewers: %s', $reviewers)); 167 - $item->setEpoch($revision->getDateModified(), $object_age); 136 + $item->setEpoch($revision->getDateModified()); 168 137 169 138 switch ($status) { 170 139 case ArcanistDifferentialRevisionStatus::NEEDS_REVIEW: