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
This commit is contained in:
4 files changed
+20
-13
No files matched your search
@@ -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<WelcomeSectionProps> = ({
|
||||
showAnnouncement,
|
||||
hideAnnouncement,
|
||||
showHistoryView,
|
||||
telemetrySetting,
|
||||
version,
|
||||
taskHistory,
|
||||
shouldShowQuickWins,
|
||||
@@ -29,7 +29,9 @@ export const WelcomeSection: React.FC<WelcomeSectionProps> = ({
|
||||
|
||||
// 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 (
|
||||
<div className="flex flex-col flex-1 w-full h-full p-0 m-0">
|
||||
|
||||
@@ -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 = () => {
|
||||
}}>
|
||||
<h4 className="m-0 flex items-center gap-2" style={{ paddingRight: "24px" }}>
|
||||
<Terminal className="w-4 h-4" />
|
||||
{isMacOSOrLinux ? "Cline for CLI is here!" : "Cline CLI Information"}
|
||||
{isMacOSOrLinux() ? "Cline for CLI is here!" : "Cline CLI Information"}
|
||||
</h4>
|
||||
<p className="m-0">
|
||||
{isMacOSOrLinux ? (
|
||||
{isMacOSOrLinux() ? (
|
||||
<>
|
||||
Install to use Cline directly in your terminal and enable subagent capabilities. Cline can spawn{" "}
|
||||
<code>cline</code> commands to handle focused tasks like exploring large codebases for information. This
|
||||
@@ -148,7 +147,7 @@ export const CliInstallBanner: React.FC = () => {
|
||||
<span className={`codicon ${isCopied ? "codicon-check" : "codicon-copy"}`}></span>
|
||||
</VSCodeButton>
|
||||
</div>
|
||||
{isMacOSOrLinux ? (
|
||||
{isMacOSOrLinux() ? (
|
||||
<div className="flex gap-2">
|
||||
<VSCodeButton
|
||||
appearance="primary"
|
||||
|
||||
@@ -9,6 +9,7 @@ import McpDisplayModeDropdown from "@/components/mcp/chat-display/McpDisplayMode
|
||||
import { PLATFORM_CONFIG, PlatformType } from "@/config/platform.config"
|
||||
import { useExtensionState } from "@/context/ExtensionStateContext"
|
||||
import { StateServiceClient } from "@/services/grpc-client"
|
||||
import { isMacOSOrLinux } from "@/utils/platformUtils"
|
||||
import Section from "../Section"
|
||||
import SubagentOutputLineLimitSlider from "../SubagentOutputLineLimitSlider"
|
||||
import { updateSetting } from "../utils/settingsHandlers"
|
||||
@@ -33,11 +34,8 @@ const FeatureSettingsSection = ({ renderSectionHeader }: FeatureSettingsSectionP
|
||||
hooksEnabled,
|
||||
remoteConfigSettings,
|
||||
subagentsEnabled,
|
||||
platform,
|
||||
} = useExtensionState()
|
||||
|
||||
const isMacOSOrLinux = platform === "darwin" || platform === "linux"
|
||||
|
||||
const [isClineCliInstalled, setIsClineCliInstalled] = useState(false)
|
||||
|
||||
const handleReasoningEffortChange = (newValue: OpenaiReasoningEffort) => {
|
||||
@@ -71,8 +69,7 @@ const FeatureSettingsSection = ({ renderSectionHeader }: FeatureSettingsSectionP
|
||||
<Section>
|
||||
<div style={{ marginBottom: 20 }}>
|
||||
{/* Subagents - Only show on macOS and Linux */}
|
||||
{isMacOSOrLinux && PLATFORM_CONFIG.type === PlatformType.VSCODE && (
|
||||
|
||||
{isMacOSOrLinux() && PLATFORM_CONFIG.type === PlatformType.VSCODE && (
|
||||
<div
|
||||
className="relative p-3 mb-3 rounded-md"
|
||||
id="subagents-section"
|
||||
|
||||
@@ -40,3 +40,12 @@ const userAgent = navigator?.userAgent || ""
|
||||
export const isChrome = userAgent.indexOf("Chrome") >= 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
|
||||
}
|
||||
Reference in new issue
Block a user