diff --git a/webview-ui/src/components/chat/ChatTextArea.tsx b/webview-ui/src/components/chat/ChatTextArea.tsx index b522b43ecc..3d70f4a4ca 100644 --- a/webview-ui/src/components/chat/ChatTextArea.tsx +++ b/webview-ui/src/components/chat/ChatTextArea.tsx @@ -25,9 +25,8 @@ import Thumbnails from "../common/Thumbnails" import ModeSelector from "./ModeSelector" import { MAX_IMAGES_PER_MESSAGE } from "./ChatView" import ContextMenu from "./ContextMenu" -import { VolumeX, Pin, Check } from "lucide-react" -import { IconButton } from "./IconButton" -import { IndexingStatusDot } from "./IndexingStatusBadge" +import { VolumeX, Pin, Check, Image, WandSparkles, SendHorizontal } from "lucide-react" +import { IndexingStatusBadge } from "./IndexingStatusBadge" import { cn } from "@/lib/utils" import { usePromptHistory } from "./hooks/usePromptHistory" @@ -962,24 +961,49 @@ const ChatTextArea = forwardRef( )}
- + onClick={!sendingDisabled ? handleEnhancePrompt : undefined} + className={cn( + "relative inline-flex items-center justify-center", + "bg-transparent border-none p-1.5", + "rounded-md min-w-[28px] min-h-[28px]", + "opacity-60 hover:opacity-100 text-vscode-descriptionForeground hover:text-vscode-foreground", + "transition-all duration-150", + "hover:bg-[rgba(255,255,255,0.03)] hover:border-[rgba(255,255,255,0.15)]", + "focus:outline-none focus-visible:ring-1 focus-visible:ring-vscode-focusBorder", + "active:bg-[rgba(255,255,255,0.1)]", + !sendingDisabled && "cursor-pointer", + sendingDisabled && + "opacity-40 cursor-not-allowed grayscale-[30%] hover:bg-transparent hover:border-[rgba(255,255,255,0.08)] active:bg-transparent", + )}> + +
- + onClick={!sendingDisabled ? onSend : undefined} + className={cn( + "relative inline-flex items-center justify-center", + "bg-transparent border-none p-1.5", + "rounded-md min-w-[28px] min-h-[28px]", + "opacity-60 hover:opacity-100 text-vscode-descriptionForeground hover:text-vscode-foreground", + "transition-all duration-150", + "hover:bg-[rgba(255,255,255,0.03)] hover:border-[rgba(255,255,255,0.15)]", + "focus:outline-none focus-visible:ring-1 focus-visible:ring-vscode-focusBorder", + "active:bg-[rgba(255,255,255,0.1)]", + !sendingDisabled && "cursor-pointer", + sendingDisabled && + "opacity-40 cursor-not-allowed grayscale-[30%] hover:bg-transparent hover:border-[rgba(255,255,255,0.08)] active:bg-transparent", + )}> + +
{!inputValue && ( @@ -1145,14 +1169,28 @@ const ChatTextArea = forwardRef(
- - +
diff --git a/webview-ui/src/components/chat/IndexingStatusBadge.tsx b/webview-ui/src/components/chat/IndexingStatusBadge.tsx index f3c268c2ba..0a42b97abf 100644 --- a/webview-ui/src/components/chat/IndexingStatusBadge.tsx +++ b/webview-ui/src/components/chat/IndexingStatusBadge.tsx @@ -1,4 +1,5 @@ import React, { useState, useEffect, useMemo } from "react" +import { Database } from "lucide-react" import { cn } from "@src/lib/utils" import { vscode } from "@src/utils/vscode" import { useAppTranslation } from "@/i18n/TranslationContext" @@ -6,11 +7,11 @@ import { useTooltip } from "@/hooks/useTooltip" import { CodeIndexPopover } from "./CodeIndexPopover" import type { IndexingStatus, IndexingStatusUpdateMessage } from "@roo/ExtensionMessage" -interface IndexingStatusDotProps { +interface IndexingStatusBadgeProps { className?: string } -export const IndexingStatusDot: React.FC = ({ className }) => { +export const IndexingStatusBadge: React.FC = ({ className }) => { const { t } = useAppTranslation() const { showTooltip, handleMouseEnter, handleMouseLeave, cleanup } = useTooltip({ delay: 300 }) const [isHovered, setIsHovered] = useState(false) @@ -77,23 +78,23 @@ export const IndexingStatusDot: React.FC = ({ className handleMouseLeave() } - // Get status color classes based on status and hover state + // Get status color classes for the badge dot const getStatusColorClass = () => { const statusColors = { Standby: { - default: "bg-vscode-descriptionForeground/40", - hover: "bg-vscode-descriptionForeground/60", + default: "bg-vscode-descriptionForeground/60", + hover: "bg-vscode-descriptionForeground/80", }, Indexing: { - default: "bg-yellow-500/40 animate-pulse", + default: "bg-yellow-500 animate-pulse", hover: "bg-yellow-500 animate-pulse", }, Indexed: { - default: "bg-green-500/40", + default: "bg-green-500", hover: "bg-green-500", }, Error: { - default: "bg-red-500/40", + default: "bg-red-500", hover: "bg-red-500", }, } @@ -117,12 +118,17 @@ export const IndexingStatusDot: React.FC = ({ className "hover:opacity-100 hover:bg-[rgba(255,255,255,0.03)] hover:border-[rgba(255,255,255,0.15)]", "focus:outline-none focus-visible:ring-1 focus-visible:ring-vscode-focusBorder", "active:bg-[rgba(255,255,255,0.1)]", + "cursor-pointer", className, )} aria-label={getTooltipText()}> + {/* File search icon */} + + + {/* Status dot badge */} diff --git a/webview-ui/src/components/chat/__tests__/ChatTextArea.spec.tsx b/webview-ui/src/components/chat/__tests__/ChatTextArea.spec.tsx index 86e200f0a3..75324c97f4 100644 --- a/webview-ui/src/components/chat/__tests__/ChatTextArea.spec.tsx +++ b/webview-ui/src/components/chat/__tests__/ChatTextArea.spec.tsx @@ -38,8 +38,8 @@ vi.mock("@src/context/ExtensionStateContext") const getEnhancePromptButton = () => { return screen.getByRole("button", { name: (_, element) => { - // Find the button with the sparkle icon - return element.querySelector(".codicon-sparkle") !== null + // Find the button with the wand sparkles icon (Lucide React) + return element.querySelector(".lucide-wand-sparkles") !== null }, }) } @@ -154,8 +154,9 @@ describe("ChatTextArea", () => { const enhanceButton = getEnhancePromptButton() fireEvent.click(enhanceButton) - const loadingSpinner = screen.getByText("", { selector: ".codicon-loading" }) - expect(loadingSpinner).toBeInTheDocument() + // Check if the WandSparkles icon has the animate-spin class + const animatingIcon = enhanceButton.querySelector(".animate-spin") + expect(animatingIcon).toBeInTheDocument() }) }) diff --git a/webview-ui/src/components/chat/__tests__/IndexingStatusBadge.spec.tsx b/webview-ui/src/components/chat/__tests__/IndexingStatusBadge.spec.tsx index 8a44082f58..37eb291530 100644 --- a/webview-ui/src/components/chat/__tests__/IndexingStatusBadge.spec.tsx +++ b/webview-ui/src/components/chat/__tests__/IndexingStatusBadge.spec.tsx @@ -3,7 +3,7 @@ import { render, screen, fireEvent, waitFor, act } from "@/utils/test-utils" import { vscode } from "@src/utils/vscode" -import { IndexingStatusDot } from "../IndexingStatusBadge" +import { IndexingStatusBadge } from "../IndexingStatusBadge" vi.mock("@/i18n/setup", () => ({ __esModule: true, @@ -104,9 +104,9 @@ vi.mock("@/i18n/TranslationContext", () => ({ }), })) -describe("IndexingStatusDot", () => { +describe("IndexingStatusBadge", () => { const renderComponent = (props = {}) => { - return render() + return render() } beforeEach(() => {