From 8d570e26ce76b66f2f9d9eef26d46ab8a6ed1505 Mon Sep 17 00:00:00 2001 From: ShashiSubramanya Date: Tue, 13 Jan 2026 12:22:39 +0530 Subject: [PATCH 1/4] banner text edits --- src/components/AnnouncementBanner/index.scss | 38 ++++++++++++++++++++ src/components/AnnouncementBanner/index.tsx | 24 +++++++++++++ src/components/DevDocTemplate/index.tsx | 36 +++++++++++++++++++ src/configs/doc-configs.js | 12 +++++++ 4 files changed, 110 insertions(+) create mode 100644 src/components/AnnouncementBanner/index.scss create mode 100644 src/components/AnnouncementBanner/index.tsx diff --git a/src/components/AnnouncementBanner/index.scss b/src/components/AnnouncementBanner/index.scss new file mode 100644 index 000000000..bff42281f --- /dev/null +++ b/src/components/AnnouncementBanner/index.scss @@ -0,0 +1,38 @@ +.announcementBanner { + width: 100%; + border-bottom: 1px solid var(--border-color); + background: #dce5f9; + color: var(--primary-color); +} + +.announcementBanner__inner { + display: flex; + gap: 12px; + align-items: center; + justify-content: center; + padding-top: 10px; + padding-bottom: 10px; +} + +.announcementBanner__content { + font-size: 15px; + line-height: 21px; + text-align: center; + flex: 1 1 auto; + font-weight: 500; + color: #4b5563; +} + +.announcementBanner__link { + color: #1a73e8; + text-decoration: underline; + font-size: 15px; +} + +@media screen and (max-width: 767px) { + .announcementBanner__inner { + flex-direction: column; + align-items: flex-start; + } +} + diff --git a/src/components/AnnouncementBanner/index.tsx b/src/components/AnnouncementBanner/index.tsx new file mode 100644 index 000000000..e88c22e38 --- /dev/null +++ b/src/components/AnnouncementBanner/index.tsx @@ -0,0 +1,24 @@ +import React from 'react'; +import './index.scss'; + +type AnnouncementBannerProps = { + enabled?: boolean; + message: React.ReactNode; +}; + +const AnnouncementBanner = (props: AnnouncementBannerProps) => { + const { enabled = true, message } = props; + + if (!enabled) return null; + + return ( +
+
+
{message}
+
+
+ ); +}; + +export default AnnouncementBanner; + diff --git a/src/components/DevDocTemplate/index.tsx b/src/components/DevDocTemplate/index.tsx index be6ea8441..778e8a010 100644 --- a/src/components/DevDocTemplate/index.tsx +++ b/src/components/DevDocTemplate/index.tsx @@ -23,6 +23,7 @@ import { getAlgoliaIndex } from '../../configs/algolia-search-config'; import RenderPlayGround from './playGround/RESTAPI'; import GraphQLPlayGround from './playGround/GraphQL'; import { AskDocs } from './askDocs'; +import AnnouncementBanner from '../AnnouncementBanner'; import { TS_HOST_PARAM, TS_ORIGIN_PARAM, @@ -34,6 +35,7 @@ import { DEFAULT_PREVIEW_HOST, DEFAULT_APP_ROOT, HOME_PAGE_ID, + HOME_ANNOUNCEMENT_BANNER, CUSTOM_PAGE_ID, BUILD_ENVS, VERSION_DROPDOWN, @@ -511,6 +513,40 @@ const DevDocTemplate: FC = (props) => { : { height: '0px' } } > + {isPublicSiteOpen && ( + + {HOME_ANNOUNCEMENT_BANNER?.linkHref && + HOME_ANNOUNCEMENT_BANNER?.linkText && ( + + {HOME_ANNOUNCEMENT_BANNER.linkText} + + )} + {(HOME_ANNOUNCEMENT_BANNER?.linkHref && + HOME_ANNOUNCEMENT_BANNER?.linkText) && ' '} + {HOME_ANNOUNCEMENT_BANNER?.message || + (VERSION_DROPDOWN?.[0]?.label + ? `Version ${VERSION_DROPDOWN[0].label} is now available!` + : 'A new version is now available!')} + + } + /> + )}
} diff --git a/src/configs/doc-configs.js b/src/configs/doc-configs.js index 783645484..c6ac6b527 100644 --- a/src/configs/doc-configs.js +++ b/src/configs/doc-configs.js @@ -1,3 +1,5 @@ +const PRE_GA_RELEASE_URL = process.env.GATSBY_PRE_GA_RELEASE_URL; + module.exports = { SITE_URL: 'https://developers.thoughtspot.com/docs', SITE_PREFIX: 'docs', @@ -13,6 +15,16 @@ module.exports = { NOT_FOUND_PAGE_ID: '404-error', HOME_PAGE_ID: 'introduction', NOT_FOUND_GO_HOME_PAGE_ID: 'introduction', + HOME_ANNOUNCEMENT_BANNER: { + enabled: true, + message: + 'is now available. Read about the new features and enhancements.', + // During pre-GA, set GATSBY_PRE_GA_RELEASE_URL to an http(s) URL to override + // the GA link and open in a new tab. + linkHref: PRE_GA_RELEASE_URL || '/docs/whats-new', + linkText: 'Version 26.2.0.cl', + openInNewTab: Boolean(PRE_GA_RELEASE_URL), + }, TYPE_DOC_PREFIX: 'typedoc', DEFAULT_HOST: 'https://try-everywhere.thoughtspot.cloud', DEFAULT_PREVIEW_HOST: 'https://try-everywhere.thoughtspot.cloud/v2', From 789dfc20d912fcaa4aad8fc0330d373a2b68c490 Mon Sep 17 00:00:00 2001 From: ShashiSubramanya Date: Tue, 13 Jan 2026 13:50:35 +0530 Subject: [PATCH 2/4] banner text, pre-release link, and other updates --- src/components/DevDocTemplate/index.tsx | 40 +++++++++++++++++++++++-- src/configs/doc-configs.js | 12 ++++---- 2 files changed, 43 insertions(+), 9 deletions(-) diff --git a/src/components/DevDocTemplate/index.tsx b/src/components/DevDocTemplate/index.tsx index 778e8a010..81fc0acff 100644 --- a/src/components/DevDocTemplate/index.tsx +++ b/src/components/DevDocTemplate/index.tsx @@ -489,6 +489,36 @@ const DevDocTemplate: FC = (props) => { return cName; }; + const getCloudLatestVersion = () => { + const cloudLatest = VERSION_DROPDOWN?.find( + (v) => v?.subLabel && v.subLabel.toLowerCase().includes('cloud (latest)'), + ); + return cloudLatest?.label; + }; + + const extractVersionString = (text: string | undefined | null) => { + if (!text) return undefined; + // Matches versions like 26.2.0.cl or 10.15.0.cl / 10.10.0.sw + const match = text.match(/\b\d+\.\d+\.\d+\.(?:cl|sw)\b/i); + return match?.[0]?.toLowerCase(); + }; + + const shouldShowAnnouncementBanner = () => { + if (!isPublicSiteOpen) return false; + if (!HOME_ANNOUNCEMENT_BANNER?.enabled) return false; + + const cloudLatest = extractVersionString(getCloudLatestVersion()); + const bannerVersion = + extractVersionString(HOME_ANNOUNCEMENT_BANNER?.linkText) || + extractVersionString(HOME_ANNOUNCEMENT_BANNER?.message); + + // Only hide when we can confidently compare and they match. + if (cloudLatest && bannerVersion && cloudLatest === bannerVersion) return false; + return true; + }; + + const isExternalLink = (href?: string) => /^https?:\/\//i.test(href || ''); + return ( <> @@ -513,7 +543,7 @@ const DevDocTemplate: FC = (props) => { : { height: '0px' } } > - {isPublicSiteOpen && ( + {shouldShowAnnouncementBanner() && ( = (props) => { className="announcementBanner__link" href={HOME_ANNOUNCEMENT_BANNER.linkHref} target={ - HOME_ANNOUNCEMENT_BANNER?.openInNewTab + isExternalLink( + HOME_ANNOUNCEMENT_BANNER.linkHref, + ) ? '_blank' : undefined } rel={ - HOME_ANNOUNCEMENT_BANNER?.openInNewTab + isExternalLink( + HOME_ANNOUNCEMENT_BANNER.linkHref, + ) ? 'noreferrer' : undefined } diff --git a/src/configs/doc-configs.js b/src/configs/doc-configs.js index c6ac6b527..8557baf6c 100644 --- a/src/configs/doc-configs.js +++ b/src/configs/doc-configs.js @@ -1,5 +1,3 @@ -const PRE_GA_RELEASE_URL = process.env.GATSBY_PRE_GA_RELEASE_URL; - module.exports = { SITE_URL: 'https://developers.thoughtspot.com/docs', SITE_PREFIX: 'docs', @@ -19,11 +17,13 @@ module.exports = { enabled: true, message: 'is now available. Read about the new features and enhancements.', - // During pre-GA, set GATSBY_PRE_GA_RELEASE_URL to an http(s) URL to override - // the GA link and open in a new tab. - linkHref: PRE_GA_RELEASE_URL || '/docs/whats-new', + // Swap this between: + // - Pre-GA: release-specific URL (full http(s) URL), ex: + // 'https://developers.thoughtspot.com/docs/26.2.0.cl?pageid=introduction' + // - GA: ' /docs/whats-new' + //linkHref: '/docs/whats-new', + linkHref: 'https://developers.thoughtspot.com/docs/26.2.0.cl?pageid=whats-new', linkText: 'Version 26.2.0.cl', - openInNewTab: Boolean(PRE_GA_RELEASE_URL), }, TYPE_DOC_PREFIX: 'typedoc', DEFAULT_HOST: 'https://try-everywhere.thoughtspot.cloud', From d10a1ef684f09977645761cf9f5cdf0cf0463e85 Mon Sep 17 00:00:00 2001 From: ShashiSubramanya Date: Mon, 2 Feb 2026 16:50:43 +0530 Subject: [PATCH 3/4] banner text --- src/configs/doc-configs.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/configs/doc-configs.js b/src/configs/doc-configs.js index 8557baf6c..3bd758b35 100644 --- a/src/configs/doc-configs.js +++ b/src/configs/doc-configs.js @@ -22,7 +22,7 @@ module.exports = { // 'https://developers.thoughtspot.com/docs/26.2.0.cl?pageid=introduction' // - GA: ' /docs/whats-new' //linkHref: '/docs/whats-new', - linkHref: 'https://developers.thoughtspot.com/docs/26.2.0.cl?pageid=whats-new', + linkHref: '/docs/26.2.0.cl?pageid=whats-new', linkText: 'Version 26.2.0.cl', }, TYPE_DOC_PREFIX: 'typedoc', @@ -75,7 +75,12 @@ module.exports = { subLabel: 'Software', iframeUrl: 'https://visual-embed-sdk-10-1.vercel.app/docs/', }, - + { + label: '26.2.0.cl', + link: '26.2.0.cl', + subLabel: 'Coming soon', + iframeUrl: 'https://developer-docs-26-2-0-cl.vercel.app/docs/', + }, ], CUSTOM_PAGE_ID: { API_PLAYGROUND: 'restV2-playground', From a79f5a473358ada8ad4f58c0275d35ea918f5334 Mon Sep 17 00:00:00 2001 From: ShashiSubramanya Date: Mon, 2 Feb 2026 22:23:07 +0530 Subject: [PATCH 4/4] banner link fix --- src/configs/doc-configs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/configs/doc-configs.js b/src/configs/doc-configs.js index 3bd758b35..fddb5524d 100644 --- a/src/configs/doc-configs.js +++ b/src/configs/doc-configs.js @@ -19,7 +19,7 @@ module.exports = { 'is now available. Read about the new features and enhancements.', // Swap this between: // - Pre-GA: release-specific URL (full http(s) URL), ex: - // 'https://developers.thoughtspot.com/docs/26.2.0.cl?pageid=introduction' + // 'https://developers.thoughtspot.com/docs/26.2.0.cl?pageid=whats-new' // - GA: ' /docs/whats-new' //linkHref: '/docs/whats-new', linkHref: '/docs/26.2.0.cl?pageid=whats-new',