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:

  1. Parent MR !228427 (merged) — adds the local view components and their specs (must be merged first).
  2. 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.vueduo_chat_state_manager.vue
    • duo_agentic_chat.vueduo_agentic_chat_state_manager.vue
  • Rename corresponding spec files accordingly.
  • Add duo_chat_monolith_components feature flag (gitlab_com_derisk, default disabled) — controls whether to use the locally migrated view components or the @gitlab/duo-ui components.
  • Register the flag in ee/lib/ee/gitlab/gon_helper.rb via push_frontend_feature_flag so 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 / WebAgenticDuoChat from @gitlab/duo-ui
  • Remove dimensions, error, and agents props 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 before.png after.png
Classic Chat before_classic.png after_classic.png

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

  1. Ensure the parent MR (!228427 (merged)) is merged or checked out locally first.

  2. 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
  3. 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.

  4. Disable the flag and verify it falls back to the @gitlab/duo-ui components:

    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.

Edited by Enrique Alcántara

Merge request reports

Loading