diff --git a/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php b/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php --- a/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php +++ b/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php @@ -107,6 +107,11 @@ break; } + $is_synthetic = false; + if ($inline->getSyntheticAuthor()) { + $is_synthetic = true; + } + $metadata = array( 'id' => $inline->getID(), 'phid' => $inline->getPHID(), @@ -120,6 +125,7 @@ 'isDraft' => $inline->isDraft(), 'isFixed' => $is_fixed, 'isGhost' => $inline->getIsGhost(), + 'isSynthetic' => $is_synthetic, ); $sigil = 'differential-inline-comment'; @@ -136,11 +142,6 @@ $links = array(); - $is_synthetic = false; - if ($inline->getSyntheticAuthor()) { - $is_synthetic = true; - } - $draft_text = null; if (!$is_synthetic) { // This display is controlled by CSS 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 @@ -1352,8 +1352,16 @@ continue; } + if (inline.isSynthetic()) { + continue; + } + if (inline.isEditing()) { unsaved.push(inline); + } else if (!inline.getID()) { + // These are new comments which have been cancelled, and do not + // count as anything. + continue; } else if (inline.isDraft()) { unsubmitted.push(inline); } else if (!inline.isDone()) { @@ -1395,13 +1403,28 @@ } if (done.length || undone.length) { - done_button.setText([ - done.length, - ' / ', - (done.length + undone.length), - ' ', - pht('Comments') - ]); + // If you haven't marked any comments as "Done", we just show text + // like "3 Comments". If you've marked at least one done, we show + // "1 / 3 Comments". + + var done_text; + if (done.length) { + done_text = [ + done.length, + ' / ', + (done.length + undone.length), + ' ', + pht('Comments') + ]; + } else { + done_text = [ + undone.length, + ' ', + pht('Comments') + ]; + } + + done_button.setText(done_text); JX.DOM.show(done_button.getNode()); 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 @@ -34,6 +34,7 @@ _isFixed: null, _isEditing: false, _isNew: false, + _isSynthetic: false, bindToRow: function(row) { this._row = row; @@ -71,6 +72,7 @@ this._isDraft = data.isDraft; this._isFixed = data.isFixed; this._isGhost = data.isGhost; + this._isSynthetic = data.isSynthetic; this._changesetID = data.changesetID; this._isNew = false; @@ -97,6 +99,10 @@ return this._isDeleted; }, + isSynthetic: function() { + return this._isSynthetic; + }, + bindToRange: function(data) { this._displaySide = data.displaySide; this._number = parseInt(data.number, 10);