Page MenuHomePhabricator

Transactions - add pagination to application transactions

Authored by btrahan on Nov 20 2014, 8:51 PM.
Referenced Files
F13348870: D10887.id26226.diff
Sun, Jun 23, 12:43 AM
F13331079: D10887.diff
Mon, Jun 17, 5:28 AM
F13328387: D10887.diff
Sun, Jun 16, 8:43 AM
F13318167: D10887.diff
Thu, Jun 13, 10:20 AM
F13316216: D10887.id26163.diff
Thu, Jun 13, 12:57 AM
F13315272: D10887.id26144.diff
Wed, Jun 12, 11:29 AM
F13305698: D10887.id26148.diff
Sun, Jun 9, 12:05 AM
F13302357: D10887.diff
Sat, Jun 8, 4:59 AM



Ref T4712. This adds pagination. Future diffs will need to deploy buildTransactionTimeline everywhere and massage this stuff as necessary if we hit any special cases.

Test Plan

Set page size to "5" to make it need to paginate often. Verified proper transactions loaded in and the javascript actions worked.

Diff Detail

rP Phabricator
Lint Not Applicable
Tests Not Applicable

Event Timeline

btrahan retitled this revision from to Checkpointing - add pagination to application transactions.
btrahan updated this object.
btrahan edited the test plan for this revision. (Show Details)
btrahan added a reviewer: epriestley.

This looks good so far.

Since we don't actually care about the individual nodes in the response, I think you could just send back a giant block of HTML (e.g., use hsprintf('%s', $events) to produce one) and then dump it in with something like:

JX.DOM.replace(swap, JX.$H(r.timeline).getFragment());

That might make it a little easier?

btrahan edited edge metadata.

works now. thanks for the js tip!

btrahan retitled this revision from Checkpointing - add pagination to application transactions to Transactions - add pagination to application transactions.Nov 21 2014, 12:38 AM
btrahan updated this object.
btrahan edited the test plan for this revision. (Show Details)
epriestley edited edge metadata.

We can probably clean all that reverse paging stuff up once everything moves over to this, I think it was just a lazy way for me to not have to array_reverse() a dozen times in every application.


Oh, you could do the slightly more modern handleRequest(AphrontRequest $request) + $request->getURIData('phid') thing here if you want.


Maybe 404 if the object doesn't implement PhabricatorApplicationTransactionInterface?

This revision is now accepted and ready to land.Nov 21 2014, 12:39 AM

This isn't quite ready yet. I forgot about the case where you have some transaction ID in the URI and that transaction ID is in the middle such that you have some "show newer" UI at the bottom. This theoretically breaks without this so I am going to get this part right before checkin. I also want to restore the highlight feature which I currently broke with my if (pager) new_js else old_js code.

btrahan edited edge metadata.
  • changes as suggested
  • handle the #transactionID case with some javascript wizardry. We'll keep loading prior transactions until we find what we're looking for
This revision is now accepted and ready to land.Nov 21 2014, 7:50 PM
  • fix a small JS race condition bug maybe and return even if we aren't "loading"
  • make sure to specify "with hiding" as false in new ajax endpoint. "with hiding" as true may hide a bunch of transactions based on assumptions about showing the author when they commented most recently... this should be off for this end point.

    (this is really, really, ready now...! :D )

I've been holding this because family is in town and I want to support it aggressively if it breaks anything. I'll probably land it this coming Sunday evening or Monday morning.

Also, @epriestley - if you want to take a look again given the javascript I added since last firm review please do. :D

Yeah, my family stuff is turning out to take like 100% of my time. I'll try to give this another look, but may not really be back in action until late Monday.

This revision was automatically updated to reflect the committed changes.