vscode: Comment Thread API: Newly created comment threads no longer auto-focus

Version: 1.90.0 (Universal) Commit: 89de5a8d4d6205e5b11647eb6a74844ca23d2573 Date: 2024-06-04T19:34:44.157Z Electron: 29.4.0 ElectronBuildId: 9593362 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Darwin arm64 22.1.0

Description

Our VSCode extension relies on the comment thread API (createCommentThread via a CommentController) to create an input box that can receive user input. On VS Code versions 1.89.1 and before, the comment threads created via this API would be auto-focused and in an expanded state:

image

However, starting on version 1.90.0, the comment thread is created in a closed state:

image

This is undesirable, since it takes an additional click to start entering text into the comment thread.

Is this something that we can configure on our side? If it’s a helpful reference, there seem to be a couple of changes on the VS Code side relating to the focus / reveal of comment threads:

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 15 (7 by maintainers)

Commits related to this issue

Most upvoted comments

I can’t reproduce this. Can you share a code snippet?

@alexr00 Thanks for the reply! I believe the following is a minimal example, let me know if it works for you:

  1. Create a comment controller
this.commentController = vscode.comments.createCommentController(
      "codeium-command",
      "CodeiumCommand"
);
  1. Create a comment thread with any doc and range
const commentThread = this.commentController.createCommentThread(
      docUri,
      range,
      []
);
commentThread.label = "Codeium Command";
commentThread.collapsibleState =
      vscode.CommentThreadCollapsibleState.Expanded;

Expected behavior: opens the comment thread where the input is auto-focused Actual behavior: open the comment thread but the input is closed

We aren’t planning on having another recovery release, so you can see our next approximate release time in the iteration plan.