From 63743f859e65e4ef58c6aeda1710b751197f553f Mon Sep 17 00:00:00 2001 From: "jishnu.pavithran" Date: Wed, 24 Jun 2026 18:59:11 +0530 Subject: [PATCH] SCAL-320072:focused homepage should also enable updatedSpotterChatPrompt --- src/embed/app.spec.ts | 17 +++++++++++++++-- src/embed/app.ts | 6 ++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/embed/app.spec.ts b/src/embed/app.spec.ts index 64e860da..0adee96d 100644 --- a/src/embed/app.spec.ts +++ b/src/embed/app.spec.ts @@ -522,7 +522,7 @@ describe('App embed tests', () => { }); }); - test('Should add homepageVersion=v4 when homePage is Focused to the iframe src', async () => { + test('Should add homepageVersion=v4 and updatedSpotterChatPrompt=true when homePage is Focused to the iframe src', async () => { await testUrlParams( { ...defaultViewConfig, @@ -530,7 +530,20 @@ describe('App embed tests', () => { homePage: HomePage.Focused, }, } as AppViewConfig, - `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v2&homepageVersion=v4${defaultParams}${defaultParamsPost}#/home`, + `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v2&homepageVersion=v4&updatedSpotterChatPrompt=true${defaultParams}${defaultParamsPost}#/home`, + ); + }); + + test('Should respect explicit updatedSpotterChatPrompt=false even when homePage is Focused', async () => { + await testUrlParams( + { + ...defaultViewConfig, + discoveryExperience: { + homePage: HomePage.Focused, + }, + updatedSpotterChatPrompt: false, + } as AppViewConfig, + `http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v2&homepageVersion=v4&updatedSpotterChatPrompt=false${defaultParams}${defaultParamsPost}#/home`, ); }); diff --git a/src/embed/app.ts b/src/embed/app.ts index 935813df..b8ba1901 100644 --- a/src/embed/app.ts +++ b/src/embed/app.ts @@ -1142,6 +1142,12 @@ export class AppEmbed extends V1Embed { if (discoveryExperience.homePage === HomePage.Focused) { params[Param.HomepageVersion] = HomePage.Focused; + // The Focused (V4) homepage experience requires the updated + // Spotter chat prompt. Enable it automatically unless the + // developer has explicitly set updatedSpotterChatPrompt. + if (isUndefined(updatedSpotterChatPrompt)) { + params[Param.UpdatedSpotterChatPrompt] = true; + } } }