Skip to content

SCAL-342254 Send the embed config in APP_INIT when excludeConfigFromURL is set, to stop flicker on first load - #696

Open
shivam-kumar-ts wants to merge 5 commits into
mainfrom
SCAL-342254
Open

shivam-kumar-ts wants to merge 5 commits into
mainfrom
SCAL-342254

Conversation

@shivam-kumar-ts

@shivam-kumar-ts shivam-kumar-ts commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

SCAL-342254 Keep the layout flags on the iframe URL when excludeConfigFromURL is set

With excludeConfigFromURL set, only the params in BOOTSTRAP_URL_PARAMS
stay on the iframe src. The rest arrive over HostEvent.UpdateEmbedParams
after the app has loaded. Several of those late params decide the first
render: navigation, page versions, the Liveboard header and grid, the
search bar and its initial query, and Spotter's empty screen. The app
painted its default layout first and then switched, so the embed
flickered.

Add 62 layout and navigation flags to BOOTSTRAP_URL_PARAMS (38 -> 100),
grouped by area: app navigation, page versions, Liveboard layout,
search layout and initial query, and Spotter's experience and empty
screen. Each one is still added to the URL only when the caller sets
it.

Action and tab lists (HideActions, VisibleActions, DisableActions,
PrimaryAction, HiddenTabs, VisibleTabs) and behavior-only flags still
go over UpdateEmbedParams.

Update the excludeConfigFromURL tests: drop the checks that
isPinboardV2Enabled and enableDataPanelV2 stay off the URL, and add a
test that the layout flags stay on it.


Problem

With the excludeConfigFromURL additional flag, only the params in
BOOTSTRAP_URL_PARAMS stayed on the iframe src. Everything else was sent
over HostEvent.UpdateEmbedParams after EmbedListenerReady, which is after
the app's first render. Many of those params decide what the first render
looks like: navigation, page versions, the Liveboard header and grid, the
search bar and its initial query, and Spotter's empty screen. The app painted
its default layout first and then switched once the params arrived, so the
embed flickered.

Fix

Send the held-back params in the APP_INIT response instead. The app already
waits for APP_INIT before its first render (appInit() in blink-v2
awaits onEmbedInit before renderApp), and already reads it in the two
places a URL load feeds:

  • Top-level keys override the app's feature flags, through
    setEmbedInitData → overrideFlags(_.pick(data, Object.keys(FLAGS))).
    26 of the layout params are read this way, for example primaryNavHidden,
    isPinboardV2Enabled, navigationVersion and enableDataPanelV2.
  • embedParams seeds the embed container's first-render state,
    ahead of the URL (embed.container.tsx, through
    getEmbedQueryParamsFromInitData).

So every held-back param goes in both. No change is needed on the
ThoughtSpot app side.

@shivam-kumar-ts
shivam-kumar-ts requested a review from a team as a code owner October 1, 2026 12:54

@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 adds layout and chrome flags (including navigation, page versions, Liveboard layout, search layout, and Spotter experience flags) to the BOOTSTRAP_URL_PARAMS set to ensure they are included in the initial render URL. It also updates the unit tests to verify these flags are preserved. The review feedback recommends adding missing Spotter sidebar flags (Param.EnablePastConversationsSidebar and Param.SpotterSidebarDefaultExpanded) to the bootstrap parameters to prevent UI flickering during the initial load.

Comment thread src/embed/ts-embed.ts Outdated
@pkg-pr-new

pkg-pr-new Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

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

commit: b27cf75

@shivam-kumar-ts shivam-kumar-ts changed the title SCAL-342254 Keep the layout flags on the iframe URL when excludeConfigFromURL is set SCAL-342254 Send the embed config in APP_INIT when excludeConfigFromURL is set, to stop flicker on first load Oct 2, 2026
@shivam-kumar-ts

Copy link
Copy Markdown
Contributor Author

@gemini review

@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 refactors how configuration parameters are sent to the embedded application when config exclusion is enabled. Instead of sending excluded parameters via UpdateEmbedParams after the frame is ready, they are now held back from the URL and delivered directly in the APP_INIT payload. This change includes updates to BOOTSTRAP_URL_PARAMS, the addition of a helper withExcludedUrlParams to merge these parameters, and comprehensive unit tests. A review comment suggests ensuring that properties with undefined values are not added to excludedParams to prevent isEmpty from incorrectly returning false and failing to reset this.excludedUrlParams to null.

Comment thread src/embed/ts-embed.ts

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