Skip to content

Do not close Duo Chat callout when clicking outside

Denys Mishunov requested to merge 437741-remove-click-anywhere-to-dismiss into master

What does this MR do and why?

The MR removes the ability to close the Duo Chat callout when clicking anywhere on the document.

This change removes previously introduced behavior when the callout was dismissed on any click on the page even outside of the callout itself

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

Before After
chat-global-button-before chat-global-button-after

How to set up and validate locally

  1. Set up GitLab Duo Chat
  2. Load any page in the local GDK. There should neither global button, nor the callout, as represented in the screenshots, be presented on the page.
  3. Enable the global GitLab Duo button:
# rails c

[1] pry(main)> Feature.enable(:tanuki_bot_breadcrumbs_entry_point)
  1. Open any page and note the callout below the global GitLab Duo Chat button, as presented in the screenshots above
  2. Make sure that clicking anywhere outside of the callout (even navigating to another page) does not dismiss the callout.

Just dismissing the callout

  1. Dismiss the callout without opening chat by clicking in the top right corner of the callout. The callout gets dismissed. Chat should not be opened
  2. Reload the page to make sure the callout is not shown while the button is still rendered

Clicking the "Ask GitLab Duo" button in the callout

  1. Reset the dismiss of the callout:
# rails c
[2] pry(main)> Users::Callout.duo_chat_callout[0].destroy
  1. Click the "Ask GitLab Duo" button in the callout. It should open the chat and dismiss the callout
  2. Reload the page to make sure the callout is not shown while the button is still rendered

Clicking the global Duo Chat button

  1. Reset the dismiss of the callout:
# rails c
[3] pry(main)> Users::Callout.duo_chat_callout[0].destroy
  1. Reload the page to make sure the callout is shown again.
  2. Click the global "GitLab Duo Chat" button. It should open the chat and dismiss the callout
  3. Reload the page to make sure the callout is not shown while the button is still rendered

Related to #437741

Edited by Denys Mishunov

Merge request reports