Extract chat history view from Duo Agentic Chat

What does this MR do and why?

Implements the redesign proposed in the review discussion: the thread-list (history) view becomes a top-level routed component instead of a mode of the chat state manager. Related to #593468 (closed)

This builds on !249419 (merged) (route as single source of truth for the view) and completes the split so each route has exactly one owning component.

Changes

  • New DuoAgenticChatHistoryView (duo_agentic_chat_history_view.vue), wired directly to AGENTIC_CHAT_HISTORY_ROUTE in ai_panel_router.js. It owns:
    • the agenticWorkflows (getUserWorkflows) Apollo query
    • the delete-thread confirmation modal and deleteWorkflow mutation
    • navigation: select-thread stores the workflow id in session storage (the contract the state manager already hydrates from on mount) and pushes the show route; new-chat pushes the new-chat route and sets the global focus-input flag
  • duo_agentic_chat_state_manager.vue loses all list-view concerns: mode: 'history' handling, onThreadSelected, the delete modal state and handlers, and the list-view branches in showErrorBannerMessage / showNoNamespaceEmptyState. It keeps the workflows query solely for hydration checks (thread existence and archived/stalled state). onBackToList remains as a plain navigation to the history route (used by the thread-inactive empty state).
  • duo_agentic_chat_view.vue is now a pure chat view: DuoChatThreads, multiThreadedView/currentView, isMultithreaded, threadList, loadingThreadList, preferredLocale, and the related emits are removed.

Behavior notes

  • Selecting a thread from history disconnects any running stream and clears the shared message store before navigating, mirroring the cleanup the state manager performed before the extraction (cleanupState/clearActiveWorkflow).
  • Selecting an archived/stalled thread now flows through the state manager's existing hydration path, which already disables chat and shows the inactive empty state — the duplicated early-return in onThreadSelected is gone.
  • Errors from the workflows list query now surface in the history header alert; previously they were pushed into the (invisible in list view) message store.

Testing

  • New duo_agentic_chat_history_view_spec.js covering the query, selection hand-off, new-chat navigation, and the delete flow
  • State manager and view specs reworked: removed tests for the deleted list behavior, converted thread-selection setups to the session-storage hydration path
  • All 117 suites under ee/spec/frontend/ai/ pass (2573 tests)

How to set up and validate locally

  1. Open the Duo panel and create a couple of chats.
  2. Open the History tab: the list renders, threads can be deleted (with confirmation), and selecting a thread opens the conversation.
  3. Click New chat from the history list: a fresh chat opens with the input focused.
  4. Select an archived/stalled thread: chat is disabled with the inactive empty state.
Edited by Tomas Bulva

Merge request reports

Loading
Loading