|
|
@@ -1,41 +1,41 @@
|
|
|
-import { Int64Request } from "@shared/proto/cline/common"
|
|
|
import { VSCodeButton } from "@vscode/webview-ui-toolkit/react"
|
|
|
import { useCallback } from "react"
|
|
|
+import { PlatformType } from "@/config/platform.config"
|
|
|
+import { usePlatform } from "@/context/PlatformContext"
|
|
|
import { StateServiceClient } from "@/services/grpc-client"
|
|
|
export const CURRENT_INFO_BANNER_VERSION = 1
|
|
|
export const InfoBanner: React.FC = () => {
|
|
|
const handleClose = useCallback((e: React.MouseEvent) => {
|
|
|
e.preventDefault()
|
|
|
e.stopPropagation()
|
|
|
- const request = Int64Request.create({
|
|
|
- value: CURRENT_INFO_BANNER_VERSION,
|
|
|
- })
|
|
|
- StateServiceClient.updateInfoBannerVersion(request).catch(console.error)
|
|
|
+ StateServiceClient.updateInfoBannerVersion({ value: CURRENT_INFO_BANNER_VERSION }).catch(console.error)
|
|
|
}, [])
|
|
|
+ if (usePlatform().type === PlatformType.VSCODE) {
|
|
|
+ return (
|
|
|
+ <a
|
|
|
+ className="bg-banner-background px-3 py-2 flex flex-col gap-1 shrink-0 mb-1 relative text-sm m-4 no-underline transition-colors hover:brightness-120"
|
|
|
+ href="https://docs.cline.bot/features/customization/opening-cline-in-sidebar"
|
|
|
+ rel="noopener noreferrer"
|
|
|
+ style={{ color: "var(--vscode-foreground)" }}
|
|
|
+ target="_blank">
|
|
|
+ <h3 className="m-0">💡 Cline in the Right Sidebar</h3>
|
|
|
+ <p className="m-0">
|
|
|
+ Keep your files visible when chatting with Cline. Drag the Cline icon to the right sidebar panel for a better
|
|
|
+ experience. <span className="text-link cursor-pointer">See how →</span>
|
|
|
+ </p>
|
|
|
|
|
|
- return (
|
|
|
- <a
|
|
|
- className="bg-banner-background px-3 py-2 flex flex-col gap-1 shrink-0 mb-1 relative text-sm m-4 no-underline transition-colors hover:brightness-120"
|
|
|
- href="https://docs.cline.bot/features/customization/opening-cline-in-sidebar"
|
|
|
- rel="noopener noreferrer"
|
|
|
- style={{ color: "var(--vscode-foreground)" }}
|
|
|
- target="_blank">
|
|
|
- <h3 className="m-0">💡 Cline in the Right Sidebar</h3>
|
|
|
- <p className="m-0">
|
|
|
- Keep your files visible when chatting with Cline. Drag the Cline icon to the right sidebar panel for a better
|
|
|
- experience. <span className="text-link cursor-pointer">See how →</span>
|
|
|
- </p>
|
|
|
-
|
|
|
- {/* Close button */}
|
|
|
- <VSCodeButton
|
|
|
- appearance="icon"
|
|
|
- data-testid="info-banner-close-button"
|
|
|
- onClick={handleClose}
|
|
|
- style={{ position: "absolute", top: "8px", right: "8px" }}>
|
|
|
- <span className="codicon codicon-close"></span>
|
|
|
- </VSCodeButton>
|
|
|
- </a>
|
|
|
- )
|
|
|
+ {/* Close button */}
|
|
|
+ <VSCodeButton
|
|
|
+ appearance="icon"
|
|
|
+ data-testid="info-banner-close-button"
|
|
|
+ onClick={handleClose}
|
|
|
+ style={{ position: "absolute", top: "8px", right: "8px" }}>
|
|
|
+ <span className="codicon codicon-close"></span>
|
|
|
+ </VSCodeButton>
|
|
|
+ </a>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ return null
|
|
|
}
|
|
|
|
|
|
export default InfoBanner
|