Page MenuHomePhabricator

D17905.id43067.diff
No OneTemporary

D17905.id43067.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -13,7 +13,7 @@
'core.pkg.js' => '8c5f913d',
'darkconsole.pkg.js' => '1f9a31bc',
'differential.pkg.css' => '58712637',
- 'differential.pkg.js' => '6ee9a850',
+ 'differential.pkg.js' => '0bfd141c',
'diffusion.pkg.css' => 'b93d9b8c',
'diffusion.pkg.js' => '84c8f8fd',
'favicon.ico' => '30672e08',
@@ -390,9 +390,9 @@
'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => '408bf173',
'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375',
'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63',
- 'rsrc/js/application/diff/DiffChangeset.js' => 'f7100923',
- 'rsrc/js/application/diff/DiffChangesetList.js' => 'e5c5e171',
- 'rsrc/js/application/diff/DiffInline.js' => '4bbefc49',
+ 'rsrc/js/application/diff/DiffChangeset.js' => '145c34e2',
+ 'rsrc/js/application/diff/DiffChangesetList.js' => 'ca3b6387',
+ 'rsrc/js/application/diff/DiffInline.js' => 'b5b1f167',
'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832',
'rsrc/js/application/differential/behavior-comment-jump.js' => '4fdb476d',
'rsrc/js/application/differential/behavior-comment-preview.js' => 'b064af76',
@@ -781,9 +781,9 @@
'phabricator-darklog' => 'c8e1ffe3',
'phabricator-darkmessage' => 'c48cccdd',
'phabricator-dashboard-css' => 'fe5b1869',
- 'phabricator-diff-changeset' => 'f7100923',
- 'phabricator-diff-changeset-list' => 'e5c5e171',
- 'phabricator-diff-inline' => '4bbefc49',
+ 'phabricator-diff-changeset' => '145c34e2',
+ 'phabricator-diff-changeset-list' => 'ca3b6387',
+ 'phabricator-diff-inline' => 'b5b1f167',
'phabricator-drag-and-drop-file-upload' => '58dea2fa',
'phabricator-draggable-list' => 'bea6e7f4',
'phabricator-fatal-config-template-css' => '8f18fa41',
@@ -996,6 +996,17 @@
'javelin-dom',
'javelin-typeahead-normalizer',
),
+ '145c34e2' => array(
+ 'javelin-dom',
+ 'javelin-util',
+ 'javelin-stratcom',
+ 'javelin-install',
+ 'javelin-workflow',
+ 'javelin-router',
+ 'javelin-behavior-device',
+ 'javelin-vector',
+ 'phabricator-diff-inline',
+ ),
'1499a8cb' => array(
'javelin-behavior',
'javelin-stratcom',
@@ -1256,9 +1267,6 @@
'javelin-util',
'phabricator-shaped-request',
),
- '4bbefc49' => array(
- 'javelin-dom',
- ),
'4c193c96' => array(
'javelin-behavior',
'javelin-uri',
@@ -1831,6 +1839,9 @@
'javelin-dom',
'phabricator-draggable-list',
),
+ 'b5b1f167' => array(
+ 'javelin-dom',
+ ),
'b5c256b8' => array(
'javelin-install',
'javelin-dom',
@@ -1970,6 +1981,9 @@
'phabricator-shaped-request',
'conpherence-thread-manager',
),
+ 'ca3b6387' => array(
+ 'javelin-install',
+ ),
'ca3f91eb' => array(
'javelin-behavior',
'javelin-dom',
@@ -2134,9 +2148,6 @@
'javelin-workflow',
'javelin-magical-init',
),
- 'e5c5e171' => array(
- 'javelin-install',
- ),
'e9581f08' => array(
'javelin-behavior',
'javelin-stratcom',
@@ -2188,17 +2199,6 @@
'phuix-icon-view',
'phabricator-prefab',
),
- 'f7100923' => array(
- 'javelin-dom',
- 'javelin-util',
- 'javelin-stratcom',
- 'javelin-install',
- 'javelin-workflow',
- 'javelin-router',
- 'javelin-behavior-device',
- 'javelin-vector',
- 'phabricator-diff-inline',
- ),
'f7fc67ec' => array(
'javelin-install',
'javelin-typeahead',
diff --git a/webroot/rsrc/js/application/diff/DiffChangeset.js b/webroot/rsrc/js/application/diff/DiffChangeset.js
--- a/webroot/rsrc/js/application/diff/DiffChangeset.js
+++ b/webroot/rsrc/js/application/diff/DiffChangeset.js
@@ -369,17 +369,11 @@
for (var jj = 0; jj < block.items.length; jj++) {
var inline = this.getInlineForRow(block.items[jj]);
- // If this inline has been collapsed, don't select it with the
- // keyboard cursor.
- if (inline.isHidden()) {
- continue;
- }
-
items.push({
type: block.type,
changeset: this,
- target: block.items[jj],
- inline: inline,
+ target: inline,
+ hidden: inline.isHidden(),
nodes: {
begin: block.items[jj],
end: block.items[jj]
diff --git a/webroot/rsrc/js/application/diff/DiffChangesetList.js b/webroot/rsrc/js/application/diff/DiffChangesetList.js
--- a/webroot/rsrc/js/application/diff/DiffChangesetList.js
+++ b/webroot/rsrc/js/application/diff/DiffChangesetList.js
@@ -206,7 +206,7 @@
if (cursor) {
if (cursor.type == 'comment') {
- var inline = cursor.inline;
+ var inline = cursor.target;
if (inline.canReply()) {
this.setFocus(null);
@@ -225,7 +225,7 @@
if (cursor) {
if (cursor.type == 'comment') {
- var inline = cursor.inline;
+ var inline = cursor.target;
if (inline.canEdit()) {
this.setFocus(null);
@@ -284,6 +284,12 @@
}
}
+ // If the item is hidden, don't select it when iterating with jump
+ // keys. It can still potentially be selected in other ways.
+ if (items[cursor].hidden) {
+ continue;
+ }
+
// Otherwise, we've found a valid item to select.
break;
}
@@ -328,13 +334,28 @@
this.setFocus(cursor.nodes.begin, cursor.nodes.end);
- if (scroll) {
+ if (manager && scroll) {
manager.scrollTo(cursor.nodes.begin);
}
return this;
},
+ redrawCursor: function() {
+ // NOTE: This is setting the cursor to the current cursor. Usually, this
+ // would have no effect.
+
+ // However, if the old cursor pointed at an inline and the inline has
+ // been edited so the rows have changed, this updates the cursor to point
+ // at the new inline with the proper rows for the current state, and
+ // redraws the reticle correctly.
+
+ var state = this._getSelectionState();
+ if (state.cursor !== null) {
+ this._setSelectionState(state.items[state.cursor]);
+ }
+ },
+
_getSelectableItems: function() {
var result = [];
diff --git a/webroot/rsrc/js/application/diff/DiffInline.js b/webroot/rsrc/js/application/diff/DiffInline.js
--- a/webroot/rsrc/js/application/diff/DiffInline.js
+++ b/webroot/rsrc/js/application/diff/DiffInline.js
@@ -519,6 +519,8 @@
// preview at the bottom of the page.
this.getChangeset().getChangesetList().redrawPreview();
+ this.getChangeset().getChangesetList().redrawCursor();
+
// Emit a resize event so that UI elements like the keyboad focus
// reticle can redraw properly.
JX.Stratcom.invoke('resize');

File Metadata

Mime Type
text/plain
Expires
Mon, May 13, 1:55 PM (2 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6292942
Default Alt Text
D17905.id43067.diff (7 KB)

Event Timeline