diff --git a/webview-ui/src/components/chat/ChatView.tsx b/webview-ui/src/components/chat/ChatView.tsx index 929fa9427a..924fcb8ab4 100644 --- a/webview-ui/src/components/chat/ChatView.tsx +++ b/webview-ui/src/components/chat/ChatView.tsx @@ -44,7 +44,6 @@ import { CloudUpsellDialog } from "@src/components/cloud/CloudUpsellDialog" import TelemetryBanner from "../common/TelemetryBanner" import VersionIndicator from "../common/VersionIndicator" -import { useTaskSearch } from "../history/useTaskSearch" import HistoryPreview from "../history/HistoryPreview" import Announcement from "./Announcement" import BrowserSessionRow from "./BrowserSessionRow" @@ -118,7 +117,6 @@ const ChatViewComponent: React.ForwardRefRenderFunction { - const newState = !isExpanded - setIsExpanded(newState) - // Send message to extension to persist the new collapsed state - vscode.postMessage({ type: "setHistoryPreviewCollapsed", bool: !newState }) - }, [isExpanded]) - // Leaving this less safe version here since if the first message is not a // task, then the extension is in a bad state and needs to be debugged (see // Cline.abort). @@ -1810,53 +1794,35 @@ const ChatViewComponent: React.ForwardRefRenderFunction ) : ( -
- {/* Moved Task Bar Header Here */} - {tasks.length !== 0 && ( -
-
- {tasks.length < 10 && ( - {t("history:recentTasks")} - )} - -
-
- )} -
0 ? "mt-0" : ""} px-3.5 min-[370px]:px-10 pt-5 transition-all duration-300`}> - {/* Version indicator in top-right corner - only on welcome screen */} +
+
setShowAnnouncementModal(true)} className="absolute top-2 right-3 z-10" /> - - - -
- {cloudIsAuthenticated || taskHistory.length < 4 ? ( - - ) : ( - <> - } - onClick={() => openUpsell()} - dismissOnClick={false} - className="bg-vscode-editor-background p-4 !text-base"> - , - }} - /> - - - )} +
+ + {/* Show RooTips when authenticated or when user is new */} + {(cloudIsAuthenticated || taskHistory.length < 4) && } + {/* Everyone should see their task history if any */} + {taskHistory.length > 0 && }
- {/* Show the task history preview if expanded and tasks exist */} - {taskHistory.length > 0 && isExpanded && } + {/* Logged out users should see a one-time upsell, but not for brand new users */} + {!cloudIsAuthenticated && taskHistory.length >= 4 && ( + } + onClick={() => openUpsell()} + dismissOnClick={false} + className="!bg-vscode-editor-background mt-6 border-border rounded-xl pl-4 pr-3 py-3 !text-base"> + , + }} + /> + + )}
)} diff --git a/webview-ui/src/components/history/__tests__/HistoryPreview.spec.tsx b/webview-ui/src/components/history/__tests__/HistoryPreview.spec.tsx index 20e7fcbdf3..a75721c28c 100644 --- a/webview-ui/src/components/history/__tests__/HistoryPreview.spec.tsx +++ b/webview-ui/src/components/history/__tests__/HistoryPreview.spec.tsx @@ -100,7 +100,7 @@ describe("HistoryPreview", () => { const { container } = render() // Should render the container but no task items - expect(container.firstChild).toHaveClass("flex", "flex-col", "gap-3") + expect(container.firstChild).toHaveClass("flex", "flex-col", "gap-1") expect(screen.queryByTestId(/task-item-/)).not.toBeInTheDocument() }) @@ -226,6 +226,6 @@ describe("HistoryPreview", () => { const { container } = render() - expect(container.firstChild).toHaveClass("flex", "flex-col", "gap-3") + expect(container.firstChild).toHaveClass("flex", "flex-col", "gap-1") }) }) diff --git a/webview-ui/src/components/history/__tests__/TaskItem.spec.tsx b/webview-ui/src/components/history/__tests__/TaskItem.spec.tsx index 6995d5840c..1bcc983c6e 100644 --- a/webview-ui/src/components/history/__tests__/TaskItem.spec.tsx +++ b/webview-ui/src/components/history/__tests__/TaskItem.spec.tsx @@ -107,6 +107,6 @@ describe("TaskItem", () => { ) const taskItem = screen.getByTestId("task-item-1") - expect(taskItem).toHaveClass("hover:bg-vscode-list-hoverBackground") + expect(taskItem).toHaveClass("hover:bg-vscode-editor-foreground/10") }) })