Skip to content

[SCAL-302340] - Add support for spotterSidebarConfig in AppEmbed and SpotterEmbed APP_INIT payloads#474

Merged
ravishah8176 merged 1 commit intomainfrom
SCAL-302340
Mar 24, 2026
Merged

[SCAL-302340] - Add support for spotterSidebarConfig in AppEmbed and SpotterEmbed APP_INIT payloads#474
ravishah8176 merged 1 commit intomainfrom
SCAL-302340

Conversation

@ravishah8176
Copy link
Copy Markdown
Collaborator

No description provided.

@ravishah8176 ravishah8176 requested a review from a team as a code owner March 23, 2026 10:37
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the embedding capabilities for ThoughtSpot applications by introducing a dedicated configuration object for the Spotter sidebar. This change provides developers with more control over the embedded experience, ensuring consistency and flexibility in how the AI conversation features are presented. It also includes robust handling for a deprecated configuration flag and validation for URL inputs, improving the overall reliability and maintainability of the embed SDK.

Highlights

  • Enhanced Spotter Sidebar Configuration: Introduced support for a new spotterSidebarConfig object within the APP_INIT payloads for both AppEmbed and SpotterEmbed. This allows for granular control over the Spotter sidebar's behavior and appearance, including its title, default expansion state, and past conversations feature.
  • Deprecation Handling for enablePastConversationsSidebar: Implemented logic to gracefully handle the transition from a standalone enablePastConversationsSidebar flag to its inclusion within spotterSidebarConfig. The new configuration object takes precedence, but the standalone flag is used as a fallback if the new config omits the property.
  • URL Validation for spotterDocumentationUrl: Added validation for the spotterDocumentationUrl property within spotterSidebarConfig. Invalid URLs will trigger an error and be omitted from the APP_INIT payload, ensuring data integrity and preventing malformed links.
  • New APP_INIT Data Interfaces: Defined new TypeScript interfaces, AppEmbedAppInitData and SpotterAppInitData, to explicitly type the structure of the APP_INIT payload, including the new embedParams.spotterSidebarConfig.
  • Comprehensive Test Coverage: Added extensive unit tests for both AppEmbed and SpotterEmbed to verify the correct parsing, precedence, and validation of spotterSidebarConfig and the deprecated enablePastConversationsSidebar flag in the APP_INIT payload.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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 adds support for spotterSidebarConfig in AppEmbed and SpotterEmbed APP_INIT payloads. The implementation is generally good, but I've identified a few areas for improvement. There's a potential runtime error in both AppEmbed and SpotterEmbed when constructing embedParams due to spreading a potentially undefined value. I've suggested fixes for this. Additionally, there's significant code duplication between AppEmbed and SpotterEmbed for processing spotterSidebarConfig, which I recommend refactoring into a shared utility function for better maintainability. Lastly, I've noted that the test suite for AppEmbed is missing a case for handling an invalid spotterDocumentationUrl, which is already covered for SpotterEmbed.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 23, 2026

Open in StackBlitz

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

commit: 0d7c71c

@sonar-prod-ts
Copy link
Copy Markdown

sonar-prod-ts bot commented Mar 24, 2026

SonarQube Quality Gate

Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@ravishah8176 ravishah8176 requested a review from sastaachar March 24, 2026 16:12
@ravishah8176 ravishah8176 merged commit 8b0f9e3 into main Mar 24, 2026
10 checks passed
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