Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions webview-ui/src/components/chat/ApiConfigSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useState, useMemo, useCallback } from "react"
import { Fzf } from "fzf"
import { ChevronUp } from "lucide-react"

import { cn } from "@/lib/utils"
import { useRooPortal } from "@/components/ui/hooks/useRooPortal"
Expand Down Expand Up @@ -149,20 +148,14 @@ export const ApiConfigSelector = ({
disabled={disabled}
data-testid="dropdown-trigger"
className={cn(
"min-w-0 inline-flex items-center gap-1.5 relative whitespace-nowrap px-1.5 py-1 text-xs",
"min-w-0 inline-flex items-center relative whitespace-nowrap px-1.5 py-1 text-xs",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed the gap-1.5 class was removed along with the chevron icon. Since the component still uses inline-flex items-center, was removing the gap intentional? Just want to ensure we maintain consistent spacing if any elements are added in the future.

"bg-transparent border border-[rgba(255,255,255,0.08)] rounded-md text-vscode-foreground",
"transition-all duration-150 focus:outline-none focus-visible:ring-1 focus-visible:ring-vscode-focusBorder focus-visible:ring-inset",
disabled
? "opacity-50 cursor-not-allowed"
: "opacity-90 hover:opacity-100 hover:bg-[rgba(255,255,255,0.03)] hover:border-[rgba(255,255,255,0.15)] cursor-pointer",
triggerClassName,
)}>
<ChevronUp
className={cn(
"pointer-events-none opacity-80 flex-shrink-0 size-3 transition-transform duration-200",
open && "rotate-180",
)}
/>
<span className="truncate">{displayName}</span>
</PopoverTrigger>
</StandardTooltip>
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/src/components/chat/AutoApproveDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ export const AutoApproveDropdown = ({ disabled = false, triggerClassName = "" }:
: "opacity-90 hover:opacity-100 hover:bg-[rgba(255,255,255,0.03)] hover:border-[rgba(255,255,255,0.15)] cursor-pointer",
triggerClassName,
)}>
<CheckCheck className="size-3" />
<span className="truncate">
<CheckCheck className="size-3 flex-shrink-0" />
<span className="truncate min-w-0">
{enabledCount === totalCount
? t("chat:autoApprove.triggerLabelAll")
: t("chat:autoApprove.triggerLabel", { count: enabledCount })}
Expand Down
10 changes: 5 additions & 5 deletions webview-ui/src/components/chat/ChatTextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ export const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
</StandardTooltip>
</div>

<div className="absolute bottom-2 right-2 z-30">
<div className="absolute bottom-2 right-2 z-30 flex items-center gap-1">
{isEditMode && (
<StandardTooltip content={t("chat:cancel.title")}>
<button
Expand Down Expand Up @@ -1175,12 +1175,12 @@ export const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
)}

<div className="flex items-center gap-2">
<div className="flex items-center gap-2 min-w-40 overflow-clip flex-1">
<div className="flex items-center gap-2 min-w-0 overflow-clip flex-1">
<ModeSelector
value={mode}
title={t("chat:selectMode")}
onChange={handleModeChange}
triggerClassName="min-w-20 text-ellipsis overflow-hidden"
triggerClassName="text-ellipsis overflow-hidden flex-shrink-0"
modeShortcutText={modeShortcutText}
customModes={customModes}
customModePrompts={customModePrompts}
Expand All @@ -1191,12 +1191,12 @@ export const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
disabled={selectApiConfigDisabled}
title={t("chat:selectApiConfig")}
onChange={handleApiConfigChange}
triggerClassName="min-w-16 text-ellipsis overflow-hidden"
triggerClassName="min-w-[28px] text-ellipsis overflow-hidden flex-shrink"
listApiConfigMeta={listApiConfigMeta || []}
pinnedApiConfigs={pinnedApiConfigs}
togglePinnedApiConfig={togglePinnedApiConfig}
/>
<AutoApproveDropdown triggerClassName="min-w-20 text-ellipsis overflow-hidden" />
<AutoApproveDropdown triggerClassName="min-w-[28px] text-ellipsis overflow-hidden flex-shrink" />
</div>
<div className="flex flex-shrink-0 items-center gap-0.5">
{isTtsPlaying && (
Expand Down
10 changes: 2 additions & 8 deletions webview-ui/src/components/chat/ModeSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react"
import { Fzf } from "fzf"
import { ChevronUp, Check, X } from "lucide-react"
import { Check, X } from "lucide-react"

import { type ModeConfig, type CustomModePrompts, TelemetryEventName } from "@roo-code/types"

Expand Down Expand Up @@ -198,7 +198,7 @@ export const ModeSelector = ({
disabled={disabled}
data-testid="mode-selector-trigger"
className={cn(
"inline-flex items-center gap-1.5 relative whitespace-nowrap px-1.5 py-1 text-xs",
"inline-flex items-center relative whitespace-nowrap px-1.5 py-1 text-xs",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to ApiConfigSelector, the gap-1.5 was removed here. Is this intentional given that inline-flex items-center remains? This could affect spacing if elements are added later.

"bg-transparent border border-[rgba(255,255,255,0.08)] rounded-md text-vscode-foreground",
"transition-all duration-150 focus:outline-none focus-visible:ring-1 focus-visible:ring-vscode-focusBorder focus-visible:ring-inset",
disabled
Expand All @@ -209,12 +209,6 @@ export const ModeSelector = ({
? "bg-primary opacity-90 hover:bg-primary-hover text-vscode-button-foreground"
: null,
)}>
<ChevronUp
className={cn(
"pointer-events-none opacity-80 flex-shrink-0 size-3 transition-transform duration-200",
open && "rotate-180",
)}
/>
<span className="truncate">{selectedMode?.name || ""}</span>
</PopoverTrigger>
</StandardTooltip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,6 @@ describe("ApiConfigSelector", () => {
expect(trigger).toHaveTextContent("Config 1")
})

test("renders with ChevronUp icon", () => {
render(<ApiConfigSelector {...defaultProps} />)

const trigger = screen.getByTestId("dropdown-trigger")
// Check for the icon by looking for the svg element (ChevronUp from lucide-react renders as svg)
const icon = trigger.querySelector("svg")
expect(icon).toBeInTheDocument()
})

test("handles disabled state correctly", () => {
render(<ApiConfigSelector {...defaultProps} disabled={true} />)

Expand Down
Loading