feat: welcome screen ui enhancements (#7878)

* feat: Announcement Cards, Recent Tasks Refresh, Whats new modal

* feat: adjustments to welcome modal functionality

* chore: add changeset for welcome ui enhancements

* refactor: replace inline styles with Tailwind classes where appropriate

* fix: removed close mechanisim for cards fix modal linking issue

* feat: suggested changes

* fix: arias for accessibility

* fix: test modal fix

* feat: e2e test fix

* update e2e tests with new welcome ui

* feat: small arias change

---------

Co-authored-by: abeatrix <beatrix@cline.bot>
This commit is contained in:
Jose R. Perezandabeatrix authored and GitHub committed 2025-12-07 20:32:42 -08:00
1 parent 4b212994a8
commit 921dd2ec8c
13 files changed
+757 -138

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"claude-dev": patch
---
Welcome screen ui enhancements
+32 -8
View File
@@ -42,18 +42,42 @@ e2e("Views - can set up API keys and navigate to Settings from Chat", async ({ s
await expect(apiKeyInput).not.toBeVisible()
await expect(providerSelectorInput).not.toBeVisible()
// Verify you are now in the chat page after setup was completed
// Verify the "What's New" modal is visible for new installs and can be closed.
const dialog = sidebar.getByRole("heading", {
name: /^🎉 New in v\d/,
})
await expect(dialog).toBeVisible()
await sidebar.getByRole("button", { name: "Close" }).click()
await expect(dialog).not.toBeVisible()
// Verify you are now in the chat page after setup was completed and the dialog was closed.
// cline logo has the name "clline-logo"
const clineLogo = sidebar.locator(".size-20 > path")
await expect(clineLogo).toBeVisible()
const chatInputBox = sidebar.getByTestId("chat-input")
await expect(chatInputBox).toBeVisible()
// Verify the release banner is visible for new installs and can be closed.
const releaseBanner = sidebar.getByRole("heading", {
name: /^🎉 New in v\d/,
})
await expect(releaseBanner).toBeVisible()
await sidebar.getByTestId("close-announcement-button").click()
await expect(releaseBanner).not.toBeVisible()
// Verify What's New Section is showing and starts with first banner,
// and the navigation buttons work
await expect(sidebar.locator(".fade-in-cards")).toBeVisible()
await expect(
sidebar
.locator("div")
.filter({ hasText: /^1\/3$/ })
.first(),
).toBeVisible()
await sidebar.getByRole("button", { name: "Next banner" }).click()
await expect(
sidebar
.locator("div")
.filter({ hasText: /^2\/3$/ })
.first(),
).toBeVisible()
await sidebar.getByRole("button", { name: "Previous banner" }).click()
await expect(
sidebar
.locator("div")
.filter({ hasText: /^1\/3$/ })
.first(),
).toBeVisible()
})
+2 -6
View File
@@ -1,15 +1,12 @@
import { expect } from "@playwright/test"
import { cleanChatView } from "./utils/common"
import { E2E_WORKSPACE_TYPES, e2e } from "./utils/helpers"
e2e.describe("Diff Editor", () => {
E2E_WORKSPACE_TYPES.forEach(({ title, workspaceType }) => {
e2e.extend({
workspaceType,
})(title, async ({ page, sidebar }) => {
await sidebar.getByRole("button", { name: "Login to Cline" }).click({ delay: 100 })
// Submit a message
await cleanChatView(page)
})(title, async ({ helper, page, sidebar }) => {
await helper.signin(sidebar)
const inputbox = sidebar.getByTestId("chat-input")
await expect(inputbox).toBeVisible()
@@ -26,7 +23,6 @@ e2e.describe("Diff Editor", () => {
await sidebar.getByRole("button", { name: "Start New Task" }).click()
await expect(sidebar.getByText("Recent Tasks")).toBeVisible()
await expect(sidebar.getByText("Hello, Cline!")).toBeVisible() // History with the previous sent message
await expect(sidebar.getByText("Tokens:")).toBeVisible() // History with token usage
// Submit a file edit request
await sidebar.getByTestId("chat-input").click()
+2 -2
View File
@@ -6,8 +6,8 @@ e2e.describe("Code Actions and Editor Panel", () => {
E2E_WORKSPACE_TYPES.forEach(({ title, workspaceType }) => {
e2e.extend({
workspaceType,
})(title, async ({ page, sidebar }) => {
await sidebar.getByRole("button", { name: "Login to Cline" }).click({ delay: 100 })
})(title, async ({ helper, page, sidebar }) => {
await helper.signin(sidebar)
// Sidebar - input should start empty
const sidebarInput = sidebar.getByTestId("chat-input")
await sidebarInput.click()
-1
View File
@@ -151,7 +151,6 @@ export class ClineApiServerMock {
}
const sendApiError = (error: string, status = 400) => {
console.error("API Error: %s", error, status)
sendJson({ success: false, error }, status)
}
-22
View File
@@ -34,25 +34,3 @@ export const toggleNotifications = async (_page: Page) => {
await _page.keyboard.press("Enter")
return _page
}
export async function cleanChatView(sidebar: Page): Promise<Page> {
const signUpBtn = sidebar.getByRole("button", { name: "Login to Cline" })
if (await signUpBtn.isVisible()) {
await signUpBtn.click({ delay: 50 })
}
// Verify the help improve banner is visible and can be closed.
const helpBanner = sidebar.getByText("Help Improve Cline")
if (await helpBanner.isVisible()) {
await sidebar.getByRole("button", { name: "Close banner and enable" }).click()
}
// Verify the release banner is visible for new installs and can be closed.
const releaseBanner = sidebar.getByRole("heading", {
name: /^🎉 New in v\d/,
})
if (await releaseBanner.isVisible()) {
await sidebar.getByTestId("close-button").locator("span").first().click()
}
return sidebar
}
+2
View File
@@ -122,6 +122,8 @@ export class E2ETestHelper {
// Verify start up page is no longer visible
await expect(webview.getByRole("button", { name: "Login to Cline" })).not.toBeVisible()
await webview.getByRole("button", { name: "Close" }).click({ delay: 50 })
}
public static async openClineSidebar(page: Page): Promise<void> {
@@ -1,13 +1,20 @@
import React from "react"
import Announcement from "@/components/chat/Announcement"
import CliInstallBanner, { CURRENT_CLI_BANNER_VERSION } from "@/components/common/CliInstallBanner"
import InfoBanner, { CURRENT_INFO_BANNER_VERSION } from "@/components/common/InfoBanner"
import NewModelBanner, { CURRENT_MODEL_BANNER_VERSION } from "@/components/common/NewModelBanner"
import { EmptyRequest } from "@shared/proto/index.cline"
import { VSCodeLink } from "@vscode/webview-ui-toolkit/react"
import { Megaphone, Terminal } from "lucide-react"
import React, { useCallback, useEffect, useMemo, useState } from "react"
import BannerCarousel, { BannerData } from "@/components/common/BannerCarousel"
import { CURRENT_CLI_BANNER_VERSION } from "@/components/common/CliInstallBanner"
import { CURRENT_INFO_BANNER_VERSION } from "@/components/common/InfoBanner"
import { CURRENT_MODEL_BANNER_VERSION } from "@/components/common/NewModelBanner"
import WhatsNewModal from "@/components/common/WhatsNewModal"
import HistoryPreview from "@/components/history/HistoryPreview"
import { useApiConfigurationHandlers } from "@/components/settings/utils/useApiConfigurationHandlers"
import HomeHeader from "@/components/welcome/HomeHeader"
import { SuggestedTasks } from "@/components/welcome/SuggestedTasks"
import { PLATFORM_CONFIG, PlatformType } from "@/config/platform.config"
import { useClineAuth } from "@/context/ClineAuthContext"
import { useExtensionState } from "@/context/ExtensionStateContext"
import { AccountServiceClient, StateServiceClient } from "@/services/grpc-client"
import { isMacOSOrLinux } from "@/utils/platformUtils"
import { WelcomeSectionProps } from "../../types/chatTypes"
@@ -25,6 +32,10 @@ export const WelcomeSection: React.FC<WelcomeSectionProps> = ({
}) => {
const { lastDismissedInfoBannerVersion, lastDismissedCliBannerVersion, lastDismissedModelBannerVersion } = useExtensionState()
// Track if we've shown the "What's New" modal this session
const [hasShownWhatsNewModal, setHasShownWhatsNewModal] = useState(false)
const [showWhatsNewModal, setShowWhatsNewModal] = useState(false)
const shouldShowInfoBanner = lastDismissedInfoBannerVersion < CURRENT_INFO_BANNER_VERSION
const shouldShowNewModelBanner = lastDismissedModelBannerVersion < CURRENT_MODEL_BANNER_VERSION
@@ -34,15 +45,186 @@ export const WelcomeSection: React.FC<WelcomeSectionProps> = ({
PLATFORM_CONFIG.type === PlatformType.VSCODE &&
lastDismissedCliBannerVersion < CURRENT_CLI_BANNER_VERSION
const { clineUser } = useClineAuth()
const { openRouterModels, setShowChatModelSelector, navigateToSettings, subagentsEnabled } = useExtensionState()
const { handleFieldsChange } = useApiConfigurationHandlers()
// Show modal when there's a new announcement and we haven't shown it this session
useEffect(() => {
if (showAnnouncement && !hasShownWhatsNewModal) {
setShowWhatsNewModal(true)
setHasShownWhatsNewModal(true)
}
}, [showAnnouncement, hasShownWhatsNewModal])
const handleCloseWhatsNewModal = useCallback(() => {
setShowWhatsNewModal(false)
// Call hideAnnouncement to persist dismissal (same as old banner behavior)
hideAnnouncement()
}, [hideAnnouncement])
// Build array of active banners for carousel
const activeBanners = useMemo((): BannerData[] => {
const banners: BannerData[] = []
if (shouldShowInfoBanner) {
banners.push({
id: "info-banner",
icon: <span>💡</span>,
title: "Use Cline in Right Sidebar",
description: (
<>
For the best experience, drag the Cline icon to your right sidebar. This keeps your file explorer and
editor visible while you chat with Cline, making it easier to navigate your codebase and see changes in
real-time.{" "}
<VSCodeLink
className="cursor-pointer"
href="https://docs.cline.bot/features/customization/opening-cline-in-sidebar"
style={{ display: "inline" }}>
See how →
</VSCodeLink>
</>
),
})
}
if (shouldShowNewModelBanner) {
const setNewModel = () => {
const modelId = "anthropic/claude-opus-4.5"
handleFieldsChange({
planModeOpenRouterModelId: modelId,
actModeOpenRouterModelId: modelId,
planModeOpenRouterModelInfo: openRouterModels[modelId],
actModeOpenRouterModelInfo: openRouterModels[modelId],
planModeApiProvider: "cline",
actModeApiProvider: "cline",
})
setTimeout(() => setShowChatModelSelector(true), 10)
}
const handleShowAccount = () => {
AccountServiceClient.accountLoginClicked(EmptyRequest.create()).catch((err) =>
console.error("Failed to get login URL:", err),
)
}
banners.push({
id: "new-model",
icon: <Megaphone className="w-5 h-5" />,
title: "Claude Opus 4.5 Now Available",
description: "State-of-the-art performance at 3x lower cost than Opus 4.1. Available now in the Cline provider.",
actions: [
{
label: clineUser ? "Try Now" : "Get Started",
onClick: clineUser ? setNewModel : handleShowAccount,
variant: "primary",
},
],
})
}
if (shouldShowCliBanner) {
const handleInstallCli = async () => {
try {
await StateServiceClient.installClineCli(EmptyRequest.create())
} catch (error) {
console.error("Failed to initiate CLI installation:", error)
}
}
const handleEnableSubagents = () => {
if (!subagentsEnabled) {
navigateToSettings("features")
}
}
banners.push({
id: "cli-install",
icon: <Terminal className="w-5 h-5" />,
title: isMacOSOrLinux() ? "CLI & Subagents Available" : "Cline CLI Info",
description: isMacOSOrLinux() ? (
<>
Use Cline in your terminal and enable subagent capabilities.{" "}
<VSCodeLink href="https://docs.cline.bot/cline-cli/overview" style={{ display: "inline" }}>
Learn more
</VSCodeLink>
</>
) : (
<>
Available for macOS and Linux. Coming soon to other platforms.{" "}
<VSCodeLink href="https://docs.cline.bot/cline-cli/overview" style={{ display: "inline" }}>
Learn more
</VSCodeLink>
</>
),
actions: isMacOSOrLinux()
? [
{ label: "Install", onClick: handleInstallCli, variant: "primary" },
{
label: "Enable Subagents",
onClick: handleEnableSubagents,
variant: "primary",
disabled: subagentsEnabled,
},
]
: [
{ label: "Install CLI", onClick: handleInstallCli, variant: "primary" },
{ label: "Subagents (Windows coming soon)", onClick: () => {}, variant: "secondary", disabled: true },
],
})
}
return banners
}, [
shouldShowInfoBanner,
shouldShowNewModelBanner,
shouldShowCliBanner,
clineUser,
openRouterModels,
setShowChatModelSelector,
handleFieldsChange,
navigateToSettings,
subagentsEnabled,
])
return (
<div className="flex flex-col flex-1 w-full h-full p-0 m-0">
<style>
{`
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.fade-in-cards {
animation: fadeIn 0.4s ease-out forwards;
}
.fade-in-history {
animation: fadeIn 0.4s ease-out 0.2s forwards;
opacity: 0;
}
`}
</style>
<WhatsNewModal onClose={handleCloseWhatsNewModal} open={showWhatsNewModal} version={version} />
<div className="overflow-y-auto flex flex-col pb-2.5">
{shouldShowInfoBanner && <InfoBanner />}
{showAnnouncement && <Announcement hideAnnouncement={hideAnnouncement} version={version} />}
{shouldShowNewModelBanner && <NewModelBanner />}
{shouldShowCliBanner && <CliInstallBanner />}
<HomeHeader shouldShowQuickWins={shouldShowQuickWins} />
{!shouldShowQuickWins && taskHistory.length > 0 && <HistoryPreview showHistoryView={showHistoryView} />}
{!showWhatsNewModal && (
<>
<div className="fade-in-cards">
<BannerCarousel banners={activeBanners} />
</div>
{!shouldShowQuickWins && taskHistory.length > 0 && (
<div className="fade-in-history">
<HistoryPreview showHistoryView={showHistoryView} />
</div>
)}
</>
)}
</div>
<SuggestedTasks shouldShowQuickWins={shouldShowQuickWins} />
</div>
@@ -0,0 +1,187 @@
import { ChevronLeft, ChevronRight } from "lucide-react"
import React, { useState } from "react"
import { Button } from "@/components/ui/button"
interface BannerAction {
label: string
onClick: () => void
variant?: "primary" | "secondary"
disabled?: boolean
}
export interface BannerData {
id: string
icon?: React.ReactNode
title: string
description: string | React.ReactNode
actions?: BannerAction[]
}
interface BannerCarouselProps {
banners: BannerData[]
}
export const BannerCarousel: React.FC<BannerCarouselProps> = ({ banners }) => {
const [currentIndex, setCurrentIndex] = useState(0)
const [isPaused, setIsPaused] = useState(false)
const [isTransitioning, setIsTransitioning] = useState(false)
const autoPlayIntervalRef = React.useRef<NodeJS.Timeout | null>(null)
if (banners.length === 0) {
return null
}
const transitionToIndex = (newIndex: number) => {
setIsTransitioning(true)
setTimeout(() => {
setCurrentIndex(newIndex)
setIsTransitioning(false)
}, 200) // Match half of transition duration
}
const handlePrevious = () => {
const newIndex = currentIndex === 0 ? banners.length - 1 : currentIndex - 1
transitionToIndex(newIndex)
setIsPaused(true) // Pause auto-rotation when user manually navigates
}
const handleNext = () => {
const newIndex = currentIndex === banners.length - 1 ? 0 : currentIndex + 1
transitionToIndex(newIndex)
setIsPaused(true) // Pause auto-rotation when user manually navigates
}
// Reset currentIndex when banners change to prevent out-of-bounds access
React.useEffect(() => {
if (currentIndex >= banners.length && banners.length > 0) {
setCurrentIndex(0)
}
}, [banners.length, currentIndex])
// Auto-rotation effect
React.useEffect(() => {
// Only auto-rotate if there's more than one banner and not paused
if (banners.length <= 1 || isPaused) {
return
}
autoPlayIntervalRef.current = setInterval(() => {
const newIndex = (currentIndex + 1) % banners.length
transitionToIndex(newIndex)
}, 5000) // Rotate every 5 seconds
return () => {
if (autoPlayIntervalRef.current) {
clearInterval(autoPlayIntervalRef.current)
}
}
}, [banners.length, isPaused, currentIndex])
const currentBanner = banners[currentIndex]
// Safety check: if currentBanner is undefined (shouldn't happen with above effect, but just in case)
if (!currentBanner) {
return null
}
return (
<div
aria-label="Announcements"
aria-live="polite"
aria-roledescription="carousel"
className="mx-4 mb-4 mt-9"
onMouseEnter={() => setIsPaused(true)}
onMouseLeave={() => setIsPaused(false)}
role="region">
{/* Card container with unified styling */}
<div
className="relative"
style={{
backgroundColor: "color-mix(in srgb, var(--vscode-toolbar-hoverBackground) 65%, transparent)",
borderRadius: "4px",
}}>
{/* Card content with fixed height and fade transition */}
<div
className="px-4 pt-4 pb-3"
style={{
height: "144px",
overflow: "hidden",
opacity: isTransitioning ? 0 : 1,
transition: "opacity 0.4s ease-in-out",
}}>
{/* Title with optional icon */}
<h3 className="font-semibold mb-3 flex items-center gap-2" style={{ fontSize: "16px" }}>
{currentBanner.icon}
{currentBanner.title}
</h3>
{/* Description */}
<div className="text-base mb-4" style={{ color: "var(--vscode-descriptionForeground)" }}>
{currentBanner.description}
</div>
{/* Action buttons */}
{currentBanner.actions && currentBanner.actions.length > 0 && (
<div className="flex gap-3 mt-4">
{currentBanner.actions.map((action, idx) => (
<Button
disabled={action.disabled}
key={idx}
onClick={action.onClick}
variant={action.variant === "secondary" ? "secondary" : "default"}>
{action.label}
</Button>
))}
</div>
)}
</div>
{/* Navigation footer - only show if more than 1 banner */}
{banners.length > 1 && (
<div
className="flex justify-between items-center px-4 py-1"
style={{
borderTop: "1px solid rgba(255, 255, 255, 0.1)",
}}>
{/* Page indicator */}
<div className="text-base font-medium" style={{ color: "var(--vscode-descriptionForeground)" }}>
{currentIndex + 1}/{banners.length}
</div>
{/* Navigation arrows */}
<div className="flex -mr-3">
<Button
aria-label="Previous banner"
onClick={handlePrevious}
size="icon"
style={{
width: "40px",
height: "40px",
padding: "0",
backgroundColor: "transparent",
}}
variant="icon">
<ChevronLeft style={{ width: "18px", height: "18px" }} />
</Button>
<Button
aria-label="Next banner"
onClick={handleNext}
size="icon"
style={{
width: "40px",
height: "40px",
padding: "0",
backgroundColor: "transparent",
}}
variant="icon">
<ChevronRight style={{ width: "18px", height: "18px" }} />
</Button>
</div>
</div>
)}
</div>
</div>
)
}
export default BannerCarousel
@@ -0,0 +1,237 @@
import { EmptyRequest } from "@shared/proto/cline/common"
import { VSCodeButton, VSCodeLink } from "@vscode/webview-ui-toolkit/react"
import { XIcon } from "lucide-react"
import React, { useState } from "react"
import { useMount } from "react-use"
import { Button } from "@/components/ui/button"
import { PLATFORM_CONFIG, PlatformType } from "@/config/platform.config"
import { useClineAuth } from "@/context/ClineAuthContext"
import { useExtensionState } from "@/context/ExtensionStateContext"
import { AccountServiceClient } from "@/services/grpc-client"
import { OPENROUTER_MODEL_PICKER_Z_INDEX } from "../settings/OpenRouterModelPicker"
import { useApiConfigurationHandlers } from "../settings/utils/useApiConfigurationHandlers"
interface WhatsNewModalProps {
open: boolean
onClose: () => void
version: string
}
export const WhatsNewModal: React.FC<WhatsNewModalProps> = ({ open, onClose, version }) => {
if (!open) {
return null
}
const isVscode = PLATFORM_CONFIG.type === PlatformType.VSCODE
const { clineUser } = useClineAuth()
const { openRouterModels, setShowChatModelSelector, refreshOpenRouterModels } = useExtensionState()
const user = clineUser || undefined
const { handleFieldsChange } = useApiConfigurationHandlers()
const [didClickMicrowaveButton, setDidClickMicrowaveButton] = useState(false)
// Need to get latest model list in case user hits shortcut button to set model
useMount(refreshOpenRouterModels)
const handleBackdropClick = (e: React.MouseEvent) => {
if (e.target === e.currentTarget) {
onClose()
}
}
// Handle escape key to close modal
React.useEffect(() => {
const handleKeyDown = (e: KeyboardEvent) => {
if (e.key === "Escape" && open) {
onClose()
}
}
window.addEventListener("keydown", handleKeyDown)
return () => window.removeEventListener("keydown", handleKeyDown)
}, [open, onClose])
const setMicrowave = () => {
const modelId = "stealth/microwave"
handleFieldsChange({
planModeOpenRouterModelId: modelId,
actModeOpenRouterModelId: modelId,
planModeOpenRouterModelInfo: openRouterModels[modelId],
actModeOpenRouterModelInfo: openRouterModels[modelId],
planModeApiProvider: "cline",
actModeApiProvider: "cline",
})
setTimeout(() => {
setDidClickMicrowaveButton(true)
setShowChatModelSelector(true)
}, 10)
}
const handleShowAccount = () => {
AccountServiceClient.accountLoginClicked(EmptyRequest.create()).catch((err) =>
console.error("Failed to get login URL:", err),
)
}
return (
<div
aria-modal="true"
className="fixed inset-0 bg-black/80 flex justify-center items-start"
onClick={handleBackdropClick}
role="dialog"
style={{ zIndex: OPENROUTER_MODEL_PICKER_Z_INDEX + 100, paddingTop: "calc(15vh + 60px)" }}>
<div
aria-describedby="whats-new-description"
aria-labelledby="whats-new-title"
className="relative bg-code rounded-sm shadow-lg max-w-md w-full mx-4"
style={{ maxWidth: "420px", height: "fit-content" }}>
{/* Close button */}
<Button
aria-label="Close"
className="absolute top-3 right-3 z-10"
onClick={onClose}
size="icon"
style={{
width: "29px",
height: "29px",
borderRadius: "50%",
backgroundColor: "rgba(0, 0, 0, 0.3)",
}}
variant="icon">
<XIcon style={{ width: "18px", height: "18px" }} />
</Button>
{/* Featured image area */}
<div
className="w-full rounded-t-sm overflow-hidden"
style={{
height: "160px",
backgroundImage:
"url('https://cline.ghost.io/content/images/2025/12/u9318423161_from_autumn_to_winter_interpreted_in_nature_in_th_621d4b5d-74bb-4757-8afc-8095d4fafcc4_1.png')",
backgroundSize: "cover",
backgroundPosition: "center",
backgroundRepeat: "no-repeat",
}}
/>
{/* Content area */}
<div className="p-5 pr-10" id="whats-new-description">
{/* Badge */}
<div className="mb-3">
<span
className="px-2 py-1 text-xs font-semibold rounded"
style={{
backgroundColor: "color-mix(in srgb, var(--vscode-button-background) 30%, transparent)",
color: "var(--vscode-button-foreground)",
}}>
NEW
</span>
</div>
{/* Title */}
<h2
className="text-lg font-semibold mb-3"
id="whats-new-title"
style={{ color: "var(--vscode-editor-foreground)" }}>
🎉 New in v{version}
</h2>
{/* Description */}
<ul className="text-sm mb-3 pl-3 list-disc" style={{ color: "var(--vscode-descriptionForeground)" }}>
{isVscode && (
<>
<li className="mb-2">
New{" "}
<VSCodeLink
href="https://docs.cline.bot/features/explain-changes"
style={{ display: "inline" }}>
Explain Changes
</VSCodeLink>{" "}
button when Cline completes a task to help review code with inline chat. You can reply to
comments, or send the chat as context back to Cline.
</li>
<li className="mb-2">
Use the new{" "}
<VSCodeLink
href="https://docs.cline.bot/features/slash-commands/explain-changes"
style={{ display: "inline" }}>
/explain-changes
</VSCodeLink>{" "}
slash command to explain the changes in branches, commits, etc. (Try asking Cline to explain a
PR you need to review!)
</li>
</>
)}
<li className="mb-2">
New <code>microwave</code> stealth model, free for a limited time!
<br />
{user ? (
<div className="flex gap-2 flex-wrap my-1.5">
{!didClickMicrowaveButton && (
<VSCodeButton
appearance="primary"
onClick={setMicrowave}
style={{ transform: "scale(0.85)", transformOrigin: "left center" }}>
Try stealth/microwave
</VSCodeButton>
)}
</div>
) : (
<VSCodeButton
appearance="primary"
onClick={handleShowAccount}
style={{ margin: "5px 0", transform: "scale(0.85)", transformOrigin: "left center" }}>
Sign Up with Cline
</VSCodeButton>
)}
</li>
</ul>
{/* Demo link */}
{isVscode && (
<p className="text-sm mb-3" style={{ color: "var(--vscode-descriptionForeground)" }}>
See a{" "}
<VSCodeLink href="https://x.com/sdrzn/status/1995840893816111246" style={{ display: "inline" }}>
demo of "Explain Changes"
</VSCodeLink>
</p>
)}
{/* Divider */}
<div
className="mb-3"
style={{
height: "1px",
backgroundColor: "var(--vscode-descriptionForeground)",
opacity: 0.1,
}}
/>
{/* Social links */}
<p className="text-sm mb-5" style={{ color: "var(--vscode-descriptionForeground)" }}>
Join us on{" "}
<VSCodeLink href="https://x.com/cline" style={{ display: "inline" }}>
X,
</VSCodeLink>{" "}
<VSCodeLink href="https://discord.gg/cline" style={{ display: "inline" }}>
discord,
</VSCodeLink>{" "}
or{" "}
<VSCodeLink href="https://www.reddit.com/r/cline/" style={{ display: "inline" }}>
r/cline
</VSCodeLink>{" "}
for more updates!
</p>
{/* Action button */}
<div className="flex gap-3">
<VSCodeButton appearance="secondary" data-testid="close-whats-new-modal" onClick={onClose}>
Dismiss
</VSCodeButton>
</div>
</div>
</div>
</div>
)
}
export default WhatsNewModal
@@ -1,9 +1,8 @@
import { StringRequest } from "@shared/proto/cline/common"
import { VSCodeButton } from "@vscode/webview-ui-toolkit/react"
import { memo, useState } from "react"
import { memo } from "react"
import { useExtensionState } from "@/context/ExtensionStateContext"
import { TaskServiceClient } from "@/services/grpc-client"
import { formatLargeNumber } from "@/utils/format"
type HistoryPreviewProps = {
showHistoryView: () => void
@@ -11,31 +10,18 @@ type HistoryPreviewProps = {
const HistoryPreview = ({ showHistoryView }: HistoryPreviewProps) => {
const { taskHistory } = useExtensionState()
const [isExpanded, setIsExpanded] = useState(true)
const handleHistorySelect = (id: string) => {
TaskServiceClient.showTaskWithId(StringRequest.create({ value: id })).catch((error) =>
console.error("Error showing task:", error),
)
}
const toggleExpanded = () => {
setIsExpanded(!isExpanded)
}
const formatDate = (timestamp: number) => {
const date = new Date(timestamp)
return date
?.toLocaleString("en-US", {
month: "long",
day: "numeric",
hour: "numeric",
minute: "2-digit",
hour12: true,
})
.replace(", ", " ")
.replace(" at", ",")
.toUpperCase()
return date?.toLocaleString("en-US", {
month: "short",
day: "numeric",
})
}
return (
@@ -47,40 +33,66 @@ const HistoryPreview = ({ showHistoryView }: HistoryPreviewProps) => {
border-radius: 4px;
position: relative;
overflow: hidden;
opacity: 0.8;
cursor: pointer;
margin-bottom: 12px;
margin-bottom: 8px;
padding: 10px 12px;
display: flex;
align-items: flex-start;
gap: 12px;
}
.history-preview-item:hover {
background-color: color-mix(in srgb, var(--vscode-toolbar-hoverBackground) 100%, transparent);
opacity: 1;
pointer-events: auto;
}
.history-header {
cursor: pointer;
user-select: none;
.history-task-content {
flex: 1;
display: flex;
align-items: flex-start;
gap: 8px;
min-width: 0;
}
.history-header:hover {
opacity: 0.8;
.history-task-description {
flex: 1;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
color: var(--vscode-foreground);
font-size: var(--vscode-font-size);
line-height: 1.4;
}
.history-meta-stack {
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
flex-shrink: 0;
}
.history-date {
color: var(--vscode-descriptionForeground);
font-size: 0.85em;
white-space: nowrap;
}
.history-cost-chip {
background-color: var(--vscode-badge-background);
color: var(--vscode-badge-foreground);
padding: 2px 8px;
border-radius: 12px;
font-size: 0.85em;
font-weight: 500;
white-space: nowrap;
}
`}
</style>
<div
className="history-header"
onClick={toggleExpanded}
style={{
color: "var(--vscode-descriptionForeground)",
margin: "10px 20px 10px 20px",
margin: "10px 16px 10px 16px",
display: "flex",
alignItems: "center",
}}>
<span
className={`codicon codicon-chevron-${isExpanded ? "down" : "right"}`}
style={{
marginRight: "4px",
transform: "scale(0.9)",
}}></span>
<span
className="codicon codicon-comment-discussion"
style={{
@@ -97,8 +109,8 @@ const HistoryPreview = ({ showHistoryView }: HistoryPreviewProps) => {
</span>
</div>
{isExpanded && (
<div className="px-5">
{
<div className="px-4">
{taskHistory.filter((item) => item.ts && item.task).length > 0 ? (
<>
{taskHistory
@@ -109,55 +121,24 @@ const HistoryPreview = ({ showHistoryView }: HistoryPreviewProps) => {
className="history-preview-item"
key={item.id}
onClick={() => handleHistorySelect(item.id)}>
<div style={{ padding: "12px" }}>
<div style={{ marginBottom: "8px" }}>
<span
style={{
color: "var(--vscode-descriptionForeground)",
fontWeight: 500,
fontSize: "0.85em",
textTransform: "uppercase",
}}>
{formatDate(item.ts)}
</span>
</div>
<div className="history-task-content">
{item.isFavorited && (
<div
<span
aria-label="Favorited"
className="codicon codicon-star-full"
style={{
position: "absolute",
top: "12px",
right: "12px",
color: "var(--vscode-button-background)",
}}>
<span aria-label="Favorited" className="codicon codicon-star-full" />
</div>
flexShrink: 0,
}}
/>
)}
<div className="history-task-description ph-no-capture">{item.task}</div>
</div>
<div className="history-meta-stack">
<span className="history-date">{formatDate(item.ts)}</span>
{item.totalCost != null && (
<span className="history-cost-chip">${item.totalCost.toFixed(2)}</span>
)}
<div
className="history-preview-task text-base text-description mb-2 overflow-hidden whitespace-pre-wrap wrap-anywhere"
id={`history-preview-task-${item.id}`}
style={{
display: "-webkit-box",
WebkitLineClamp: 3,
WebkitBoxOrient: "vertical",
}}>
<span className="ph-no-capture">{item.task}</span>
</div>
<div className="text-sm text-description">
<span className="mr-1">
Tokens: ↑{formatLargeNumber(item.tokensIn || 0)} ↓
{formatLargeNumber(item.tokensOut || 0)}
</span>
{!!item.cacheWrites && (
<span className="mr-1">
• Cache: +{formatLargeNumber(item.cacheWrites || 0)} →{" "}
{formatLargeNumber(item.cacheReads || 0)}
</span>
)}
{!!item.totalCost && (
<span className="mr-1">• API Cost: ${item.totalCost?.toFixed(4)}</span>
)}
</div>
</div>
</div>
))}
@@ -165,7 +146,7 @@ const HistoryPreview = ({ showHistoryView }: HistoryPreviewProps) => {
style={{
display: "flex",
alignItems: "center",
justifyContent: "center",
justifyContent: "flex-start",
}}>
<VSCodeButton
appearance="icon"
@@ -179,7 +160,7 @@ const HistoryPreview = ({ showHistoryView }: HistoryPreviewProps) => {
fontSize: "var(--vscode-font-size)",
color: "var(--vscode-descriptionForeground)",
}}>
View all history
View All
</div>
</VSCodeButton>
</div>
@@ -196,7 +177,7 @@ const HistoryPreview = ({ showHistoryView }: HistoryPreviewProps) => {
</div>
)}
</div>
)}
}
</div>
)
}
+5 -3
View File
@@ -10,9 +10,11 @@ const buttonVariants = cva(
variant: {
default: "bg-button-background text-primary-foreground hover:bg-button-hover",
secondary:
"bg-button-secondary-background text-button-secondary-foreground hover:bg-button-secondary-background-hover",
danger: "bg-error text-background hover:bg-error/90",
outline: "hover:bg-accent/10 border border-accent/20",
"bg-button-secondary-background text-button-secondary-foreground hover:bg-button-secondary-background-hover shadow-sm shadow-button-secondary-background/50",
danger: "bg-error text-background hover:bg-error/90 shadow-sm shadow-error/50",
outline: "hover:bg-accent/10 border border-accent/20 shadow-sm shadow-accent/50",
"outline-primary":
"!bg-transparent !border-[var(--vscode-button-background)] !border-[1px] !border-solid !text-[var(--vscode-button-background)] !hover:bg-[color-mix(in_srgb,var(--vscode-button-background)_15%,transparent)] !active:bg-[color-mix(in_srgb,var(--vscode-button-background)_25%,transparent)]",
ghost: "hover:bg-accent/10",
link: "text-link underline-offset-4 hover:underline p-0 m-0 cursor-text select-text",
text: "text-foreground cursor-text select-text p-0 m-0",
@@ -22,7 +22,33 @@ const HomeHeader = ({ shouldShowQuickWins = false }: HomeHeaderProps) => {
return (
<div className="flex flex-col items-center mb-5">
<div className="my-7">
<style>
{`
@keyframes logo-pop-in {
0% {
opacity: 0;
transform: scale(0.8);
}
50% {
opacity: 1;
transform: scale(1.1);
}
65% {
transform: scale(0.9);
}
80% {
transform: scale(1.05);
}
100% {
transform: scale(1);
}
}
.logo-animate {
animation: logo-pop-in 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}
`}
</style>
<div className="my-7 logo-animate">
<ClineLogoVariable className="size-20" environment={environment} />
</div>
<div className="text-center flex items-center justify-center">