Change:
!
Caused by I caused when I fixed an issue when there are multiple text editors open with the same uri with comments. When I tried to fix I made it so when extensions call and pass in for the comments, we always expand the reply editor, resulting in the bad behavior above. I took a quick look, and it seems very common for extensions to pass in for the comments and then immediately set them.
To verify: Check out PR with comments that you left Reload to make sure there's not state left over from when you left the comments Open the file with the comments and click on the comment icon in the comment bar to expand a comment that you left Verify that the reply input button is collapsed and isn't a big empty rectangle.
Works great -verified.
<!-- UNABLETOLOCATECOMMITMESSAGE repo --Issue marked as unreleased but unable to locate closing commit in repo history. If this was closed in a separate repo you can add the label directly, or comment .
<!-- UNABLETOLOCATECOMMITMESSAGE --Issue marked as unreleased but unable to locate closing commit in issue timeline. You can manually reference a commit by commenting , or directly add the label if you know this has already been releaased

Discussion:
this.expandReplyArea(); } else if (hasExistingComments) { this.createReplyButton(this.commentEditor, this.form); <del> } else if (focus && (!this._commentThread.comments || this._commentThread.comments.length === 0)) { </del> <ins> } else if (focus && (this._commentThread.comments && this._commentThread.comments.length === 0)) { </ins> this.expandReplyArea(); } this._error = dom.append(this.form, dom.$('.validation-error.hidden'));

this._commentsElement.focus(); } <ins> ensureFocusIntoNewEditingComment() { if (this._commentElements.length === 1 && this._commentElements[0].isEditing) { this._commentElements[0].setFocus(true); } } </ins> async display() { this._commentsElement = dom.append(this.container, dom.$('div.comments-container')); this._commentsElement.setAttribute('role', 'presentation');

} } <ins> ensureFocusIntoNewEditingComment() { this._body.ensureFocusIntoNewEditingComment(); } </ins> focusCommentEditor() { this._commentReply?.expandReplyAreaAndFocusCommentEditor(); }

this._commentThreadDisposables.push(this._commentThread.onDidChangeCollapsibleState(state => { if (state === languages.CommentThreadCollapsibleState.Expanded && !this._isExpanded) { this.show(this.arrowPosition(this._commentThread.range), 2); <ins> this._commentThreadWidget.ensureFocusIntoNewEditingComment(); </ins> return; }

const pendingCommentText = (this._pendingNewCommentCache[uniqueOwner] && this._pendingNewCommentCache[uniqueOwner][thread.threadId]) ?? continueOnCommentText; const pendingEdits = this._pendingEditsCache[uniqueOwner] && this._pendingEditsCache[uniqueOwner][thread.threadId]; <del> const isThreadTemplateOrEmpty = (thread.isTemplate || (!thread.comments || (thread.comments.length === 0))); const shouldReveal = thread.canReply && isThreadTemplateOrEmpty && (!thread.editorId || (thread.editorId === editorId)); </del> <ins> const shouldReveal = thread.canReply && thread.isTemplate && (!thread.comments || (thread.comments.length === 0)) && (!thread.editorId || (thread.editorId === editorId)); </ins> await this.displayCommentThread(uniqueOwner, thread, shouldReveal, pendingCommentText, pendingEdits); this._commentInfos.filter(info => info.uniqueOwner === uniqueOwner)[0].threads.push(thread); this.tryUpdateReservedSpace();