Add duo chat into the project studio panel part-3
What does this MR do and why?
This MR implements dynamic title support for the GitLab Duo Studio panel, allowing the header title to update dynamically based on the active chat context (e.g., workflow goal, agent name).
Problem: The Duo Studio panel header always displayed a static title, making it difficult for users to understand which conversation or workflow they were viewing, especially when switching between different chats or viewing historical threads.
Solution: This MR adds a dynamic title system that:
- Updates the panel header to show contextual titles (workflow goals, agent names, thread titles)
- Refactors configuration management to use a centralized
chatConfiguration
object - Simplifies prop drilling by injecting configuration at the root level
- Emits title change events from child components to update the parent header
Implementation details
content_container.vue)
1. Dynamic Title System (- Added
currentChatTitle
data property to store dynamic titles - Implemented
handleTitleChange()
method to handlechange-title
events from child components - Updated header to display
currentChatTitle
when available, falling back toactiveTab.title
- Added responsive text overflow styling to handle long titles gracefully
init_duo_panel.js)
2. Configuration Centralization (- Created
chatConfiguration
object containing:-
component
: The active chat component (Agentic or placeholder) -
title
: Default title for the chat -
isAgenticAvailable
: Feature availability flag -
defaultProps
: Common props likeisEmbedded
-
- Injected
chatConfiguration
via Vue's provide/inject pattern - Eliminated need for separate
isAgenticAvailable
andchatTitle
injections
ai_panel.vue)
3. AI Panel Simplification (- Removed direct imports of chat components
- Injected
chatConfiguration
instead of individual props - Simplified computed properties by referencing centralized configuration
- Reduced code duplication across chat/new/history tabs
- Removed
availableChat
,getChatTitle
, anddefaultChatProps
computed properties
duo_agentic_chat.vue)
4. Agentic Chat Updates (- Changed
isEmbedded
from prop to computed data property derived fromactiveTabData
- Removed unnecessary
skip()
conditions in Apollo queries (simpler, always fetch) - Added
@change-title
event emission inhydrateActiveThread()
to display workflow goal - Changed default
mode
prop from'default'
to'active'
for consistency - Added
activeTabData
prop to receive parent context - Derived
isAgenticAvailable
anduserId
fromactiveTabData.props
_ask_duo_button.html.haml)
5. View Updates (- Updated data attribute from
agentic_available
toagentic-available
for consistency with Vue naming conventions
Test coverage
Updated Specs:
-
- Updated to inject
chatConfiguration
instead of individual properties - Added tests for
chatConfiguration
structure - Updated component mounting to use new injection pattern
- Updated to inject
-
- Added
activeTabData
prop to test setups - Updated tests for
isEmbedded
derived fromactiveTabData
- Verified
change-title
event emission - Added comprehensive tests for new prop structure
- Added
-
_ask_duo_button.html.haml_spec.rb
- Updated to match new
data-agentic-available
attribute naming
- Updated to match new
Dependencies
This MR requires: duo-ui!297 (merged)
query: author = "tbulva" AND type = MergeRequest AND myReaction = "cat_typing"
fields: title, state
title: Add duo chat into the project studio panel parts
display: table
sort: createdAt asc
References
Screenshots or screen recordings
Before | After |
---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
How to set up and validate locally
- Enable duo and enable agentic chat
- Navigate to any page with GitLab Duo Studio panel enabled
- Open the Duo panel from the navigation rail
- Create a new agentic workflow with a specific goal
- Verify the panel header shows the workflow goal as the title
- Switch between different threads
- Verify the title updates to reflect the active thread
- Test with long titles to verify truncation works correctly
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Tomas Bulva