Skip to content

Show Chat button only when Chat can be used

Jessie Young requested to merge jy-duo-access-logic into master

What does this MR do and why?

  • Previously, the logic would Chat button on all pages of gitlab.com to any user that can use Chat via any group.
  • This MR updates the logic to be more fine-grained.
  • A user will only see Chat if they are within the resource hierarchy of a Group that enables AI features that they are a member of.
  • If the user is on a non-group/project resource, such as the Todos Dashboard, and they have AI features enabled via a Group membership, they will also see the Chat button (to ask Documentation questions)
  • This is behind the tanuki_bot_breadcrumbs_entry_point feature flag
  • This updates the logic for the Chat button only, not the Chat access available via the Help menu in the sidebar, which is written in Vue and can either stay as-is or be updated separately.
  • See issue description for full details on what the expected behavior is and the rationale: #428541 (closed)

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

User w/ AI enabled viewing AI enabled group User w/ AI enabled viewing todos User w/ AI enabled viewing group without AI enabled User w/ AI enabled viewing group with AI enabled (but user is not a member) User without AI enabled viewing Group without AI enabled
ai_enabled_group ai_enabled_user_todos non_ai_enabled_group group_with_ai_enabled_viewed_by_non_member non_ai_enabled_group

How to set up and validate locally

  1. Set up a group with AI enabled features locally
  2. Enable the tanuki_bot_breadcrumbs_entry_point feature flag
  3. While viewing the group as a member: the "GitLab Duo" button should be visible
  4. While viewing the group as a non-member: the "GitLab Duo" button should not be visible
  5. While viewing todos: the "GitLab Duo" button should be visible when signed in as any user with AI enabled via a group membership.
  6. While viewing todos: the "GitLab Duo" button should be not visible when signed in as any user without AI enabled via a group membership.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Jessie Young

Merge request reports