Skip to content

Draft: fix: ensure Duo Chat prompt is focused when showing panel

Description

Ensure Duo Chat prompt is focused when showing panel.

When running the GitLab Duo Chat: Open Chat command in VSCode we focus the cursor into the prompt input. However, previously, if Duo Chat was already open and visible, we did not re-focus the prompt. We now ensure the focus returns to the prompt each time when re-running this command.

Additionally, built in VSCode commands which show the panel that Duo Chat is inside of now also correctly focus the prompt when shown, e.g. View: Toggle GitLab Duo Chat, View: Open Secondary Sidebar (assuming Duo Chat has been moved into the secondary sidebar).

This fix relies on an update in @gitlab/ui and should not be merged until the related MR is merged, and gitlab/ui is updated within this project.

Related Issues

Resolves #1308

How has this been tested?

ctrl+shift+p to open command pallete, then run:

GitLab Duo Chat: Open Chat and verify chat is shown, prompt input is focused. Now switch focus somewhere else (e.g. click into the editor) and then run GitLab Duo Chat: Open Chat again. Verify focus is returned to the prompt input.


Drag Duo Chat into another panel for testing (e.g. the right hand sidebar). Try the above steps again with View: Open Secondary Sidebar

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

Closes #1308

Edited by Elwyn Benson

Merge request reports