Skip to content

Commit f69c2ef

Browse files
committed
👔 Utilize acknowledgement hook when selecting ask seer option from key selection dropdown
1 parent ee0894d commit f69c2ef

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

static/app/components/searchQueryBuilder/tokens/filterKeyListBox/useFilterKeyListBox.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {useCallback, useEffect, useMemo, useState} from 'react';
33
import type {ComboBoxState} from '@react-stately/combobox';
44
import type {Node} from '@react-types/shared';
55

6+
import {useSeerAcknowledgeMutation} from 'sentry/components/searchQueryBuilder/askSeer';
67
import {useSearchQueryBuilder} from 'sentry/components/searchQueryBuilder/context';
78
import type {CustomComboboxMenu} from 'sentry/components/searchQueryBuilder/tokens/combobox';
89
import {FilterKeyListBox} from 'sentry/components/searchQueryBuilder/tokens/filterKeyListBox';
@@ -380,6 +381,8 @@ export function useFilterKeyListBox({filterValue}: {filterValue: string}) {
380381
[handleArrowUpDown, handleCycleRecentFilterKeys, handleCycleSections]
381382
);
382383

384+
const {mutate: seerAcknowledgeMutate} = useSeerAcknowledgeMutation();
385+
383386
const handleOptionSelected = useCallback(
384387
(option: FilterKeyItem) => {
385388
if (option.type === 'ask-seer') {
@@ -392,15 +395,15 @@ export function useFilterKeyListBox({filterValue}: {filterValue: string}) {
392395
}
393396

394397
if (option.type === 'ask-seer-consent') {
395-
// TODO: Implement logic to handle consent
396398
trackAnalytics('trace.explorer.ai_query_interface', {
397399
organization,
398400
action: 'consent_accepted',
399401
});
402+
seerAcknowledgeMutate();
400403
return;
401404
}
402405
},
403-
[organization, setDisplaySeerResults]
406+
[organization, seerAcknowledgeMutate, setDisplaySeerResults]
404407
);
405408

406409
return {

0 commit comments

Comments
 (0)