Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 9, 2026

Comment threads reserved 25px of vertical space for reactions UI even when comments had no reactions and no reaction handler was configured.

Changes

The createReactionsContainer method now checks upfront whether the container is needed:

const hasReactionHandler = this.commentService.hasReactionHandler(this.owner);
const reactions = this.comment.commentReactions?.filter(reaction => !!reaction.count) || [];

// Only create the container if there are reactions to show or if there's a reaction handler
if (reactions.length === 0 && !hasReactionHandler) {
    return;
}

Without the DOM element, the CSS min-height: 25px rule doesn't apply, eliminating wasted space when reactions aren't in use.

Original prompt

This section details on the original issue you should resolve

<issue_title>Wasted space in CommentThread</issue_title>
<issue_description>

Does this issue occur when all extensions are disabled?: Yes (only mine)

  • VS Code Version: 1.103
  • OS Version: Windows 10

Steps to Reproduce:

  • Using createCommentThread() , create a thread with 4 comment and no reaction and no reationHandler
  • The thread take the whole screen after only 4 comments
  • The bottom padding seems reserved for the reactions buttons, even wen no reaction handler exist see:
image

My thread has not reaction handler, and none of my comment declare any reactions.
In my opinion, this space shall not be reserved/wasted and leave more space for the actual messages.

</issue_description>

Comments on the Issue (you are @copilot in this section)

@alexr00 Thanks for double checking! I agree, we shouldn't waste this space.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix wasted space in CommentThread Skip creating reactions container when no reactions or handler exist Jan 9, 2026
Copilot AI requested a review from alexr00 January 9, 2026 11:15
Comment on lines +420 to +422
if (reactions.length === 0 && !hasReactionHandler) {
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we shall create the container even if there is not reaction, but if there is a reaction handler
This way, adding the first reaction would still be possible

Suggested change
if (reactions.length === 0 && !hasReactionHandler) {
return;
}
if (!hasReactionHandler) {
return;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proposed change in this file already handles that case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my bad, but the comment does not match (it says "or there is")

@alexr00 alexr00 marked this pull request as ready for review January 9, 2026 14:19
Copilot AI review requested due to automatic review settings January 9, 2026 14:19
@alexr00 alexr00 enabled auto-merge (squash) January 9, 2026 14:19
@vs-code-engineering vs-code-engineering bot added this to the January 2026 milestone Jan 9, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR eliminates wasted vertical space (25px) in comment threads when no reactions exist and no reaction handler is configured. The fix adds an early return check in the createReactionsContainer method to skip creating the reactions DOM container entirely when it's not needed.

  • Skip creating the reactions container when there are no reactions to display and no reaction handler is available
  • Reuse the filtered reactions array that was previously computed inline

@alexr00 alexr00 merged commit cc74836 into main Jan 9, 2026
27 of 28 checks passed
@alexr00 alexr00 deleted the copilot/fix-wasted-space-comment-thread branch January 9, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wasted space in CommentThread

4 participants