@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.

Show "Show Older" for transactions the user has not interacted with

Summary: Fixes T7454. We weren't triggering "Show Older" unless there were hidden events because of a previous interaction.

Test Plan:
- Set page size to 3.
- Viewed a task with ~10 transactions.
- Before patch:
- Only 3 most recent transactions visible, no way to see older ones.
- Saw "show older" appear, paged backward through transaction histroy.
- Also, interacted with task and then viewed it, made sure "show older" still works.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7454

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

+21 -4
+4
src/view/control/AphrontCursorPagerView.php
··· 79 79 return $results; 80 80 } 81 81 82 + final public function getHasMoreResults() { 83 + return $this->moreResults; 84 + } 85 + 82 86 public function willShowPagingControls() { 83 87 return $this->prevPageID || 84 88 $this->nextPageID ||
+17 -4
src/view/phui/PHUITimelineView.php
··· 94 94 $hide = array(); 95 95 $show = array(); 96 96 97 + // Bucket timeline events into events we'll hide by default (because they 98 + // predate your most recent interaction with the object) and events we'll 99 + // show by default. 97 100 foreach ($this->events as $event) { 98 101 if ($event->getHideByDefault()) { 99 102 $hide[] = $event; ··· 102 105 } 103 106 } 104 107 108 + // If you've never interacted with the object, all the events will be shown 109 + // by default. We may still need to paginate if there are a large number 110 + // of events. 111 + $more = (bool)$hide; 112 + if ($this->getPager()) { 113 + if ($this->getPager()->getHasMoreResults()) { 114 + $more = true; 115 + } 116 + } 117 + 105 118 $events = array(); 106 - if ($hide && $this->getPager()) { 119 + if ($more && $this->getPager()) { 107 120 $uri = $this->getPager()->getNextPageURI(); 108 121 $uri->setQueryParam('quoteTargetID', $this->getQuoteTargetID()); 109 122 $uri->setQueryParam('quoteRef', $this->getQuoteRef()); ··· 125 138 ), 126 139 pht('Show older changes.')), 127 140 )); 128 - } 129 141 130 - if ($hide && $show) { 131 - $events[] = $spacer; 142 + if ($show) { 143 + $events[] = $spacer; 144 + } 132 145 } 133 146 134 147 if ($show) {