feat(headless) Extend internal Generated Answer With Follow Ups controller analytics methods to support follow-up answers#7182
Open
SimonMilord wants to merge 10 commits intomainfrom
Open
feat(headless) Extend internal Generated Answer With Follow Ups controller analytics methods to support follow-up answers#7182SimonMilord wants to merge 10 commits intomainfrom
SimonMilord wants to merge 10 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Extends the headless generated-answer analytics plumbing to support follow-up answers by allowing analytics actions/controllers to log events for a specific answerId (instead of always using the head answer ID from state).
Changes:
- Added overloads to generated answer analytics actions to optionally accept an explicit
answerId. - Updated core and follow-ups generated answer controllers to forward
answerIdwhen logging like/dislike/copy/citation hover/click analytics. - Added unit tests covering the new
answerId-provided paths for both legacy and next analytics modes.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/headless/src/features/generated-answer/generated-answer-analytics-actions.ts | Adds overloads and resolves answerId from argument or state before building analytics payloads/builders. |
| packages/headless/src/features/generated-answer/generated-answer-analytics-actions.test.ts | Adds tests verifying analytics builders/payloads use the provided answerId. |
| packages/headless/src/controllers/knowledge/generated-answer/headless-generated-answer-with-follow-ups.ts | Adds follow-up-aware analytics logging methods and forwards answerId for follow-up events. |
| packages/headless/src/controllers/knowledge/generated-answer/headless-generated-answer-with-follow-ups.test.ts | Adds tests for delegation vs follow-up analytics dispatch behavior (including citation click/hover). |
| packages/headless/src/controllers/core/generated-answer/headless-core-generated-answer.ts | Adds overloaded controller APIs and dispatches analytics with optional provided answerId. |
| packages/headless/src/controllers/core/generated-answer/headless-core-generated-answer.test.ts | Adds tests asserting analytics actions are called with the provided answerId. |
packages/headless/src/features/generated-answer/generated-answer-analytics-actions.ts
Outdated
Show resolved
Hide resolved
...less/src/controllers/knowledge/generated-answer/headless-generated-answer-with-follow-ups.ts
Outdated
Show resolved
Hide resolved
packages/headless/src/controllers/core/generated-answer/headless-core-generated-answer.ts
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SFINT-6581
IN THIS PR:
answerIdparameter which would allow us to support analytics for the followup answers feature. (if an answerId is passed, we send that otherwise we go and get the one in the state (the first answer answerId)headless-generated-answer-with-follow-upscontroller + theheadless-core-generated-answercontroller.answerIdis to be deprecated.answerIdparam in UI-KIT V4