Skip to content

feat(chat): show chat only when it can be used by user

Description

In 16.8, Duo Chat is going to be available to the self-managed instances. To account for this, we had to loosen the access to Duo Chat in feat(chat): enable Duo Chat for SM instances (!1313 - merged) However, since that change means the chat is available to anybody with any account connected in the extension, chat is going to be visually available for anybody, incl. those who have no access to use it. In these cases, chat will throw once user tries to send out a prompt in chat.

To prevent this broken UX, a new API endpoint has been introduced. The endpoint responds with a boolean indicating whether the user should have access to chat.

This MR, connects the dots and calls the new endpoint to determine whether chat should be available to the user.

Related Issues

Resolves AI feature access: Duo Chat in IDE shown to use... (gitlab#432958 - closed)

How has this been tested?

Screenshots (if appropriate):

VSCode Web IDE
No accounts Screenshot_2024-01-12_at_15.54.04 N/A
SaaS user with access to chat Screenshot_2024-01-12_at_15.53.36 Screenshot_2024-01-12_at_16.28.51
SaaS user without access to chat Screenshot_2024-01-12_at_15.55.48 Screenshot_2024-01-12_at_16.29.48
SM user with access to chat Screenshot_2024-01-12_at_15.54.46 Screenshot_2024-01-12_at_16.26.53
SM user without access to chat Screenshot_2024-01-12_at_16.15.14 Screenshot_2024-01-12_at_16.27.23

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation
  • Chore (Related to CI or Packaging to platforms)
  • Test gap
Edited by Denys Mishunov

Merge request reports