1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-23 15:22:41 +01:00
phorge-phorge/webroot/rsrc/js/core
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
..
behavior-active-nav.js Use JsShrink if jsxmin is not available 2013-05-18 17:04:22 -07:00
behavior-audio-source.js Implement macros as audio sources 2013-09-27 16:02:02 -07:00
behavior-autofocus.js Move js/application/core/ one level up 2013-04-23 10:56:46 -07:00
behavior-crop.js Move js/application/core/ one level up 2013-04-23 10:56:46 -07:00
behavior-dark-console.js Display bullet next to request with errors in DarkConsole. 2013-04-25 18:30:13 -07:00
behavior-device.js Move js/application/core/ one level up 2013-04-23 10:56:46 -07:00
behavior-drag-and-drop-textarea.js Various linter fixes. 2014-02-26 12:44:58 -08:00
behavior-error-log.js Move js/application/core/ one level up 2013-04-23 10:56:46 -07:00
behavior-fancy-datepicker.js Allow datetime inputs to be optional 2013-05-30 16:19:43 -07:00
behavior-file-tree.js Move js/application/core/ one level up 2013-04-23 10:56:46 -07:00
behavior-form.js Make Cmd+Enter work to submit a form 2014-04-03 19:00:47 -07:00
behavior-gesture.js Move js/application/core/ one level up 2013-04-23 10:56:46 -07:00
behavior-global-drag-and-drop.js Various linter fixes. 2014-02-26 12:44:58 -08:00
behavior-high-security-warning.js Add "High Security" mode to support multi-factor auth 2014-04-27 17:31:11 -07:00
behavior-history-install.js Move js/application/core/ one level up 2013-04-23 10:56:46 -07:00
behavior-hovercard.js Use JsShrink if jsxmin is not available 2013-05-18 17:04:22 -07:00
behavior-keyboard-pager.js Move js/application/core/ one level up 2013-04-23 10:56:46 -07:00
behavior-keyboard-shortcuts.js Move js/application/core/ one level up 2013-04-23 10:56:46 -07:00
behavior-konami.js Move js/application/core/ one level up 2013-04-23 10:56:46 -07:00
behavior-lightbox-attachments.js Use JsShrink if jsxmin is not available 2013-05-18 17:04:22 -07:00
behavior-line-linker.js Line highlighting for pastes 2013-08-04 12:12:37 -07:00
behavior-more.js Move js/application/core/ one level up 2013-04-23 10:56:46 -07:00
behavior-object-selector.js Update ObjectSelector CSS 2013-11-30 19:47:20 -08:00
behavior-oncopy.js Switch back to zwsp for oncopy line marker 2014-04-08 17:55:48 -07:00
behavior-phabricator-nav.js Use JsShrink if jsxmin is not available 2013-05-18 17:04:22 -07:00
behavior-phabricator-remarkup-assist.js Add Link button to Remarkup assist 2013-10-17 18:57:40 -07:00
behavior-refresh-csrf.js Provide a global router for Ajax requests 2014-05-05 10:57:42 -07:00
behavior-remarkup-preview.js Partially generalize Remarkup previews and add support to Differential 2013-08-05 10:46:39 -07:00
behavior-reveal-content.js Use JsShrink if jsxmin is not available 2013-05-18 17:04:22 -07:00
behavior-search-typeahead.js Search - making clicking the search button not submit placeholder text 2014-05-02 17:57:01 -07:00
behavior-select-on-click.js Improve repository hinting and feedback 2013-11-01 17:35:43 -07:00
behavior-toggle-class.js Move js/application/core/ one level up 2013-04-23 10:56:46 -07:00
behavior-tokenizer.js Move js/application/core/ one level up 2013-04-23 10:56:46 -07:00
behavior-tooltip.js Hide tooltips on any keypress 2014-03-12 11:29:48 -07:00
behavior-watch-anchor.js Move js/application/core/ one level up 2013-04-23 10:56:46 -07:00
behavior-workflow.js Provide a global router for Ajax requests 2014-05-05 10:57:42 -07:00
Busy.js Fix full width form layouts 2013-07-03 20:24:28 -07:00
DragAndDropFileUpload.js Use JsShrink if jsxmin is not available 2013-05-18 17:04:22 -07:00
DraggableList.js Send appropriate requests to the server when dragging cards on project boards 2014-01-13 12:24:36 -08:00
FileUpload.js Various linter fixes. 2014-02-26 12:44:58 -08:00
Hovercard.js Use JsShrink if jsxmin is not available 2013-05-18 17:04:22 -07:00
KeyboardShortcut.js Move js/application/core/ one level up 2013-04-23 10:56:46 -07:00
KeyboardShortcutManager.js Move js/application/core/ one level up 2013-04-23 10:56:46 -07:00
MultirowRowManager.js Various linter fixes. 2014-02-26 12:44:58 -08:00
Notification.js Various linter fixes. 2014-02-26 12:44:58 -08:00
phtize.js Use JsShrink if jsxmin is not available 2013-05-18 17:04:22 -07:00
Prefab.js Minor, fix a JS issue with unusual tokenizer prefills 2014-02-16 16:13:40 -08:00
ShapedRequest.js Provide a global router for Ajax requests 2014-05-05 10:57:42 -07:00
TextAreaUtils.js Move js/application/core/ one level up 2013-04-23 10:56:46 -07:00
ToolTip.js Fixing tooltips not appearing in fullscreen editor 2014-04-12 05:59:36 -07:00