Add the GitLab Duo chat component to @gitlab/ui

The implementation blueprint

GitLab Duo Chat has been available in GitLab product since around "%16.0" in that or another form behind the feature flags. Since %16.4 the chat is enabled by default, anybody on the Ultimate license can access it.

The Duo Chat is the set of the UI components connected into a compound component, used by GitLab in the Web UI.

Why to move to gitlab-ui?

The GitLab Duo Chat is supposed to be available not only in Web UI, but also in different other environments like Web IDE, and different desktop IDEs. To minimize the implementation and maintenance costs, we need to DRY out the chat UI implementation and, preferably, make it once and use it everywhere. One of the solutions in this case would be to move the chat UI out of the GitLab product into a separate package and make it a dependency for all environments the chat is supposed to be used in. However, this unnecessarily increases the implementation and maintenance costs due to the need to set up the release, review, etc. processes for the new package.

At the same time, we already have a package containing re-usable components, which can be installed anywhere and has all processes in place. That's gitlab-ui. Converting the Duo Chat into a shared component removes the need for separate engineers on different IDE teams to implement and maintain the chat UI, which dramatically reduces time-to-market in those environments and cuts the costs for each particular team.

The Cons of moving to gitlab-ui

The Pros of moving to gitlab-ui

  • established automated release routines in gitlab-ui. Even though Duo Chat will have to wait for the new release of gitlab-ui when adding/updating features, the release process is automated at least in the context of gitlab-ui
  • superb visual testing capabilities for the component, using the Storybook. It also provides a much better developer experience for those groups willing to see what is possible with Duo Chat by playing with the props in Storybook and instantly seeing the result
  • having Duo Chat in gitlab-ui removes the psychological barriers for those willing to use and contribute to chat but are intimidated by it being some voodoo AI magic

Considering the points above, it has been suggested by groupai framework to move the component into gitlab-ui to make sharing the chat UI easier among all possible consumers.

Some implementation details

The way the component is suggested to be implemented should not create new patterns or dependencies for gitlab-ui package. This might require re-architecting the Duo Chat component to meet the following criteria:

For easier understanding of all components involved and their relationship, here's the visual anatomy of the GlDuoChat component:Screenshot_2023-09-29_at_09.18.32

What's next after the component lands in gitlab-ui?

It is suggested that the frontend members of groupai framework (only @dmishunov at the time of writing) are added to:

  • maintainers of the gitlab/ui package,
  • CODEOWNERS for src/components/experimental folder of gitlab-ui with required approval
Edited by Denys Mishunov