Loading
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 toAGENTIC_CHAT_HISTORY_ROUTEinai_panel_router.js. It owns:- the
agenticWorkflows(getUserWorkflows) Apollo query - the delete-thread confirmation modal and
deleteWorkflowmutation - navigation:
select-threadstores the workflow id in session storage (the contract the state manager already hydrates from on mount) and pushes the show route;new-chatpushes the new-chat route and sets the global focus-input flag
- the
duo_agentic_chat_state_manager.vueloses all list-view concerns:mode: 'history'handling,onThreadSelected, the delete modal state and handlers, and the list-view branches inshowErrorBannerMessage/showNoNamespaceEmptyState. It keeps the workflows query solely for hydration checks (thread existence and archived/stalled state).onBackToListremains as a plain navigation to the history route (used by the thread-inactive empty state).duo_agentic_chat_view.vueis 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
onThreadSelectedis 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.jscovering 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
- Open the Duo panel and create a couple of chats.
- Open the History tab: the list renders, threads can be deleted (with confirmation), and selecting a thread opens the conversation.
- Click New chat from the history list: a fresh chat opens with the input focused.
- Select an archived/stalled thread: chat is disabled with the inactive empty state.
Edited by Tomas Bulva