diff --git a/.changeset/upset-waves-take.md b/.changeset/upset-waves-take.md new file mode 100644 index 00000000..e5d16eb0 --- /dev/null +++ b/.changeset/upset-waves-take.md @@ -0,0 +1,5 @@ +--- +"claude-dev": patch +--- + +Welcome screen ui enhancements diff --git a/src/test/e2e/auth.test.ts b/src/test/e2e/auth.test.ts index d40bf451..a24dbdf9 100644 --- a/src/test/e2e/auth.test.ts +++ b/src/test/e2e/auth.test.ts @@ -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() }) diff --git a/src/test/e2e/diff.test.ts b/src/test/e2e/diff.test.ts index 7e486679..79a685cc 100644 --- a/src/test/e2e/diff.test.ts +++ b/src/test/e2e/diff.test.ts @@ -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() diff --git a/src/test/e2e/editor.test.ts b/src/test/e2e/editor.test.ts index 3c47843d..4fd11ab3 100644 --- a/src/test/e2e/editor.test.ts +++ b/src/test/e2e/editor.test.ts @@ -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() diff --git a/src/test/e2e/fixtures/server/index.ts b/src/test/e2e/fixtures/server/index.ts index bda6f9af..20a951ff 100644 --- a/src/test/e2e/fixtures/server/index.ts +++ b/src/test/e2e/fixtures/server/index.ts @@ -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) } diff --git a/src/test/e2e/utils/common.ts b/src/test/e2e/utils/common.ts index 6713c98b..6597c4b5 100644 --- a/src/test/e2e/utils/common.ts +++ b/src/test/e2e/utils/common.ts @@ -34,25 +34,3 @@ export const toggleNotifications = async (_page: Page) => { await _page.keyboard.press("Enter") return _page } - -export async function cleanChatView(sidebar: Page): Promise { - 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 -} diff --git a/src/test/e2e/utils/helpers.ts b/src/test/e2e/utils/helpers.ts index e678ad94..ed993310 100644 --- a/src/test/e2e/utils/helpers.ts +++ b/src/test/e2e/utils/helpers.ts @@ -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 { 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 8de303ee..fe6bac7d 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 @@ -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 = ({ }) => { 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 = ({ 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: 💡, + 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.{" "} + + See how → + + + ), + }) + } + + 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: , + 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: , + title: isMacOSOrLinux() ? "CLI & Subagents Available" : "Cline CLI Info", + description: isMacOSOrLinux() ? ( + <> + Use Cline in your terminal and enable subagent capabilities.{" "} + + Learn more + + + ) : ( + <> + Available for macOS and Linux. Coming soon to other platforms.{" "} + + Learn more + + + ), + 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 (
+ +
- {shouldShowInfoBanner && } - {showAnnouncement && } - {shouldShowNewModelBanner && } - {shouldShowCliBanner && } - {!shouldShowQuickWins && taskHistory.length > 0 && } + {!showWhatsNewModal && ( + <> +
+ +
+ {!shouldShowQuickWins && taskHistory.length > 0 && ( +
+ +
+ )} + + )}
diff --git a/webview-ui/src/components/common/BannerCarousel.tsx b/webview-ui/src/components/common/BannerCarousel.tsx new file mode 100644 index 00000000..00b8723e --- /dev/null +++ b/webview-ui/src/components/common/BannerCarousel.tsx @@ -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 = ({ banners }) => { + const [currentIndex, setCurrentIndex] = useState(0) + const [isPaused, setIsPaused] = useState(false) + const [isTransitioning, setIsTransitioning] = useState(false) + const autoPlayIntervalRef = React.useRef(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 ( +
setIsPaused(true)} + onMouseLeave={() => setIsPaused(false)} + role="region"> + {/* Card container with unified styling */} +
+ {/* Card content with fixed height and fade transition */} +
+ {/* Title with optional icon */} +

+ {currentBanner.icon} + {currentBanner.title} +

+ + {/* Description */} +
+ {currentBanner.description} +
+ + {/* Action buttons */} + {currentBanner.actions && currentBanner.actions.length > 0 && ( +
+ {currentBanner.actions.map((action, idx) => ( + + ))} +
+ )} +
+ + {/* Navigation footer - only show if more than 1 banner */} + {banners.length > 1 && ( +
+ {/* Page indicator */} +
+ {currentIndex + 1}/{banners.length} +
+ + {/* Navigation arrows */} +
+ + +
+
+ )} +
+
+ ) +} + +export default BannerCarousel diff --git a/webview-ui/src/components/common/WhatsNewModal.tsx b/webview-ui/src/components/common/WhatsNewModal.tsx new file mode 100644 index 00000000..ed897a14 --- /dev/null +++ b/webview-ui/src/components/common/WhatsNewModal.tsx @@ -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 = ({ 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 ( +
+
+ {/* Close button */} + + + {/* Featured image area */} +
+ + {/* Content area */} +
+ {/* Badge */} +
+ + NEW + +
+ + {/* Title */} +

+ 🎉 New in v{version} +

+ + {/* Description */} +
    + {isVscode && ( + <> +
  • + New{" "} + + Explain Changes + {" "} + 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. +
  • +
  • + Use the new{" "} + + /explain-changes + {" "} + slash command to explain the changes in branches, commits, etc. (Try asking Cline to explain a + PR you need to review!) +
  • + + )} +
  • + New microwave stealth model, free for a limited time! +
    + {user ? ( +
    + {!didClickMicrowaveButton && ( + + Try stealth/microwave + + )} +
    + ) : ( + + Sign Up with Cline + + )} +
  • +
+ + {/* Demo link */} + {isVscode && ( +

+ See a{" "} + + demo of "Explain Changes" + +

+ )} + + {/* Divider */} +
+ + {/* Social links */} +

+ Join us on{" "} + + X, + {" "} + + discord, + {" "} + or{" "} + + r/cline + {" "} + for more updates! +

+ + {/* Action button */} +
+ + Dismiss + +
+
+
+
+ ) +} + +export default WhatsNewModal diff --git a/webview-ui/src/components/history/HistoryPreview.tsx b/webview-ui/src/components/history/HistoryPreview.tsx index a73e7742..50e67bdb 100644 --- a/webview-ui/src/components/history/HistoryPreview.tsx +++ b/webview-ui/src/components/history/HistoryPreview.tsx @@ -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; } `}
- {
- {isExpanded && ( -
+ { +
{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)}> -
-
- - {formatDate(item.ts)} - -
+
{item.isFavorited && ( -
- -
+ flexShrink: 0, + }} + /> + )} +
{item.task}
+
+
+ {formatDate(item.ts)} + {item.totalCost != null && ( + ${item.totalCost.toFixed(2)} )} - -
- {item.task} -
-
- - Tokens: ↑{formatLargeNumber(item.tokensIn || 0)} ↓ - {formatLargeNumber(item.tokensOut || 0)} - - {!!item.cacheWrites && ( - - • Cache: +{formatLargeNumber(item.cacheWrites || 0)} →{" "} - {formatLargeNumber(item.cacheReads || 0)} - - )} - {!!item.totalCost && ( - • API Cost: ${item.totalCost?.toFixed(4)} - )} -
))} @@ -165,7 +146,7 @@ const HistoryPreview = ({ showHistoryView }: HistoryPreviewProps) => { style={{ display: "flex", alignItems: "center", - justifyContent: "center", + justifyContent: "flex-start", }}> { fontSize: "var(--vscode-font-size)", color: "var(--vscode-descriptionForeground)", }}> - View all history + View All
@@ -196,7 +177,7 @@ const HistoryPreview = ({ showHistoryView }: HistoryPreviewProps) => {
)}
- )} + } ) } diff --git a/webview-ui/src/components/ui/button.tsx b/webview-ui/src/components/ui/button.tsx index 7f8dbc2e..479e77e3 100644 --- a/webview-ui/src/components/ui/button.tsx +++ b/webview-ui/src/components/ui/button.tsx @@ -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", diff --git a/webview-ui/src/components/welcome/HomeHeader.tsx b/webview-ui/src/components/welcome/HomeHeader.tsx index 654a1f7c..c0a8c651 100644 --- a/webview-ui/src/components/welcome/HomeHeader.tsx +++ b/webview-ui/src/components/welcome/HomeHeader.tsx @@ -22,7 +22,33 @@ const HomeHeader = ({ shouldShowQuickWins = false }: HomeHeaderProps) => { return (
-
+ +