1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-19 16:58:48 +02:00

Prevent keyboard selection of change blocks inside edit suggestions

Summary: Ref T13513. When a revision has inlines with edit suggestions, pressing "j" and "k" can incorrectly select the blocks inside the diffs inside the inlines.

Test Plan: Used "j" to cycle through changes in a revision with inline comments with edit suggestions, didn't get jumped into the suggestion diffs.

Maniphest Tasks: T13513

Differential Revision: https://secure.phabricator.com/D21283
This commit is contained in:
epriestley 2020-05-21 15:01:10 -07:00
parent 66566f878d
commit 87fb35abb7
2 changed files with 19 additions and 4 deletions

View file

@ -13,7 +13,7 @@ return array(
'core.pkg.js' => '845355f4',
'dark-console.pkg.js' => '187792c2',
'differential.pkg.css' => '5c459f92',
'differential.pkg.js' => 'a7171fb6',
'differential.pkg.js' => '2b4a7014',
'diffusion.pkg.css' => '42c75c37',
'diffusion.pkg.js' => 'a98c0bf7',
'maniphest.pkg.css' => '35995d6d',
@ -379,7 +379,7 @@ return array(
'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => 'a2ab19be',
'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '1e413dc9',
'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => '0116d3e8',
'rsrc/js/application/diff/DiffChangeset.js' => '3a1ca35b',
'rsrc/js/application/diff/DiffChangeset.js' => '39dcf2c3',
'rsrc/js/application/diff/DiffChangesetList.js' => 'cc2c5de5',
'rsrc/js/application/diff/DiffInline.js' => '008b6a15',
'rsrc/js/application/diff/DiffPathView.js' => '8207abf9',
@ -776,7 +776,7 @@ return array(
'phabricator-darklog' => '3b869402',
'phabricator-darkmessage' => '26cd4b73',
'phabricator-dashboard-css' => '5a205b9d',
'phabricator-diff-changeset' => '3a1ca35b',
'phabricator-diff-changeset' => '39dcf2c3',
'phabricator-diff-changeset-list' => 'cc2c5de5',
'phabricator-diff-inline' => '008b6a15',
'phabricator-diff-path-view' => '8207abf9',
@ -1231,7 +1231,7 @@ return array(
'trigger-rule',
'trigger-rule-type',
),
'3a1ca35b' => array(
'39dcf2c3' => array(
'javelin-dom',
'javelin-util',
'javelin-stratcom',

View file

@ -454,9 +454,24 @@ JX.install('DiffChangeset', {
var blocks = [];
var block;
var ii;
var parent_node = null;
for (ii = 0; ii < rows.length; ii++) {
var type = this._getRowType(rows[ii]);
// This row might be part of a diff inside an inline comment, showing
// an inline edit suggestion. Before we accept it as a possible target
// for selection, make sure it's a child of the right parent.
if (parent_node === null) {
parent_node = rows[ii].parentNode;
}
if (type !== null) {
if (rows[ii].parentNode !== parent_node) {
type = null;
}
}
if (!block || (block.type !== type)) {
block = {
type: type,