Skip to content

SCAL-313693 Create an visual embed sdk flag for controlling the new e…#531

Closed
yinstardev wants to merge 1 commit into
mainfrom
SCAL-313693
Closed

SCAL-313693 Create an visual embed sdk flag for controlling the new e…#531
yinstardev wants to merge 1 commit into
mainfrom
SCAL-313693

Conversation

@yinstardev
Copy link
Copy Markdown
Contributor

…xperience in TSE

@yinstardev yinstardev requested a review from a team as a code owner May 20, 2026 05:08
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 20, 2026

Open in StackBlitz

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

commit: 775b785

Copy link
Copy Markdown
Contributor

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

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 introduces the enableConnectionNewExperience flag to the AppEmbed configuration, allowing users to enable a new connection experience. The changes include updates to the AppViewConfig interface, the AppEmbed class, and the Param enum, along with corresponding unit tests. The review feedback identifies several violations of the style guide: the @version tag in the JSDoc needs to be corrected to match the canonical SDK-to-Cloud version mapping, and the boolean parameter should not have a default value of false in destructuring. Instead, it should remain undefined and be omitted from the URL when not explicitly provided to prevent URL bloat. Consequently, the unit tests should also be updated to reflect that the parameter is omitted by default.

Comment thread src/embed/app.ts
* This flag is used to enable the new connection experience for AppEmbed.
*
* Supported embed types: `AppEmbed`
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.8.0.cl
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.

medium

The version pairing for SDK 1.50.0 should map to ThoughtSpot Cloud 26.7.0.cl according to the canonical mapping in the style guide.

Suggested change
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.8.0.cl
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
References
  1. The @Version tag must follow the canonical mapping between SDK and ThoughtSpot Cloud versions. For SDK 1.50.0, the pairing is ThoughtSpot Cloud: 26.7.0.cl. (link)

Comment thread src/embed/app.ts
hideApplicationSwitcher,
hideOrgSwitcher,
enableSearchAssist,
enableConnectionNewExperience = false,
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.

medium

Boolean parameters should not have a default value of false in destructuring. They should remain undefined to allow for omission from the URL when not explicitly set by the user, reducing URL bloat.

Suggested change
enableConnectionNewExperience = false,
enableConnectionNewExperience,
References
  1. Do not use = false as a default in destructuring. Leave the value as undefined when not set, and only add the param to the request when the caller explicitly provides a value (!== undefined). (link)

Comment thread src/embed/app.ts
params[Param.EnableSearchAssist] = enableSearchAssist;
}

params[Param.EnableConnectionNewExperience] = enableConnectionNewExperience;
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.

medium

This parameter should only be added to the request when the caller explicitly provides a value. Redundant false values should be omitted from the URL.

        if (enableConnectionNewExperience !== undefined) {
            params[Param.EnableConnectionNewExperience] = enableConnectionNewExperience;
        }
References
  1. Omit the param entirely when the value is not explicitly provided. Only add the param to the request when the caller explicitly provides a value (!== undefined). (link)

Comment thread src/embed/app.spec.ts
await executeAfterWait(() => {
expectUrlMatchesWithParams(
getIFrameSrc(),
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableConnectionNewExperience=false${defaultParams}${defaultParamsPost}#/home`,
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.

medium

Since the parameter should be omitted from the URL when not explicitly provided (default behavior), the test expectation should be updated to reflect that enableConnectionNewExperience=false is no longer present in the default URL.

Suggested change
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&enableConnectionNewExperience=false${defaultParams}${defaultParamsPost}#/home`,
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`,
References
  1. Omit the param entirely when the value is not explicitly provided to reduce URL/query string size unnecessarily. (link)

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.

2 participants