+
{providerEntries.map(({ providerId, providerName, models }) => {
const modelEntries = Object.entries(models)
if (modelEntries.length === 0) return null
return (
-
-
-
-
-
- {providerName}
-
- ({modelEntries.length} model{modelEntries.length !== 1 ? 's' : ''})
-
-
-
-
-
+
+
+
+ {providerName}
+ {modelEntries.length} model{modelEntries.length !== 1 ? 's' : ''}
+
+
{modelEntries.map(([modelId, model]) => (
-
-
-
{model.name || modelId}
-
- {modelId}
+ title={model.name || modelId}
+ description={{modelId}}
+ belowDescription={(model.limit?.context || model.limit?.output) && (
+
+ Limits: {model.limit?.context && `Context ${model.limit.context}`}{model.limit?.context && model.limit?.output && ' / '}{model.limit?.output && `Output ${model.limit.output}`}
- {(model.limit?.context || model.limit?.output) && (
-
- Limits:{' '}
- {model.limit.context && `Context ${model.limit.context}`}
- {model.limit.context && model.limit.output && ' / '}
- {model.limit.output && `Output ${model.limit.output}`}
-
- )}
-
-
-
-
-
-
+ )}
+ onClick={() => startEdit(providerId, modelId, model)}
+ primaryAction={{ label: 'Edit', onClick: () => startEdit(providerId, modelId, model) }}
+ actions={[{ label: 'Delete', destructive: true, onClick: () => deleteModel(providerId, modelId) }]}
+ actionsLabel={`Actions for ${model.name || modelId}`}
+ />
))}
-
-
+
+
)
})}
diff --git a/frontend/src/components/settings/RestartServerDialog.test.tsx b/frontend/src/components/settings/RestartServerDialog.test.tsx
new file mode 100644
index 00000000..5125e004
--- /dev/null
+++ b/frontend/src/components/settings/RestartServerDialog.test.tsx
@@ -0,0 +1,69 @@
+import { describe, it, expect, vi } from 'vitest'
+import { render, screen } from '@testing-library/react'
+import userEvent from '@testing-library/user-event'
+import { RestartServerDialog } from './RestartServerDialog'
+
+const baseProps = {
+ open: true,
+ onOpenChange: vi.fn(),
+ onConfirm: vi.fn(),
+ onCancel: vi.fn(),
+}
+
+describe('RestartServerDialog', () => {
+ it('renders the title and description when open is true', () => {
+ render(
)
+
+ expect(screen.getByText('Restart OpenCode Server?')).toBeInTheDocument()
+ expect(
+ screen.getByText(/Restart the OpenCode server after your changes are saved to apply them to the running server\./)
+ ).toBeInTheDocument()
+ })
+
+ it('renders nothing visible when open is false', () => {
+ render(
)
+
+ expect(screen.queryByText('Restart OpenCode Server?')).not.toBeInTheDocument()
+ })
+
+ it('calls onConfirm when Restart now is clicked', async () => {
+ const onConfirm = vi.fn()
+ const user = userEvent.setup()
+ render(
)
+
+ await user.click(screen.getByRole('button', { name: /restart now/i }))
+ expect(onConfirm).toHaveBeenCalled()
+ })
+
+ it('calls onCancel when Later is clicked', async () => {
+ const onCancel = vi.fn()
+ const user = userEvent.setup()
+ render(
)
+
+ await user.click(screen.getByRole('button', { name: /later/i }))
+ expect(onCancel).toHaveBeenCalled()
+ })
+
+ it('disables confirm button and shows Restarting... when isRestarting is true', () => {
+ render(
)
+
+ const confirmButton = screen.getByRole('button', { name: /restarting/i })
+ expect(confirmButton).toBeDisabled()
+ expect(screen.getByText('Restarting...')).toBeInTheDocument()
+ })
+
+ it('disables confirm button and shows Saving... when isSaving is true', () => {
+ render(
)
+
+ const confirmButton = screen.getByRole('button', { name: /saving/i })
+ expect(confirmButton).toBeDisabled()
+ expect(screen.getByText('Saving...')).toBeInTheDocument()
+ })
+
+ it('disables Later button when isRestarting is true', () => {
+ render(
)
+
+ const laterButton = screen.getByRole('button', { name: /later/i })
+ expect(laterButton).toBeDisabled()
+ })
+})
diff --git a/frontend/src/components/settings/RestartServerDialog.tsx b/frontend/src/components/settings/RestartServerDialog.tsx
new file mode 100644
index 00000000..bfea86e6
--- /dev/null
+++ b/frontend/src/components/settings/RestartServerDialog.tsx
@@ -0,0 +1,56 @@
+import { Button } from '@/components/ui/button'
+import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from '@/components/ui/dialog'
+import { Loader2 } from 'lucide-react'
+
+interface RestartServerDialogProps {
+ open: boolean
+ onOpenChange: (open: boolean) => void
+ onConfirm: () => void
+ onCancel: () => void
+ isSaving?: boolean
+ isRestarting?: boolean
+}
+
+export function RestartServerDialog({
+ open,
+ onOpenChange,
+ onConfirm,
+ onCancel,
+ isSaving = false,
+ isRestarting = false,
+}: RestartServerDialogProps) {
+ const isConfirmDisabled = isSaving || isRestarting
+
+ return (
+
+ )
+}
diff --git a/frontend/src/components/skills/SkillLibraryList.tsx b/frontend/src/components/skills/SkillLibraryList.tsx
index fd569b40..0bcdcfc6 100644
--- a/frontend/src/components/skills/SkillLibraryList.tsx
+++ b/frontend/src/components/skills/SkillLibraryList.tsx
@@ -1,14 +1,9 @@
import { useMemo, useState } from 'react'
-import { AlertCircle, Loader2, MoreHorizontal, Search } from 'lucide-react'
+import { Search } from 'lucide-react'
import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
import { Badge } from '@/components/ui/badge'
-import {
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuItem,
- DropdownMenuTrigger,
-} from '@/components/ui/dropdown-menu'
+import { SettingsList, SettingsListRow } from '@/components/ui/settings-list'
import type { SkillFileInfo, SkillScope } from '@opencode-manager/shared'
type SkillFilter = 'all' | SkillScope
@@ -100,77 +95,38 @@ export function SkillLibraryList({