Skip to content

Add insert-code-snippet button in code blocks

What does this MR do and why?

This merge requests introduces the insert code snippet button in the highlighted code blocks. This is aimed at the support to insert code directly in the editor from a Duo Chat message.

This support for this tag as only been added in the GitLab UI library in the Duo Chat component used by editor extensions.

This merge request unblocks work for the JetBrains and VSCode extension.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

image.png

How to set up and validate locally

  1. Enable Duo Chat locally.
  2. Enable the enableCodeInsertion flag on the Duo Chat component.
  3. Send a message that should result in a response with a code block.
  4. Validate that the insert in code editor button is present when hovering the code block.
  5. Validate in notes or issues where code snippet are allowed that the button does not show up.

Merge request reports

Loading