Brainstorming Session on Additional Context in Web UI Environment
Problem Statement
The implementation of slash commands and code context in the chat interface in IDE, also known as "Code Tasks", has been successful in the IDE environment. However, the same functionality needs to be extended to the Web UI environment. The main challenge is how to gather and send additional context, such as selected code, file path, and full file content, in the Web UI environment. This is crucial for commands like /refactor, /explain, and /test to function effectively as they rely on this context.
Exit Criteria
The issue will be considered resolved when we have a clear and feasible plan on how to gather and send additional context in the Web UI environment. This plan should detail the technical approach, potential challenges, and proposed solutions. It should also consider the user experience and ensure that the implementation is intuitive and seamless for the user. The plan should be agreed upon by all relevant stakeholders and ready for implementation.
Agreed outcome
- we care about blobs, snippets, and MRs. Different implementations could be approached iteratively
-
@dmishunov comes up with two POCs for:
- Selection of the code blocks similar to the current blob selections, like https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/javascripts/main.js#L53-61, for example. This approach requires:
- updating snippets to preserve selection
- checking that we can use the multi-line selection mechanism in MRs
- Providing the contextual menu for AI features (Code Tasks) the same way we have Explain Code on blobs implemented atm. This approach requires:
- updating the icon, shown when selecting a code snippet to show AI Tanuki, instead of a question mark
- showing some contextual menu when the icon is clicked
- the entries in the menu should be linked to the Code Tasks in Duo Chat (or any other AI feature need)
- Selection of the code blocks similar to the current blob selections, like https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/javascripts/main.js#L53-61, for example. This approach requires: