Render application transactions via Ajax

Summary:
When possible, render application transactions via Ajax. Instead of reloading the page when the response returns, append new transactions to the transaction view.

Scroll the window to the new transactions, animate them in, and clear the form to make this interaction feel reasonable.

When editing transactions, fade them in but do not scroll to them (i.e., don't disrupt the user's position).

Test Plan: Edited and appended transactions via Ajax. Observed fade in animations and scroll behavior. Clicked anchors to verify proper anchor accounting.

Reviewers: vrana, btrahan, chad

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1960

Differential Revision: https://secure.phabricator.com/D4151
This commit is contained in:
epriestley
2012-12-11 14:02:29 -08:00
parent 025411990b
commit d2a5ee4fa4
11 changed files with 163 additions and 71 deletions

View File

@@ -42,8 +42,15 @@ final class PhabricatorMacroCommentController
)))
->applyTransactions($macro, $xactions);
return id(new AphrontRedirectResponse())
->setURI($view_uri);
if ($request->isAjax()) {
return id(new PhabricatorApplicationTransactionResponse())
->setViewer($user)
->setTransactions($xactions)
->setAnchorOffset($request->getStr('anchor'));
} else {
return id(new AphrontRedirectResponse())
->setURI($view_uri);
}
}
}