From c5f12b8dc650e8a5fc73b97838254cfac970eb13 Mon Sep 17 00:00:00 2001 From: Ara Date: Fri, 17 Oct 2025 11:36:54 -0700 Subject: [PATCH] Fixing banner to not show CLI release for windows users (#6942) * Fixing banner to not show CLI release for windows users * Fixing banner * Fixing banner --- .../chat-view/components/layout/WelcomeSection.tsx | 6 ++++-- webview-ui/src/components/common/CliInstallBanner.tsx | 11 +++++------ .../settings/sections/FeatureSettingsSection.tsx | 7 ++----- webview-ui/src/utils/platformUtils.ts | 9 +++++++++ 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/webview-ui/src/components/chat/chat-view/components/layout/WelcomeSection.tsx b/webview-ui/src/components/chat/chat-view/components/layout/WelcomeSection.tsx index 7f73fe73..92eb11af 100644 --- a/webview-ui/src/components/chat/chat-view/components/layout/WelcomeSection.tsx +++ b/webview-ui/src/components/chat/chat-view/components/layout/WelcomeSection.tsx @@ -7,6 +7,7 @@ import HomeHeader from "@/components/welcome/HomeHeader" import { SuggestedTasks } from "@/components/welcome/SuggestedTasks" import { PLATFORM_CONFIG, PlatformType } from "@/config/platform.config" import { useExtensionState } from "@/context/ExtensionStateContext" +import { isMacOSOrLinux } from "@/utils/platformUtils" import { WelcomeSectionProps } from "../../types/chatTypes" /** @@ -17,7 +18,6 @@ export const WelcomeSection: React.FC = ({ showAnnouncement, hideAnnouncement, showHistoryView, - telemetrySetting, version, taskHistory, shouldShowQuickWins, @@ -29,7 +29,9 @@ export const WelcomeSection: React.FC = ({ // Show CLI banner if not dismissed and platform is VSCode (not JetBrains/standalone) const shouldShowCliBanner = - PLATFORM_CONFIG.type === PlatformType.VSCODE && lastDismissedCliBannerVersion < CURRENT_CLI_BANNER_VERSION + isMacOSOrLinux() && + PLATFORM_CONFIG.type === PlatformType.VSCODE && + lastDismissedCliBannerVersion < CURRENT_CLI_BANNER_VERSION return (
diff --git a/webview-ui/src/components/common/CliInstallBanner.tsx b/webview-ui/src/components/common/CliInstallBanner.tsx index afdb16e1..32024c99 100644 --- a/webview-ui/src/components/common/CliInstallBanner.tsx +++ b/webview-ui/src/components/common/CliInstallBanner.tsx @@ -5,17 +5,16 @@ import { Terminal } from "lucide-react" import { useCallback, useEffect, useState } from "react" import { useExtensionState } from "@/context/ExtensionStateContext" import { StateServiceClient, UiServiceClient } from "@/services/grpc-client" +import { isMacOSOrLinux } from "@/utils/platformUtils" import { getAsVar, VSC_INACTIVE_SELECTION_BACKGROUND } from "@/utils/vscStyles" export const CURRENT_CLI_BANNER_VERSION = 1 export const CliInstallBanner: React.FC = () => { - const { navigateToSettings, subagentsEnabled, platform } = useExtensionState() + const { navigateToSettings, subagentsEnabled } = useExtensionState() const [isCopied, setIsCopied] = useState(false) const [isClineCliInstalled, setIsClineCliInstalled] = useState(false) - const isMacOSOrLinux = platform === "darwin" || platform === "linux" - // Poll for CLI installation status while the component is mounted useEffect(() => { const checkInstallation = async () => { @@ -102,10 +101,10 @@ export const CliInstallBanner: React.FC = () => { }}>

- {isMacOSOrLinux ? "Cline for CLI is here!" : "Cline CLI Information"} + {isMacOSOrLinux() ? "Cline for CLI is here!" : "Cline CLI Information"}

- {isMacOSOrLinux ? ( + {isMacOSOrLinux() ? ( <> Install to use Cline directly in your terminal and enable subagent capabilities. Cline can spawn{" "} cline commands to handle focused tasks like exploring large codebases for information. This @@ -148,7 +147,7 @@ export const CliInstallBanner: React.FC = () => {

- {isMacOSOrLinux ? ( + {isMacOSOrLinux() ? (
{ @@ -71,8 +69,7 @@ const FeatureSettingsSection = ({ renderSectionHeader }: FeatureSettingsSectionP
{/* Subagents - Only show on macOS and Linux */} - {isMacOSOrLinux && PLATFORM_CONFIG.type === PlatformType.VSCODE && ( - + {isMacOSOrLinux() && PLATFORM_CONFIG.type === PlatformType.VSCODE && (
= 0 export const isSafari = !isChrome && userAgent.indexOf("Safari") >= 0 + +/** + * Checks if the platform is macOS or Linux + * @returns true if platform is darwin (macOS) or linux + */ +export const isMacOSOrLinux = (): boolean => { + const platform = process?.platform + return !platform?.startsWith("win") // Non-Windows +}