Skip to content

fix(quick-chat): label update steals focus

Description

There's a bug where changing the editor selection after starting a quick chat causes focus to be stolen.

A couple of things about the bug

  • It's very intermittent, it appears to occur somewhat at random (aka the underlying trigger is unknown).
  • It has the possibility to trigger on every click within the editor, not just selection changes.

Workaround: only update the label when the selection has actually changed. This reduces the likelihood of the focus issue occurring.

Follow-up: raise an issue for this behavior in https://github.com/microsoft/vscode

Related Issues

Resolves #1696 (closed)

Possibly related to: https://github.com/microsoft/vscode/issues/203675

How has this been tested?

  1. Create a quick chat (Cmd + P + GitLab Duo Chat: Open Quick Chat).
  2. Click outside the quick chat, in the main text editor, to clear the selection.
  3. Click within the quick chat to ensure it has focus.
  4. Click outside the chat thread, in the main text editor.

If the fix is working, you should not see the focus change back to the quick chat.

Screenshots (if appropriate)

What CHANGELOG entry will this MR create?

  • fix: Bug fix fixes - a user-facing issue in production - included in changelog
  • feature: New feature - a user-facing change which adds functionality - included in changelog
  • BREAKING CHANGE: (fix or feature that would cause existing functionality to change) - should bump major version, mentioned in the changelog
  • None - other non-user-facing changes
Edited by Tristan Read

Merge request reports

Loading