Skip to content

Conversation

@shivam-kumar-ts
Copy link
Contributor

@shivam-kumar-ts shivam-kumar-ts commented Oct 6, 2025

  • Add hideTagFilterChips option to AppEmbed for cleaner UI

@shivam-kumar-ts shivam-kumar-ts requested a review from a team as a code owner October 6, 2025 09:04
@mnk-blr
Copy link
Collaborator

mnk-blr commented Oct 6, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

@gemini-code-assist
Copy link

Summary of Changes

Hello @shivam-kumar-ts, 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 introduces a new hideTagFilterChips option within the BaseViewConfig to provide a cleaner user interface. This configuration flag, when enabled, automatically manages the visibility of tag-related UI components, such as filter chips, the 'Manage Tags' action, and the 'Tags' column in list pages, thereby simplifying the process of customizing the display for embedded applications.

Highlights

  • New Configuration Option: Introduced a new hideTagFilterChips boolean option to the BaseViewConfig interface, allowing for simplified control over tag-related UI elements.
  • Automated UI Cleanup: When hideTagFilterChips is set to true, the system automatically ensures that tag filter indicators/chips are hidden, Action.ManageTags is added to hiddenActions, and ListPageColumns.Tags is added to hiddenListColumns.
  • Simplified Tag Management: This feature provides a single, convenient flag to streamline the user interface by removing various tag-related elements without requiring manual configuration of individual hiddenActions or hiddenListColumns.
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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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

@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 a new hideTagFilterChips option to BaseViewConfig, which simplifies hiding tag-related UI elements by automatically managing hiddenListColumns and hiddenActions. The implementation is functionally correct. My feedback focuses on improving code conciseness and maintainability by refactoring duplicated logic and fixing a minor formatting issue in the JSDoc.

Comment on lines 430 to 435
const finalHiddenListColumns = [...(this.viewConfig.hiddenListColumns || [])];
if (this.viewConfig.hideTagFilterChips) {
if (!finalHiddenListColumns.includes(ListPageColumns.Tags)) {
finalHiddenListColumns.push(ListPageColumns.Tags);
}
}

Choose a reason for hiding this comment

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

medium

This block of code can be made more concise by using a Set to handle the uniqueness of elements, and conditional spreading to add the new tag. This approach is cleaner and avoids nested if statements. A similar pattern can be applied to the logic for finalHiddenActions as well to reduce code duplication.

        const finalHiddenListColumns = [...new Set([
            ...(this.viewConfig.hiddenListColumns || []),
            ...(this.viewConfig.hideTagFilterChips ? [ListPageColumns.Tags] : []),
        ])];

Comment on lines 665 to 670
const finalHiddenActions = [...(hiddenActions ?? [])];
if (hideTagFilterChips) {
if (!finalHiddenActions.includes(Action.ManageTags)) {
finalHiddenActions.push(Action.ManageTags);
}
}

Choose a reason for hiding this comment

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

medium

Similar to the logic for hiddenListColumns, this block can be simplified. Using a Set with conditional spreading provides a more concise and readable way to ensure Action.ManageTags is added to the hiddenActions array without duplicates.

        const finalHiddenActions = [...new Set([
            ...(hiddenActions ?? []),
            ...(hideTagFilterChips ? [Action.ManageTags] : []),
        ])];

src/types.ts Outdated
Comment on lines 1087 to 1111
/**
* Hide tag filter chips that appear when content is filtered by tags.
* When enabled, this automatically:
* - Hides tag filter indicators/chips from the UI
* - Adds Action.ManageTags to hiddenActions (if not already present)
* - Adds ListPageColumns.Tags to hiddenListColumns (if not already present)
*
* This provides a clean interface without tag-related UI elements.
*
* Supported embed types: `AppEmbed`
* @version SDK: 1.42.1 | ThoughtSpot: 10.14.0.cl
* @example
* ```js
* // Simple usage - automatically hides all tag-related UI
* const embed = new AppEmbed('#tsEmbed', {
* ... // other embed view config
* tag: 'Retail Sales',
* hideTagFilterChips: true, // This is all you need!
* });
*
* // No need to manually specify:
* // hiddenActions: [Action.ManageTags],
* // hiddenListColumns: [ListPageColumns.Tags]
* ```
*/

Choose a reason for hiding this comment

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

medium

The JSDoc for the new hideTagFilterChips property is indented incorrectly. It should be aligned with the other properties in the BaseViewConfig interface for consistency.

    /**
     * Hide tag filter chips that appear when content is filtered by tags.
     * When enabled, this automatically:
     * - Hides tag filter indicators/chips from the UI
     * - Adds Action.ManageTags to hiddenActions (if not already present)
     * - Adds ListPageColumns.Tags to hiddenListColumns (if not already present)
     * 
     * This provides a clean interface without tag-related UI elements.
     *
     * Supported embed types: `AppEmbed`
     * @version SDK: 1.42.1 | ThoughtSpot: 10.14.0.cl
     * @example
     * ```js
     * // Simple usage - automatically hides all tag-related UI
     * const embed = new AppEmbed('#tsEmbed', {
     *    ... // other embed view config
     *    tag: 'Retail Sales',
     *    hideTagFilterChips: true, // This is all you need!
     * });
     * 
     * // No need to manually specify:
     * // hiddenActions: [Action.ManageTags],
     * // hiddenListColumns: [ListPageColumns.Tags]
     * ```
     */

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 6, 2025

Open in StackBlitz

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

commit: 0142412

@shivam-kumar-ts shivam-kumar-ts force-pushed the SCAL-274111 branch 2 times, most recently from 42356c3 to aeeb08d Compare October 6, 2025 11:57
@shivam-kumar-ts shivam-kumar-ts changed the title SCAL-274111 Add hideTagFilterChips option to BaseViewConfig for cleaner UI SCAL-274111 Add hideTagFilterChips option to AppEmbed for cleaner UI Oct 6, 2025
@shivam-kumar-ts shivam-kumar-ts force-pushed the SCAL-274111 branch 3 times, most recently from af5068a to 183ef0c Compare October 6, 2025 12:10
src/embed/app.ts Outdated
* This provides a clean interface without tag-related UI elements.
*
* Supported embed types: `AppEmbed`
* @version SDK: 1.42.1 | ThoughtSpot: 10.14.0.cl
Copy link
Contributor

Choose a reason for hiding this comment

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

Thoughtspot version would be 10.15.0.cl

src/embed/app.ts Outdated
* This provides a clean interface without tag-related UI elements.
*
* Supported embed types: `AppEmbed`
* @version SDK: 1.42.1 | ThoughtSpot: 10.15.0.cl
Copy link
Contributor

Choose a reason for hiding this comment

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

SDK version is incorrect.
Shivam while writing the SDK version, map SDK version like this -
For 10.13.0.cl, we will be having 1.42.0
For 10.14.0.cl, we will be having 1.43.0
So for 10.15.0.cl, we will be having 1.44.0 as the SDK version. And if the changes are only in SDK, then add SDK version as next minor version for example - 1.42.1 is already published so next minor version is 1.42.2 so add that as the SDK version and then publish the new version

src/embed/app.ts Outdated
* This provides a clean interface without tag-related UI elements.
*
* Supported embed types: `AppEmbed`
* @version SDK: 1.42.2 | ThoughtSpot: 10.15.0.cl
Copy link
Contributor

Choose a reason for hiding this comment

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

SDK version will be 1.44.0

src/embed/app.ts Outdated
* hideTagFilterChips: true, // This is all you need!
* });
*
* // No need to manually specify:
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to mention this

src/embed/app.ts Outdated
* Hide tag filter chips that appear when content is filtered by tags.
* When enabled, this automatically:
* - Hides tag filter indicators/chips from the UI
* - Adds Action.ManageTags to hiddenActions (if not already present)
Copy link
Contributor

Choose a reason for hiding this comment

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

We are not doing this right? why have we added this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this AppViewConfig will do this things, so added as a reference for the user

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@shivam-kumar-ts shivam-kumar-ts force-pushed the SCAL-274111 branch 2 times, most recently from d5fa94a to ec7c7fb Compare October 8, 2025 10:59
src/embed/app.ts Outdated
params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
params[Param.HideTagFilterChips] = hideTagFilterChips;
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's not add it by default. It will unnecessary increase the length of the url. Check if it is not undefined then only add it as part of query params. Look at other places how we have added query params optionally.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@shivam-kumar-ts shivam-kumar-ts force-pushed the SCAL-274111 branch 2 times, most recently from 393f415 to 75ede10 Compare October 10, 2025 06:31
@sonar-prod-ts
Copy link

sonar-prod-ts bot commented Oct 10, 2025

SonarQube Quality Gate

Quality Gate passed

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

No Coverage information No Coverage information
0.0% 0.0% Duplication

@shivam-kumar-ts shivam-kumar-ts merged commit ecc671e into main Oct 10, 2025
9 of 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.

5 participants