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

Disable live previews on mobile

Summary:
Fixes T1895. Now that we have on-demand prviews, we can use them on mobile. On mobile:

- don't show live previews;
- only save drafts every 10 seconds.

Also, show fewer remarkup buttons on mobile to try to make sure the more important ones (preview, e.g.) fit.

Test Plan:
- Made window narrower and wider to trigger preview/no-preview behavior.
- Used DarkConsole to verify request rate.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T1895

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

+53 -13
+13 -13
resources/celerity/map.php
··· 7 7 */ 8 8 return array( 9 9 'names' => array( 10 - 'core.pkg.css' => '1a2d5480', 10 + 'core.pkg.css' => '357b84b0', 11 11 'core.pkg.js' => 'cf262309', 12 12 'darkconsole.pkg.js' => 'e7393ebb', 13 13 'differential.pkg.css' => '2de124c9', ··· 104 104 'rsrc/css/application/tokens/tokens.css' => '3d0f239e', 105 105 'rsrc/css/application/uiexample/example.css' => '528b19de', 106 106 'rsrc/css/core/core.css' => 'a76cefc9', 107 - 'rsrc/css/core/remarkup.css' => '72024fc6', 107 + 'rsrc/css/core/remarkup.css' => '7afb543c', 108 108 'rsrc/css/core/syntax.css' => '9fd11da8', 109 109 'rsrc/css/core/z-index.css' => '57ddcaa2', 110 110 'rsrc/css/diviner/diviner-shared.css' => 'aa3656aa', ··· 427 427 'rsrc/js/application/repository/repository-crossreference.js' => 'e5339c43', 428 428 'rsrc/js/application/search/behavior-reorder-queries.js' => 'e9581f08', 429 429 'rsrc/js/application/slowvote/behavior-slowvote-embed.js' => '887ad43f', 430 - 'rsrc/js/application/transactions/behavior-comment-actions.js' => 'bb0d2d0c', 430 + 'rsrc/js/application/transactions/behavior-comment-actions.js' => 'd885b622', 431 431 'rsrc/js/application/transactions/behavior-reorder-configs.js' => 'd7a74243', 432 432 'rsrc/js/application/transactions/behavior-reorder-fields.js' => 'b59e1e96', 433 433 'rsrc/js/application/transactions/behavior-show-older-transactions.js' => 'dbbf48b6', ··· 572 572 'javelin-behavior-audit-preview' => 'd835b03a', 573 573 'javelin-behavior-bulk-job-reload' => 'edf8a145', 574 574 'javelin-behavior-choose-control' => 'dfaafb14', 575 - 'javelin-behavior-comment-actions' => 'bb0d2d0c', 575 + 'javelin-behavior-comment-actions' => 'd885b622', 576 576 'javelin-behavior-config-reorder-fields' => 'b6993408', 577 577 'javelin-behavior-conpherence-drag-and-drop-photo' => 'cf86d16a', 578 578 'javelin-behavior-conpherence-menu' => '1d45c74d', ··· 759 759 'phabricator-object-selector-css' => '85ee8ce6', 760 760 'phabricator-phtize' => 'd254d646', 761 761 'phabricator-prefab' => '666c80c5', 762 - 'phabricator-remarkup-css' => '72024fc6', 762 + 'phabricator-remarkup-css' => '7afb543c', 763 763 'phabricator-search-results-css' => '7dea472c', 764 764 'phabricator-shaped-request' => '7cbe244b', 765 765 'phabricator-side-menu-view-css' => 'bec2458e', ··· 1740 1740 'javelin-workflow', 1741 1741 'phabricator-draggable-list', 1742 1742 ), 1743 - 'bb0d2d0c' => array( 1744 - 'javelin-behavior', 1745 - 'javelin-stratcom', 1746 - 'javelin-workflow', 1747 - 'javelin-dom', 1748 - 'phuix-form-control-view', 1749 - 'phuix-icon-view', 1750 - ), 1751 1743 'bd4c8dca' => array( 1752 1744 'javelin-install', 1753 1745 'javelin-util', ··· 1869 1861 'javelin-dom', 1870 1862 'javelin-util', 1871 1863 'phabricator-shaped-request', 1864 + ), 1865 + 'd885b622' => array( 1866 + 'javelin-behavior', 1867 + 'javelin-stratcom', 1868 + 'javelin-workflow', 1869 + 'javelin-dom', 1870 + 'phuix-form-control-view', 1871 + 'phuix-icon-view', 1872 1872 ), 1873 1873 'dbbf48b6' => array( 1874 1874 'javelin-behavior',
+14
src/view/form/control/PhabricatorRemarkupControl.php
··· 65 65 $actions = array( 66 66 'fa-bold' => array( 67 67 'tip' => pht('Bold'), 68 + 'nodevice' => true, 68 69 ), 69 70 'fa-italic' => array( 70 71 'tip' => pht('Italics'), 72 + 'nodevice' => true, 71 73 ), 72 74 'fa-text-width' => array( 73 75 'tip' => pht('Monospaced'), 76 + 'nodevice' => true, 74 77 ), 75 78 'fa-link' => array( 76 79 'tip' => pht('Link'), 80 + 'nodevice' => true, 77 81 ), 78 82 array( 79 83 'spacer' => true, 84 + 'nodevice' => true, 80 85 ), 81 86 'fa-list-ul' => array( 82 87 'tip' => pht('Bulleted List'), 88 + 'nodevice' => true, 83 89 ), 84 90 'fa-list-ol' => array( 85 91 'tip' => pht('Numbered List'), 92 + 'nodevice' => true, 86 93 ), 87 94 'fa-code' => array( 88 95 'tip' => pht('Code Block'), 96 + 'nodevice' => true, 89 97 ), 90 98 'fa-quote-right' => array( 91 99 'tip' => pht('Quote'), 100 + 'nodevice' => true, 92 101 ), 93 102 'fa-table' => array( 94 103 'tip' => pht('Table'), 104 + 'nodevice' => true, 95 105 ), 96 106 'fa-cloud-upload' => array( 97 107 'tip' => pht('Upload File'), ··· 153 163 154 164 if (idx($spec, 'align') == 'right') { 155 165 $classes[] = 'remarkup-assist-right'; 166 + } 167 + 168 + if (idx($spec, 'nodevice')) { 169 + $classes[] = 'remarkup-assist-nodevice'; 156 170 } 157 171 158 172 if (idx($spec, 'spacer')) {
+4
webroot/rsrc/css/core/remarkup.css
··· 556 556 .remarkup-assist-button.preview-active:hover .phui-icon-view { 557 557 color: {$lightsky}; 558 558 } 559 + 560 + .device .remarkup-assist-nodevice { 561 + display: none; 562 + }
+22
webroot/rsrc/js/application/transactions/behavior-comment-actions.js
··· 115 115 } 116 116 117 117 function onresponse(response) { 118 + if (JX.Device.getDevice() != 'desktop') { 119 + return; 120 + } 121 + 118 122 var panel = JX.$(config.panelID); 119 123 if (!response.xactions.length) { 120 124 JX.DOM.hide(panel); ··· 152 156 153 157 JX.DOM.listen(form_node, 'shouldRefresh', null, always_trigger); 154 158 request.start(); 159 + 160 + var ondevicechange = function() { 161 + var panel = JX.$(config.panelID); 162 + if (JX.Device.getDevice() == 'desktop') { 163 + request.setRateLimit(500); 164 + always_trigger(); 165 + } else { 166 + // On mobile, don't show live previews and only save drafts every 167 + // 10 seconds. 168 + request.setRateLimit(10000); 169 + JX.DOM.hide(panel); 170 + } 171 + }; 172 + 173 + ondevicechange(); 174 + 175 + JX.Stratcom.listen('phabricator-device-change', null, ondevicechange); 155 176 } 156 177 157 178 restore_draft_actions(config.drafts || []); 179 + 158 180 });