Rename Duo Chat state manager components
What does this MR do and why?
Renames the Duo Chat state manager components to make their role explicit and adds a feature flag to switch from @gitlab/duo-ui view components to the locally migrated ones introduced in !228427 (merged), as part of #593464.
This MR is the second of two:
- Parent MR !228427 (merged) — adds the local view components and their specs (must be merged first).
- This MR — renames the state manager components, adds the feature flag, and wires up conditional rendering.
Changes
- Rename state manager components to clarify their role:
duo_chat.vue→duo_chat_state_manager.vueduo_agentic_chat.vue→duo_agentic_chat_state_manager.vue
- Rename corresponding spec files accordingly.
- Add
duo_chat_monolith_componentsfeature flag (gitlab_com_derisk, default disabled) — controls whether to use the locally migrated view components or the@gitlab/duo-uicomponents. - Register the flag in
ee/lib/ee/gitlab/gon_helper.rbviapush_frontend_feature_flagso it is available in the frontend. - Wire up conditional rendering in both state managers:
- Flag enabled → renders
DuoChatView/DuoAgenticChatView(local monolith). - Flag disabled (default) → renders
WebDuoChat/WebAgenticDuoChatfrom@gitlab/duo-ui
- Flag enabled → renders
- Remove
dimensions,error, andagentsprops from state manager templates (not used by the local view components). - Update all import paths in
init_duo_panel.js, spec files, and ESLint todo lists.
| Feature | feature flag off | feature flag on |
|---|---|---|
| Agentic Chat | ![]() |
![]() |
| Classic Chat | ![]() |
![]() |
References
Part of #593464
Depends on: !228427 (merged)
Screenshots or screen recordings
N/A — no visual changes. Behaviour is identical with the flag disabled (default).
How to set up and validate locally
-
Ensure the parent MR (!228427 (merged)) is merged or checked out locally first.
-
Run the renamed spec files to confirm they still pass:
yarn jest ee/spec/frontend/ai/tanuki_bot/components/duo_chat_state_manager_spec.js yarn jest ee/spec/frontend/ai/duo_agentic_chat/components/duo_agentic_chat_state_manager_spec.js -
To test with the feature flag enabled, open a Rails console and run:
Feature.enable(:duo_chat_monolith_components)Then open Duo Chat and verify it still functions correctly using the locally migrated view components.
-
Disable the flag and verify it falls back to the
@gitlab/duo-uicomponents:Feature.disable(:duo_chat_monolith_components)
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.



