Skip to content

Commit eeb3e7d

Browse files
committed
refactor: use shadcn Button in ProjectSettingsSection
Align with the shadcn refactor that was done on other Settings sections. Uses Button component with variant='ghost', 'outline', and default instead of raw button elements with manual styling.
1 parent 97e73c1 commit eeb3e7d

File tree

2 files changed

+33
-32
lines changed

2 files changed

+33
-32
lines changed

src/browser/components/Settings/SettingsModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function SettingsModal() {
6969
<X className="h-4 w-4" />
7070
</Button>
7171
</div>
72-
<nav className="flex overflow-x-auto p-2 md:flex-1 md:flex-col md:overflow-y-auto">
72+
<nav className="flex gap-1 overflow-x-auto p-2 md:flex-1 md:flex-col md:overflow-y-auto">
7373
{SECTIONS.map((section) => (
7474
<Button
7575
key={section.id}

src/browser/components/Settings/sections/ProjectSettingsSection.tsx

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
Check,
1515
X,
1616
} from "lucide-react";
17+
import { Button } from "@/browser/components/ui/button";
1718
import { createEditKeyHandler } from "@/browser/utils/ui/keybinds";
1819
import { formatRelativeTime } from "@/browser/utils/ui/dateTime";
1920
import type { CachedMCPTestResult } from "@/common/types/mcp";
@@ -359,61 +360,66 @@ export const ProjectSettingsSection: React.FC = () => {
359360
<div className="flex shrink-0 gap-1">
360361
{isEditing ? (
361362
<>
362-
<button
363-
type="button"
363+
<Button
364+
variant="ghost"
365+
size="icon"
364366
onClick={() => void handleSaveEdit()}
365367
disabled={savingEdit || !editing.command.trim()}
366-
className="text-muted-foreground rounded p-1.5 transition-colors hover:bg-green-500/10 hover:text-green-500 disabled:opacity-50"
368+
className="h-7 w-7 text-green-500 hover:text-green-400"
367369
title="Save (Enter)"
368370
>
369371
{savingEdit ? (
370372
<Loader2 className="h-4 w-4 animate-spin" />
371373
) : (
372374
<Check className="h-4 w-4" />
373375
)}
374-
</button>
375-
<button
376-
type="button"
376+
</Button>
377+
<Button
378+
variant="ghost"
379+
size="icon"
377380
onClick={handleCancelEdit}
378381
disabled={savingEdit}
379-
className="text-muted-foreground hover:bg-destructive/10 hover:text-destructive rounded p-1.5 transition-colors"
382+
className="text-muted hover:text-foreground h-7 w-7"
380383
title="Cancel (Esc)"
381384
>
382385
<X className="h-4 w-4" />
383-
</button>
386+
</Button>
384387
</>
385388
) : (
386389
<>
387-
<button
388-
type="button"
390+
<Button
391+
variant="ghost"
392+
size="icon"
389393
onClick={() => void handleTest(name)}
390394
disabled={isTesting}
391-
className="text-muted-foreground hover:bg-secondary hover:text-accent rounded p-1.5 transition-colors disabled:opacity-50"
395+
className="text-muted hover:text-accent h-7 w-7"
392396
title="Test connection"
393397
>
394398
{isTesting ? (
395399
<Loader2 className="h-4 w-4 animate-spin" />
396400
) : (
397401
<Play className="h-4 w-4" />
398402
)}
399-
</button>
400-
<button
401-
type="button"
403+
</Button>
404+
<Button
405+
variant="ghost"
406+
size="icon"
402407
onClick={() => handleStartEdit(name, command)}
403-
className="text-muted-foreground hover:bg-secondary hover:text-accent rounded p-1.5 transition-colors"
408+
className="text-muted hover:text-accent h-7 w-7"
404409
title="Edit command"
405410
>
406411
<Pencil className="h-4 w-4" />
407-
</button>
408-
<button
409-
type="button"
412+
</Button>
413+
<Button
414+
variant="ghost"
415+
size="icon"
410416
onClick={() => void handleRemove(name)}
411417
disabled={loading}
412-
className="text-muted-foreground hover:bg-destructive/10 hover:text-destructive rounded p-1.5 transition-colors"
418+
className="text-muted hover:text-error h-7 w-7"
413419
title="Remove server"
414420
>
415421
<Trash2 className="h-4 w-4" />
416-
</button>
422+
</Button>
417423
</>
418424
)}
419425
</div>
@@ -503,32 +509,27 @@ export const ProjectSettingsSection: React.FC = () => {
503509
)}
504510

505511
<div className="flex gap-2">
506-
<button
507-
type="button"
512+
<Button
513+
variant="outline"
508514
onClick={() => void handleTestNewCommand()}
509515
disabled={!canTest || testingNew}
510-
className="border-border-medium hover:bg-secondary flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-sm transition-colors disabled:opacity-50"
516+
className="h-auto px-3 py-1.5"
511517
>
512518
{testingNew ? (
513519
<Loader2 className="h-4 w-4 animate-spin" />
514520
) : (
515521
<Play className="h-4 w-4" />
516522
)}
517523
{testingNew ? "Testing…" : "Test"}
518-
</button>
519-
<button
520-
type="button"
521-
onClick={() => void handleAddServer()}
522-
disabled={!canAdd || addingServer}
523-
className="bg-accent hover:bg-accent/90 flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm text-white transition-colors disabled:opacity-50"
524-
>
524+
</Button>
525+
<Button onClick={() => void handleAddServer()} disabled={!canAdd || addingServer}>
525526
{addingServer ? (
526527
<Loader2 className="h-4 w-4 animate-spin" />
527528
) : (
528529
<Plus className="h-4 w-4" />
529530
)}
530531
{addingServer ? "Adding…" : "Add"}
531-
</button>
532+
</Button>
532533
</div>
533534
</div>
534535
</div>

0 commit comments

Comments
 (0)