diff --git a/src/libs/actions/Report/SuggestedFollowup.ts b/src/libs/actions/Report/SuggestedFollowup.ts index cb6fe1c26948..c791d522c59f 100644 --- a/src/libs/actions/Report/SuggestedFollowup.ts +++ b/src/libs/actions/Report/SuggestedFollowup.ts @@ -1,5 +1,6 @@ import type {OnyxEntry} from 'react-native-onyx'; import Onyx from 'react-native-onyx'; +import Log from '@libs/Log'; import {rand64} from '@libs/NumberUtils'; import type {Followup} from '@libs/ReportActionFollowupUtils'; import type {Ancestor, OptimisticReportAction} from '@libs/ReportUtils'; @@ -48,6 +49,13 @@ function resolveSuggestedFollowup( return; } + Log.info('[Followups] followup clicked', false, { + event: 'followup_clicked', + reportID, + reportActionID, + hasPregeneratedResponse: !!selectedFollowup.response, + }); + // Optimistically update the HTML to mark followup-list as resolved Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, { [reportActionID]: resolvedAction, diff --git a/tests/actions/ReportTest.ts b/tests/actions/ReportTest.ts index 60d241f0880e..9b2ecb5c06ee 100644 --- a/tests/actions/ReportTest.ts +++ b/tests/actions/ReportTest.ts @@ -5280,6 +5280,38 @@ describe('actions/Report', () => { expect(pendingResponse?.reportAction.created).toBeDefined(); expect(new Date(pendingResponse?.reportAction.created ?? 0).getTime()).toBeGreaterThan(new Date(userCommentAction?.created ?? 0).getTime()); }); + + it('should emit Log.info followup_clicked telemetry when a suggested followup is resolved', async () => { + const logInfoSpy = jest.spyOn(Log, 'info'); + const reportAction = { + reportActionID: REPORT_ACTION_ID, + actorAccountID: CONST.ACCOUNT_ID.CONCIERGE, + message: [ + { + html: '
Here is help