Skip to content

Commit 0ead2cd

Browse files
committed
fix: use Download icon from lucide-react for import button
- Replace codicon-cloud-download with Download icon to match ModesView - Update Button styling to match other footer buttons - Update tests to check for SVG icon instead of codicon class
1 parent 63fcac7 commit 0ead2cd

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

webview-ui/src/components/chat/ModeSelector.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react"
2-
import { ChevronUp, Check, X, Upload } from "lucide-react"
2+
import { ChevronUp, Check, X, Upload, Download } from "lucide-react"
33
import { cn } from "@/lib/utils"
44
import { useRooPortal } from "@/components/ui/hooks/useRooPortal"
55
import { Popover, PopoverContent, PopoverTrigger, StandardTooltip, Button } from "@/components/ui"
@@ -368,14 +368,15 @@ export const ModeSelector = ({
368368
setOpen(false)
369369
}}
370370
/>
371-
{/* Import button - using IconButton for consistency */}
372-
<IconButton
373-
iconClass="codicon-cloud-download"
371+
{/* Import button - using Button with Download icon to match ModesView */}
372+
<Button
373+
variant="ghost"
374+
size="icon"
374375
title={t("prompts:modes.importMode")}
375376
onClick={() => setShowImportDialog(true)}
376-
disabled={isImporting}
377-
isLoading={isImporting}
378-
/>
377+
disabled={isImporting}>
378+
<Download className="h-3.5 w-3.5" />
379+
</Button>
379380
</div>
380381

381382
{/* Info icon and title on the right - only show info icon when search bar is visible */}

webview-ui/src/components/chat/__tests__/ModeSelector.export-import.spec.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ describe("ModeSelector Export/Import", () => {
213213
// Import button should be visible
214214
const importButton = screen.getByRole("button", { name: "Import Mode" })
215215
expect(importButton).toBeInTheDocument()
216-
// Check for the icon inside the button
217-
const icon = importButton.querySelector(".codicon-cloud-download")
216+
// Check for the Download icon (SVG) inside the button
217+
const icon = importButton.querySelector("svg")
218218
expect(icon).toBeInTheDocument()
219219
})
220220

@@ -424,16 +424,17 @@ describe("ModeSelector Export/Import", () => {
424424
expect(exportButton).toHaveAttribute("aria-label", "Export Mode")
425425
})
426426

427-
test("import button uses IconButton component", async () => {
427+
test("import button has proper structure", async () => {
428428
render(<ModeSelector value={"code" as Mode} onChange={vi.fn()} modeShortcutText="Ctrl+M" />)
429429

430430
// Open the popover
431431
fireEvent.click(screen.getByTestId("mode-selector-trigger"))
432432

433-
// Import button should have proper IconButton structure
433+
// Import button should have proper structure
434434
const importButton = screen.getByRole("button", { name: "Import Mode" })
435-
expect(importButton).toHaveAttribute("aria-label", "Import Mode")
436-
expect(importButton.querySelector(".codicon-cloud-download")).toBeInTheDocument()
435+
expect(importButton).toHaveAttribute("title", "Import Mode")
436+
// Check for the Download icon (SVG) inside the button
437+
expect(importButton.querySelector("svg")).toBeInTheDocument()
437438
})
438439
})
439440
})

0 commit comments

Comments
 (0)