From 1bce4cc998952ca29ede4a875ca794d9e86e13fb Mon Sep 17 00:00:00 2001 From: Harsh23Kashyap <55448981+Harsh23Kashyap@users.noreply.github.com> Date: Fri, 31 Jul 2026 19:02:32 +0530 Subject: [PATCH 1/2] fix(web): hide upgrade prompts from non-owner users in the sidebar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "Upgrade to Pro" button in the sidebar footer and the per-item "Upgrade" badges in the default and settings sidebars were rendered to any signed-in user, not just to the org's OWNER. A MEMBER (or a former owner who lost the role) would see prompts they cannot act on. The settings pages already gate on OWNER via authenticatedPage, so the upsell cards inside /settings/security and /settings/audit were unaffected — only the shared sidebar was missing the check. Fix: thread an isOwner prop from the sidebar index files through the Nav and SidebarBase components. defaultSidebar/index.tsx already computed isOwner for the connection-stats notification dot; settingsSidebar/index.tsx now does the same. Both UpgradeBadge rendering in the Nav components and UpgradeButton rendering in SidebarBase are gated on isOwner. Issue #1524. --- CHANGELOG.md | 3 + .../components/defaultSidebar/index.tsx | 2 + .../components/defaultSidebar/nav.test.tsx | 98 +++++++++++++++++++ .../components/defaultSidebar/nav.tsx | 10 +- .../components/settingsSidebar/index.tsx | 11 ++- .../components/settingsSidebar/nav.tsx | 9 +- .../(app)/@sidebar/components/sidebarBase.tsx | 11 ++- 7 files changed, 139 insertions(+), 5 deletions(-) create mode 100644 packages/web/src/app/(app)/@sidebar/components/defaultSidebar/nav.test.tsx diff --git a/CHANGELOG.md b/CHANGELOG.md index e358b71e0..6030dafdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed +- The "Upgrade to Pro" button in the sidebar footer and the per-item "Upgrade" badges in the default and settings sidebars are now hidden for users who are not an OWNER in the org, since those prompts are only meaningful for the billing decision-maker. [#1524](https://github.com/sourcebot-dev/sourcebot/pull/1524) + ## [5.1.5] - 2026-07-31 ### Fixed diff --git a/packages/web/src/app/(app)/@sidebar/components/defaultSidebar/index.tsx b/packages/web/src/app/(app)/@sidebar/components/defaultSidebar/index.tsx index a0ccd6269..724fe59a0 100644 --- a/packages/web/src/app/(app)/@sidebar/components/defaultSidebar/index.tsx +++ b/packages/web/src/app/(app)/@sidebar/components/defaultSidebar/index.tsx @@ -59,11 +59,13 @@ export async function DefaultSidebar() { collapsible="icon" isValidLicenseActive={licenseActive} isAskGhEnabled={env.EXPERIMENT_ASK_GH_ENABLED === 'true'} + isOwner={isOwner} headerContent={