Skip to content

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
SFINT-6581
Open

feat(headless) Extend internal Generated Answer With Follow Ups controller analytics methods to support follow-up answers#7182
SimonMilord wants to merge 10 commits intomainfrom
SFINT-6581

Conversation

@SimonMilord
Copy link
Contributor

@SimonMilord SimonMilord commented Feb 27, 2026

SFINT-6581

IN THIS PR:

  • Created overloads for generated answer analytics actions to take an optional answerId parameter 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)
  • Added analytics sent with the answerId in the headless-generated-answer-with-follow-ups controller + the headless-core-generated-answer controller.
  • Modified the JSDOC to show that the method without the answerId is to be deprecated.
  • Added unit tests.
  • Created the ticket SFINT-6665 as TODO to clean up the code and to accept a required answerId param in UI-KIT V4

@github-actions
Copy link

github-actions bot commented Feb 27, 2026

🔗 Scratch Orgs ready to test this PR:

@SimonMilord SimonMilord marked this pull request as ready for review March 2, 2026 19:22
@SimonMilord SimonMilord requested review from a team, alexprudhomme, Copilot, fbeaudoincoveo, lavoiesl, louis-bompart and y-lakhdar and removed request for Copilot March 2, 2026 19:22
@SimonMilord SimonMilord temporarily deployed to Prerelease (CDN) March 2, 2026 19:27 — with GitHub Actions Inactive
Copilot AI review requested due to automatic review settings March 3, 2026 16:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 answerId when 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants