From 698d4c1c82f89e722aa5338eb96c5762f0f4f6ad Mon Sep 17 00:00:00 2001 From: RockChinQ Date: Mon, 8 Jun 2026 12:56:54 -0400 Subject: [PATCH] feat(web): hide sidebar new-version prompt for edition=cloud Cloud instances are upgraded centrally by the operator, so surfacing a GitHub 'new version available' badge to tenants is misleading and actionable only by the operator. Skip the release check entirely when edition=cloud. --- .../components/home-sidebar/HomeSidebar.tsx | 39 +++++++++++-------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/web/src/app/home/components/home-sidebar/HomeSidebar.tsx b/web/src/app/home/components/home-sidebar/HomeSidebar.tsx index e0cc8ab9..2eff56cf 100644 --- a/web/src/app/home/components/home-sidebar/HomeSidebar.tsx +++ b/web/src/app/home/components/home-sidebar/HomeSidebar.tsx @@ -1674,24 +1674,31 @@ export default function HomeSidebar({ .catch(() => {}); } - getCloudServiceClientSync() - .getLangBotReleases() - .then((releases) => { - if (releases && releases.length > 0) { - const latestStable = releases.find((r) => !r.prerelease && !r.draft); - const latest = latestStable || releases[0]; - setLatestRelease(latest); + // Cloud edition is updated centrally by the operator, so end users should + // not see a "new version available" prompt in the sidebar. Skip the GitHub + // release check entirely for edition=cloud. + if (systemInfo?.edition !== 'cloud') { + getCloudServiceClientSync() + .getLangBotReleases() + .then((releases) => { + if (releases && releases.length > 0) { + const latestStable = releases.find( + (r) => !r.prerelease && !r.draft, + ); + const latest = latestStable || releases[0]; + setLatestRelease(latest); - const currentVersion = systemInfo?.version; - if (currentVersion && latest.tag_name) { - const isNewer = compareVersions(latest.tag_name, currentVersion); - setHasNewVersion(isNewer); + const currentVersion = systemInfo?.version; + if (currentVersion && latest.tag_name) { + const isNewer = compareVersions(latest.tag_name, currentVersion); + setHasNewVersion(isNewer); + } } - } - }) - .catch((error) => { - console.error('Failed to fetch releases:', error); - }); + }) + .catch((error) => { + console.error('Failed to fetch releases:', error); + }); + } getCloudServiceClientSync() .getGitHubRepoInfo()