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

In Differential standalone views, disable some keyboard shortcuts which don't work

Summary:
Ref T13164. See PHI693. In Differential, you can {nav View Options > View Standalone} to get a standalone view of a single changeset. You can also arrive here via the big changeset list for revisions affecting a huge number of files.

We currently suggest that all the keyboard shortcuts work, but some do not. In particular, the "Next File" and "Previous File" keyboard shortcuts (and some similar shortcuts) do not work. In the main view, the next/previous files are on the same page. In the standalone view, we'd need to actually change the URI.

Ideally, we should do this (and, e.g., put prev/next links on the page). As a first step toward that, hide the nonfunctional shortcuts to stop users from being misled.

Test Plan:
- Viewed a revision in normal and standalone views.
- No changes in normal view, and all keys still work ("N", "P", etc).
- In standalone view, "?" no longer shows nonfunctional key commands.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13164

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

+50 -26
+16 -16
resources/celerity/map.php
··· 12 12 'core.pkg.css' => 'f515619b', 13 13 'core.pkg.js' => '2058ec09', 14 14 'differential.pkg.css' => '06dc617c', 15 - 'differential.pkg.js' => 'ef19e026', 15 + 'differential.pkg.js' => '11a08e85', 16 16 'diffusion.pkg.css' => 'a2d17c7d', 17 17 'diffusion.pkg.js' => '6134c5a1', 18 18 'maniphest.pkg.css' => '4845691a', ··· 373 373 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375', 374 374 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63', 375 375 'rsrc/js/application/diff/DiffChangeset.js' => 'b49b59d6', 376 - 'rsrc/js/application/diff/DiffChangesetList.js' => 'f0ffe8c3', 376 + 'rsrc/js/application/diff/DiffChangesetList.js' => '7b95a80a', 377 377 'rsrc/js/application/diff/DiffInline.js' => 'e83d28f3', 378 378 'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832', 379 379 'rsrc/js/application/differential/behavior-comment-preview.js' => '51c5ad07', 380 380 'rsrc/js/application/differential/behavior-diff-radios.js' => 'e1ff79b1', 381 - 'rsrc/js/application/differential/behavior-populate.js' => '419998ab', 381 + 'rsrc/js/application/differential/behavior-populate.js' => 'f0eb6708', 382 382 'rsrc/js/application/differential/behavior-user-select.js' => 'a8d8459d', 383 383 'rsrc/js/application/diffusion/DiffusionLocateFileSource.js' => '00676f00', 384 384 'rsrc/js/application/diffusion/behavior-audit-preview.js' => 'd835b03a', ··· 594 594 'javelin-behavior-diff-preview-link' => '051c7832', 595 595 'javelin-behavior-differential-diff-radios' => 'e1ff79b1', 596 596 'javelin-behavior-differential-feedback-preview' => '51c5ad07', 597 - 'javelin-behavior-differential-populate' => '419998ab', 597 + 'javelin-behavior-differential-populate' => 'f0eb6708', 598 598 'javelin-behavior-differential-user-select' => 'a8d8459d', 599 599 'javelin-behavior-diffusion-commit-branches' => 'bdaf4d04', 600 600 'javelin-behavior-diffusion-commit-graph' => '75b83cbb', ··· 752 752 'phabricator-darkmessage' => 'c48cccdd', 753 753 'phabricator-dashboard-css' => 'fe5b1869', 754 754 'phabricator-diff-changeset' => 'b49b59d6', 755 - 'phabricator-diff-changeset-list' => 'f0ffe8c3', 755 + 'phabricator-diff-changeset-list' => '7b95a80a', 756 756 'phabricator-diff-inline' => 'e83d28f3', 757 757 'phabricator-drag-and-drop-file-upload' => '58dea2fa', 758 758 'phabricator-draggable-list' => 'bea6e7f4', ··· 1133 1133 'javelin-workflow', 1134 1134 'phabricator-draggable-list', 1135 1135 ), 1136 - '419998ab' => array( 1137 - 'javelin-behavior', 1138 - 'javelin-dom', 1139 - 'javelin-stratcom', 1140 - 'phabricator-tooltip', 1141 - 'phabricator-diff-changeset-list', 1142 - 'phabricator-diff-changeset', 1143 - ), 1144 1136 '4250a34e' => array( 1145 1137 'javelin-behavior', 1146 1138 'javelin-dom', ··· 1507 1499 '7a68dda3' => array( 1508 1500 'owners-path-editor', 1509 1501 'javelin-behavior', 1502 + ), 1503 + '7b95a80a' => array( 1504 + 'javelin-install', 1505 + 'phuix-button-view', 1510 1506 ), 1511 1507 '7cbe244b' => array( 1512 1508 'javelin-install', ··· 2117 2113 'javelin-workflow', 2118 2114 'javelin-json', 2119 2115 ), 2120 - 'f0ffe8c3' => array( 2121 - 'javelin-install', 2122 - 'phuix-button-view', 2116 + 'f0eb6708' => array( 2117 + 'javelin-behavior', 2118 + 'javelin-dom', 2119 + 'javelin-stratcom', 2120 + 'phabricator-tooltip', 2121 + 'phabricator-diff-changeset-list', 2122 + 'phabricator-diff-changeset', 2123 2123 ), 2124 2124 'f1ff5494' => array( 2125 2125 'phui-button-css',
+1
src/applications/differential/controller/DifferentialChangesetViewController.php
··· 276 276 ->setDiff($diff) 277 277 ->setTitle(pht('Standalone View')) 278 278 ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 279 + ->setIsStandalone(true) 279 280 ->setParser($parser); 280 281 281 282 if ($revision_id) {
+11
src/applications/differential/view/DifferentialChangesetListView.php
··· 10 10 private $whitespace; 11 11 private $background; 12 12 private $header; 13 + private $isStandalone; 13 14 14 15 private $standaloneURI; 15 16 private $leftRawFileURI; ··· 124 125 return $this; 125 126 } 126 127 128 + public function setIsStandalone($is_standalone) { 129 + $this->isStandalone = $is_standalone; 130 + return $this; 131 + } 132 + 133 + public function getIsStandalone() { 134 + return $this->isStandalone; 135 + } 136 + 127 137 public function setBackground($background) { 128 138 $this->background = $background; 129 139 return $this; ··· 219 229 'changesetViewIDs' => $ids, 220 230 'inlineURI' => $this->inlineURI, 221 231 'inlineListURI' => $this->inlineListURI, 232 + 'isStandalone' => $this->getIsStandalone(), 222 233 'pht' => array( 223 234 'Open in Editor' => pht('Open in Editor'), 224 235 'Show All Context' => pht('Show All Context'),
+20 -9
webroot/rsrc/js/application/diff/DiffChangesetList.js
··· 89 89 properties: { 90 90 translations: null, 91 91 inlineURI: null, 92 - inlineListURI: null 92 + inlineListURI: null, 93 + isStandalone: false 93 94 }, 94 95 95 96 members: { ··· 149 150 this._initialized = true; 150 151 var pht = this.getTranslations(); 151 152 153 + // We may be viewing the normal "/D123" view (with all the changesets) 154 + // or the standalone view (with just one changeset). In the standalone 155 + // view, some options (like jumping to next or previous file) do not 156 + // make sense and do not function. 157 + var standalone = this.getIsStandalone(); 158 + 152 159 var label; 153 160 154 161 label = pht('Jump to next change.'); ··· 157 164 label = pht('Jump to previous change.'); 158 165 this._installJumpKey('k', label, -1); 159 166 160 - label = pht('Jump to next file.'); 161 - this._installJumpKey('J', label, 1, 'file'); 167 + if (!standalone) { 168 + label = pht('Jump to next file.'); 169 + this._installJumpKey('J', label, 1, 'file'); 162 170 163 - label = pht('Jump to previous file.'); 164 - this._installJumpKey('K', label, -1, 'file'); 171 + label = pht('Jump to previous file.'); 172 + this._installJumpKey('K', label, -1, 'file'); 173 + } 165 174 166 175 label = pht('Jump to next inline comment.'); 167 176 this._installJumpKey('n', label, 1, 'comment'); ··· 176 185 'Jump to previous inline comment, including collapsed comments.'); 177 186 this._installJumpKey('P', label, -1, 'comment', true); 178 187 179 - label = pht('Hide or show the current file.'); 180 - this._installKey('h', label, this._onkeytogglefile); 188 + if (!standalone) { 189 + label = pht('Hide or show the current file.'); 190 + this._installKey('h', label, this._onkeytogglefile); 181 191 182 - label = pht('Jump to the table of contents.'); 183 - this._installKey('t', label, this._ontoc); 192 + label = pht('Jump to the table of contents.'); 193 + this._installKey('t', label, this._ontoc); 194 + } 184 195 185 196 label = pht('Reply to selected inline comment or change.'); 186 197 this._installKey('r', label, JX.bind(this, this._onkeyreply, false));
+2 -1
webroot/rsrc/js/application/differential/behavior-populate.js
··· 61 61 var changeset_list = new JX.DiffChangesetList() 62 62 .setTranslations(JX.phtize(config.pht)) 63 63 .setInlineURI(config.inlineURI) 64 - .setInlineListURI(config.inlineListURI); 64 + .setInlineListURI(config.inlineListURI) 65 + .setIsStandalone(config.isStandalone); 65 66 66 67 // Install and activate the current page. 67 68 var page_id = JX.Quicksand.getCurrentPageID();