1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 20:10:55 +01:00
phorge-phorge/webroot/rsrc/js/application
epriestley 2b4c551b0e Provide a global router for Ajax requests
Summary:
Fixes T430. Fixes T4834. Obsoletes D7641. Currently, we do some things less-well than we could:

  - We just let the browser queue and prioritize requests, so if you load a revision with 50 changes and then click "Award Token", the action blocks until the changes load in most/all browsers. It would be better to prioritize this action and queue it immediately.
  - Similarly, changes tend to load in order, even if the user has clicked to a specific file. When the user expresses a preference for a specific file, we should prioritize it.
  - We show a spinning GIF when waiting on requests. This is appropriate for some types of reuqests, but distracting for others.

To fix this:

  - Queue all (or, at least, most) requests into a new queue in JX.Router.
  - JX.Router handles prioritizing the requests. Principally:
    - You can submit a request with a specific priority (500 = general content loading, 1000 = default, 2000 = explicit user action) and JX.Router will get the higher stuff fired off sooner.
    - You can name requests and then adjust their prorities later, if the user expresses an interest in specific results.
  - Only use the spinner gif for "workflow" requests, which is bascially when the user clicked something and we're waiting on the server. I think it's useful and not-annoying in this case.
  - Don't show any status for draft requests.
  - For content requests, show a subtle hipster-style top loading bar.

Test Plan:
  - Viewed a diff with 93 changes, and clicked award token.
    - Prior to this patch, the action took many many seconds to resolve.
    - After this patch, it resolves quickly.
  - Viewed a diff with 93 changes and saw a pleasant subtle hipster-style loading bar.
  - Viewed a diff with 93 changes and typed some draft text. Previews populated fairly quickly and there was no spinner.
  - Viewed a diff with 93 changes and clicked something with workflow, saw a spinner after a moment.
  - Viewed a diff with 93 changes and clicked a file in the table of contents near the end of the list.
    - Prior to this patch, it took a long time to show up.
    - After this patch, it loads directly.

Reviewers: chad, btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T430, T4834

Differential Revision: https://secure.phabricator.com/D8979
2014-05-05 10:57:42 -07:00
..
aphlict Provide a global router for Ajax requests 2014-05-05 10:57:42 -07:00
auth Add Persona auth provider 2013-10-14 14:34:57 -07:00
config Various linter fixes. 2014-02-26 12:44:58 -08:00
conpherence Use ActionList-based dropdowns in Conpherence 2014-05-05 10:56:38 -07:00
countdown Various linter fixes. 2014-02-26 12:44:58 -08:00
dashboard Give dashboards basic rendering and Ajax support 2014-04-30 14:29:14 -07:00
differential Provide a global router for Ajax requests 2014-05-05 10:57:42 -07:00
diffusion Various linter fixes. 2014-02-26 12:44:58 -08:00
doorkeeper Various linter fixes. 2014-02-26 12:44:58 -08:00
files Various linter fixes. 2014-02-26 12:44:58 -08:00
harbormaster Various linter fixes. 2014-02-26 12:44:58 -08:00
herald Herald - make tokenizers have the purdy icons 2014-04-10 12:38:15 -07:00
maniphest Despecialize most task status handling 2014-03-25 13:47:42 -07:00
owners Allow excluding paths from package 2012-12-07 16:33:16 -08:00
passphrase Add "allow null" and username hinting to the Passphrase credential control 2013-11-22 14:35:35 -08:00
phame Use JsShrink if jsxmin is not available 2013-05-18 17:04:22 -07:00
pholio Pholio - back end for image re-ordering 2013-08-12 13:09:07 -07:00
phortune Allow PhortuneTestProvider to add payment methods 2013-04-25 09:50:08 -07:00
policy Use ActionList-based dropdowns in Policy 2014-05-05 10:56:57 -07:00
ponder Use PHUIRemarkupPreviewPanel in Ponder 2013-08-05 10:47:06 -07:00
projects Workboards - make priority changes less aggressive and generally better 2014-03-27 10:50:54 -07:00
releeph Use standard UI elements to render pull requests in Releeph 2014-04-18 06:44:45 -07:00
repository Removed getElementsByClassName in repositor-crossreference.js 2013-05-12 06:54:15 -07:00
search Various linter fixes. 2014-02-26 12:44:58 -08:00
slowvote Use JsShrink if jsxmin is not available 2013-05-18 17:04:22 -07:00
transactions Move all comment management junk into a dropdown menu 2014-05-05 10:57:23 -07:00
uiexample Fix more JavelinView example stuff 2013-07-16 13:46:49 -07:00