Skip to content

SCAL-321279 Additional flag should be top level override, show analyse and fix it SDK#567

Open
shivam-kumar-ts wants to merge 2 commits into
mainfrom
SCAL-321279
Open

SCAL-321279 Additional flag should be top level override, show analyse and fix it SDK#567
shivam-kumar-ts wants to merge 2 commits into
mainfrom
SCAL-321279

Conversation

@shivam-kumar-ts

@shivam-kumar-ts shivam-kumar-ts commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

WILL MERGE AFTER FEW TESTING

/**
 * Merges the `additionalFlags` provided at init time (via the global
 * embed config) with those provided per-embed (via the view config).
 * View-level flags take precedence over init-level flags.
 * @returns The merged map of additional URL flags.
 */
 
 
 
 
     /**
 * Applies `additionalFlags` on top of the provided query params so that
 * they always override any other flag with the same key. This must be the
 * last mutation applied to the query params, regardless of the embed type,
 * because individual embeds add their own flags after `getBaseQueryParams`
 * runs. Calling this at the final step guarantees `additionalFlags` wins
 * across every embed type.
 * @param queryParams The query params to apply the additional flags on.
 * @returns The same query params object with additional flags applied.
 */

@shivam-kumar-ts shivam-kumar-ts requested a review from a team as a code owner June 30, 2026 06:12

@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 the application of additionalFlags across various embed types by introducing a centralized applyAdditionalFlagsOverride helper in TsEmbed. This ensures that additional flags are applied as the final step and correctly override other query parameters. Unit tests have also been added to verify this behavior. The review feedback suggests reassigning the returned value of applyAdditionalFlagsOverride in AppEmbed to ensure future-proof compatibility if the method is refactored to be non-mutating, and adding a defensive check in applyAdditionalFlagsOverride to prevent potential runtime TypeErrors if queryParams is undefined.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

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

pkg-pr-new Bot commented Jun 30, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 1cf10e6

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