From 9e8f8c5dd06ea15c40d5f7ff22b2c0ca7a53ba6d Mon Sep 17 00:00:00 2001 From: animesh935 Date: Thu, 7 May 2026 15:30:46 +0530 Subject: [PATCH 1/2] SCAL-303771 Added isSpotterErrorBannersEnabled for new spotter banner --- src/embed/app.spec.ts | 16 ++++++++++++++++ src/embed/app.ts | 2 ++ src/embed/conversation.spec.ts | 19 +++++++++++++++++++ src/embed/conversation.ts | 18 ++++++++++++++++++ src/embed/liveboard.spec.ts | 17 +++++++++++++++++ src/embed/liveboard.ts | 2 ++ src/types.ts | 1 + 7 files changed, 75 insertions(+) diff --git a/src/embed/app.spec.ts b/src/embed/app.spec.ts index 3638b441..b2481ee4 100644 --- a/src/embed/app.spec.ts +++ b/src/embed/app.spec.ts @@ -607,6 +607,22 @@ describe('App embed tests', () => { }); }); + test('should set isSpotterErrorBannersEnabled to true in url via spotterChatConfig', async () => { + const appEmbed = new AppEmbed(getRootEl(), { + ...defaultViewConfig, + spotterChatConfig: { + isSpotterErrorBannersEnabled: true, + }, + } as AppViewConfig); + appEmbed.render(); + await executeAfterWait(() => { + expectUrlMatchesWithParams( + getIFrameSrc(), + `http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isSpotterErrorBannersEnabled=true${defaultParamsPost}#/home`, + ); + }); + }); + test('should set isLiveboardXLSXCSVDownloadEnabled to false in url', async () => { const appEmbed = new AppEmbed(getRootEl(), { ...defaultViewConfig, diff --git a/src/embed/app.ts b/src/embed/app.ts index 480cd08c..f806b040 100644 --- a/src/embed/app.ts +++ b/src/embed/app.ts @@ -965,10 +965,12 @@ export class AppEmbed extends V1Embed { const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, + isSpotterErrorBannersEnabled, } = spotterChatConfig; setParamIfDefined(params, Param.HideToolResponseCardBranding, hideToolResponseCardBranding, true); setParamIfDefined(params, Param.ToolResponseCardBrandingLabel, toolResponseCardBrandingLabel); + setParamIfDefined(params, Param.IsSpotterErrorBannersEnabled, isSpotterErrorBannersEnabled, true); } if (hideObjectSearch) { diff --git a/src/embed/conversation.spec.ts b/src/embed/conversation.spec.ts index 3ab2736f..9496504b 100644 --- a/src/embed/conversation.spec.ts +++ b/src/embed/conversation.spec.ts @@ -351,6 +351,25 @@ describe('ConversationEmbed', () => { ); }); + it('should set isSpotterErrorBannersEnabled to true in url via spotterChatConfig', async () => { + const viewConfig: SpotterEmbedViewConfig = { + worksheetId: 'worksheetId', + searchOptions: { + searchQuery: 'searchQuery', + }, + spotterChatConfig: { + isSpotterErrorBannersEnabled: true, + }, + }; + + const conversationEmbed = new SpotterEmbed(getRootEl(), viewConfig); + await conversationEmbed.render(); + expectUrlMatchesWithParams( + getIFrameSrc(), + `http://${thoughtSpotHost}/v2/?${defaultParams}&isSpotterExperienceEnabled=true&isSpotterErrorBannersEnabled=true#/embed/insights/conv-assist?worksheet=worksheetId&query=searchQuery`, + ); + }); + it('should ensure deprecated ConversationEmbed class maintains same functionality as SpotterEmbed', async () => { const viewConfig: SpotterEmbedViewConfig = { worksheetId: 'worksheetId', diff --git a/src/embed/conversation.ts b/src/embed/conversation.ts index 6dd35b68..04ddca78 100644 --- a/src/embed/conversation.ts +++ b/src/embed/conversation.ts @@ -113,6 +113,22 @@ export interface SpotterChatViewConfig { * External MCP tool branding is not affected. */ toolResponseCardBrandingLabel?: string; + /** + * Enables the new Spotter error banner UI (bucketed + * error handling with RETRY / REFRESH / NEW_CHAT / + * SUPPORT actions) inside the embedded context. + * + * When `false` (default), Spotter falls back to the + * legacy error display so existing embed integrations + * are not affected. Set to `true` to opt in to the + * new error handling experience. + * + * Supported embed types: `SpotterEmbed`, `AppEmbed`, + * `LiveboardEmbed` + * @default false + * @version SDK: 1.49.0 | ThoughtSpot: 26.6.0.cl + */ + isSpotterErrorBannersEnabled?: boolean; } /** @@ -450,10 +466,12 @@ export class SpotterEmbed extends TsEmbed { const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, + isSpotterErrorBannersEnabled, } = spotterChatConfig; setParamIfDefined(queryParams, Param.HideToolResponseCardBranding, hideToolResponseCardBranding, true); setParamIfDefined(queryParams, Param.ToolResponseCardBrandingLabel, toolResponseCardBrandingLabel); + setParamIfDefined(queryParams, Param.IsSpotterErrorBannersEnabled, isSpotterErrorBannersEnabled, true); } return queryParams; diff --git a/src/embed/liveboard.spec.ts b/src/embed/liveboard.spec.ts index d434271f..342ea439 100644 --- a/src/embed/liveboard.spec.ts +++ b/src/embed/liveboard.spec.ts @@ -1329,6 +1329,23 @@ describe('Liveboard/viz embed tests', () => { }); }); + test('should set isSpotterErrorBannersEnabled parameter in url params via spotterChatConfig', async () => { + const liveboardEmbed = new LiveboardEmbed(getRootEl(), { + ...defaultViewConfig, + liveboardId, + spotterChatConfig: { + isSpotterErrorBannersEnabled: true, + }, + } as LiveboardViewConfig); + await liveboardEmbed.render(); + await executeAfterWait(() => { + expectUrlMatchesWithParams( + getIFrameSrc(), + `http://${thoughtSpotHost}/?embedApp=true${defaultParams}${prefixParams}&isSpotterErrorBannersEnabled=true#/embed/viz/${liveboardId}`, + ); + }); + }); + test('SetActiveTab Hostevent should not trigger the navigate event with the correct path, for vizEmbed', async () => { const mockProcessTrigger = jest.spyOn(tsEmbed.TsEmbed.prototype, 'trigger'); const liveboardEmbed = new LiveboardEmbed(getRootEl(), { diff --git a/src/embed/liveboard.ts b/src/embed/liveboard.ts index dadd45ba..3354806b 100644 --- a/src/embed/liveboard.ts +++ b/src/embed/liveboard.ts @@ -735,10 +735,12 @@ export class LiveboardEmbed extends V1Embed { const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, + isSpotterErrorBannersEnabled, } = spotterChatConfig; setParamIfDefined(params, Param.HideToolResponseCardBranding, hideToolResponseCardBranding, true); setParamIfDefined(params, Param.ToolResponseCardBrandingLabel, toolResponseCardBrandingLabel); + setParamIfDefined(params, Param.IsSpotterErrorBannersEnabled, isSpotterErrorBannersEnabled, true); } if (isLinkParametersEnabled !== undefined) { diff --git a/src/types.ts b/src/types.ts index f1fd563c..8c67161b 100644 --- a/src/types.ts +++ b/src/types.ts @@ -5955,6 +5955,7 @@ export enum Param { IsThisPeriodInDateFiltersEnabled = 'isThisPeriodInDateFiltersEnabled', HideToolResponseCardBranding = 'hideToolResponseCardBranding', ToolResponseCardBrandingLabel = 'toolResponseCardBrandingLabel', + IsSpotterErrorBannersEnabled = 'isSpotterErrorBannersEnabled', EnableHomepageAnnouncement = 'enableHomepageAnnouncement', EnableLiveboardDataCache = 'enableLiveboardDataCache', } From 61da034934f0279451c6b5ba57b2512f77ff37e4 Mon Sep 17 00:00:00 2001 From: animesh935 <143597087+animesh935@users.noreply.github.com> Date: Thu, 7 May 2026 15:51:41 +0530 Subject: [PATCH 2/2] Update src/embed/conversation.ts Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- src/embed/conversation.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/embed/conversation.ts b/src/embed/conversation.ts index 04ddca78..83c2a5f4 100644 --- a/src/embed/conversation.ts +++ b/src/embed/conversation.ts @@ -118,15 +118,15 @@ export interface SpotterChatViewConfig { * error handling with RETRY / REFRESH / NEW_CHAT / * SUPPORT actions) inside the embedded context. * - * When `false` (default), Spotter falls back to the + * When false (default), Spotter falls back to the * legacy error display so existing embed integrations - * are not affected. Set to `true` to opt in to the + * are not affected. Set to true to opt in to the * new error handling experience. * - * Supported embed types: `SpotterEmbed`, `AppEmbed`, - * `LiveboardEmbed` + * Supported embed types: SpotterEmbed, AppEmbed, + * LiveboardEmbed + * @version SDK: 1.49.0 | ThoughtSpot Cloud: 26.6.0.cl * @default false - * @version SDK: 1.49.0 | ThoughtSpot: 26.6.0.cl */ isSpotterErrorBannersEnabled?: boolean; }