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 | N/A | |
SaaS user with access to chat | ||
SaaS user without access to chat | ||
SM user with access to chat | ||
SM user without access to chat |
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