Skip to content

SCAL-335453 Send Spotter embedParams at the top level on pre-render show - #774

Open
PunitBadjate wants to merge 1 commit into
mainfrom
SCAL-335453_embedParams
Open

PunitBadjate wants to merge 1 commit into
mainfrom
SCAL-335453_embedParams

Conversation

@PunitBadjate

Copy link
Copy Markdown
Collaborator

Summary

When a pre-rendered embed is shown, the SDK sends its config in
HostEvent.UpdateEmbedParams. That payload spread the whole app-init data,
so the values built by spotter-utils.ts and spotter-viz-utils.ts arrived
nested under an embedParams key. The app uses the UpdateEmbedParams
payload as its embed params as-is, and reads these values at the top level,
so in pre-render they were ignored:

  • spotterVizConfig (SpotterViz branding, prompts, loader text, file upload)
  • starterPrompts
  • visualOverridesParams
  • enableSpotterInstructionAndMoreSettings
  • the resolved spotterSidebarConfig (the raw viewConfig copy was used
    instead, without the standalone enablePastConversationsSidebar merge or
    the documentation URL validation)

Configs whose viewConfig name matches the app's
(spotterShareConversationConfig, spotterAnalystConfig,
spotterUsageLimitConfig) only worked by chance, skipping the builders'
checks. The APP_INIT path was unaffected: the app flattens embedParams
there.

Changes

  • ts-embed.ts getUpdateEmbedParamsObject(): take embedParams out of the
    app-init data and spread its contents at the top level of the payload,
    after viewConfig, so the built values win over the raw ones. This matches
    what the app does with APP_INIT data. It applies to every embed that adds
    embedParams in getAppInitData() (AppEmbed, ConversationEmbed,
    LiveboardEmbed); embeds without it are unchanged.
  • No change to spotter-utils.ts / spotter-viz-utils.ts: the APP_INIT path
    still needs their nested embedParams.

@PunitBadjate
PunitBadjate requested a review from a team as a code owner November 25, 2026 07:04

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates TsEmbed to destructure and spread embedParams at the top level of the returned object in getAppInitData, ensuring that the application can read these parameters directly. Additionally, a new unit test has been added to app.spec.ts to verify that getUpdateEmbedParamsObject correctly handles and flattens the Spotter-related embed parameters. There are no review comments, and the changes look correct and well-tested, so I have no feedback to provide.

@pkg-pr-new

pkg-pr-new Bot commented Nov 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@thoughtspot/visual-embed-sdk@774

commit: 89bea8a

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant