Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion webview-ui/src/components/chat/ChatTextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,7 @@ 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-13 text-ellipsis overflow-hidden"
Copy link
Contributor

Choose a reason for hiding this comment

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

The width adjustment from min-w-16 to min-w-13 makes sense after removing the chevron. Could we verify this works well across different screen sizes and doesn't cause text truncation issues?

listApiConfigMeta={listApiConfigMeta || []}
pinnedApiConfigs={pinnedApiConfigs}
togglePinnedApiConfig={togglePinnedApiConfig}
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