Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions assets/scripts/components/conversational-search/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ initializeFeatureFlags().then(async (client) => {

if (IS_CONVERSATIONAL_SEARCH_ENABLED) {
document.body.classList.add('conv-search-enabled');
logAction('Conversational Search Impression', {
conversational_search: { action: 'impression', page: window.location.pathname }
});
initConversationalSearch();
}
});
Expand Down Expand Up @@ -322,6 +325,14 @@ class ConversationalSearch {
}

close() {
const messageCount = this.chatHistory.filter(m => m.role === 'user').length;
if (messageCount > 0) {
this.logInteraction('conversation_close', {
messages_sent: messageCount,
responses_received: this.chatHistory.filter(m => m.role === 'assistant').length
});
}

this.isOpen = false;
this.sidebar.classList.remove('open');
this.overlay.classList.remove('open');
Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/components/instantsearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ function loadInstantSearch(currentPageWasAsyncLoaded) {
if (selectedItem?.classList.contains('ais-Hits-ai-suggestion')) {
const query = selectedItem.dataset.query || aisSearchBoxInput.value;
if (window.askDocsAI) {
window.askDocsAI(query);
window.askDocsAI(query, { source: 'search_suggestion' });
// Hide the search dropdown
hitsContainerContainer.classList.add('d-none');
searchBoxContainerContainer.classList.remove('active-search');
Expand Down
Loading