Skip to content

The agent that grows with you

fix(desktop): plugin settings pages use native Settings rows

Tekniuma731ffcc49be
diff --git a/apps/desktop/src/app/overlays/overlay-split-layout.test.tsx b/apps/desktop/src/app/overlays/overlay-split-layout.test.tsx
index 2a4fdd6a8e4..ba6cb2e3226 100644
--- a/apps/desktop/src/app/overlays/overlay-split-layout.test.tsx
+++ b/apps/desktop/src/app/overlays/overlay-split-layout.test.tsx
@@ -40,3 +40,38 @@ it('expands independently of navigation and reveals a newly selected child', ()
expect(rail.getByRole('button', { name: 'General' }).getAttribute('aria-current')).toBe('page')
expect(rail.getByRole('button', { name: 'Collapse: Appearance' }).getAttribute('aria-expanded')).toBe('true')
})
+
+it('fills only the current page when a third-level sub-page is open; its parent is named, not filled', () => {
+ const noop = vi.fn()
+
+ const groups: OverlayNavGroup[] = [
+ {
+ active: true,
+ id: 'plugins',
+ label: 'Plugins',
+ icon: Settings2,
+ onSelect: noop,
+ children: [
+ {
+ active: true,
+ id: 'hello',
+ label: 'Hello Runtime',
+ icon: Settings2,
+ onSelect: noop,
+ children: [{ active: true, id: 'about', label: 'About', icon: Settings2, onSelect: noop }]
+ }
+ ]
+ }
+ ]
+
+ const { container } = render(<OverlayNav groups={groups} />)
+ const rail = within(container.querySelector('[data-tour="overlay-nav"]') as HTMLElement)
+ const parent = rail.getByRole('button', { name: 'Hello Runtime' })
+ const page = rail.getByRole('button', { name: 'About' })
+
+ expect(page.getAttribute('aria-current')).toBe('page')
+ expect(page.className).toContain('bg-(--chrome-action-hover)')
+ expect(parent.getAttribute('aria-current')).toBeNull()
+ expect(parent.className).toContain('bg-transparent')
+ expect(parent.className).toContain('font-medium')
+})
diff --git a/apps/desktop/src/app/overlays/overlay-split-layout.tsx b/apps/desktop/src/app/overlays/overlay-split-layout.tsx
index d4938275b41..494c6400f6d 100644
--- a/apps/desktop/src/app/overlays/overlay-split-layout.tsx
+++ b/apps/desktop/src/app/overlays/overlay-split-layout.tsx
@@ -121,7 +121,11 @@ export const OverlayNavItem = memo(function OverlayNavItem({
'flex h-7 w-full items-center justify-start gap-2 rounded-md border px-2 text-left text-[length:var(--conversation-text-font-size)] font-normal transition-colors',
nested
? active
- ? 'border-transparent bg-(--chrome-action-hover) font-medium text-foreground'
+ ? current
+ ? 'border-transparent bg-(--chrome-action-hover) font-medium text-foreground'
+ : // Ancestor of the current page (a plugin whose sub-page is open):
+ // named, not filled, so exactly one nested row reads as selected.
+ 'border-transparent bg-transparent font-medium text-foreground hover:bg-(--chrome-action-hover)'
: 'border-transparent bg-transparent text-(--ui-text-tertiary) hover:bg-(--chrome-action-hover) hover:text-foreground'
: active
? 'border-(--ui-stroke-tertiary) bg-(--ui-bg-tertiary) text-foreground'
diff --git a/apps/desktop/src/app/settings/plugin-settings-form.test.tsx b/apps/desktop/src/app/settings/plugin-settings-form.test.tsx
index 94efb07a394..d646eb11b7d 100644
--- a/apps/desktop/src/app/settings/plugin-settings-form.test.tsx
+++ b/apps/desktop/src/app/settings/plugin-settings-form.test.tsx
@@ -3,7 +3,14 @@ import { afterEach, describe, expect, it, vi } from 'vitest'
import type { PluginSettingField } from '@/store/agent-plugins'
-import { collectChanges, initialDraft, PluginSettingsForm } from './plugin-settings-form'
+import {
+ collectChanges,
+ fieldLabel,
+ humanizeSettingKey,
+ initialDraft,
+ joinSentences,
+ PluginSettingsForm
+} from './plugin-settings-form'
const FIELDS: PluginSettingField[] = [
{
@@ -41,7 +48,7 @@ describe('PluginSettingsForm (#46600, #87934)', () => {
afterEach(cleanup)
it('renders one control per schema type from the table, secrets masked with no value echoed', () => {
- render(<PluginSettingsForm disabled={false} fields={FIELDS} idPrefix="p" onSave={vi.fn(async () => true)} />)
+ render(<PluginSettingsForm disabled={false} fields={FIELDS} idPrefix="p" onSave={vi.fn(async () => true)} title="Demo" />)
expect((screen.getByLabelText('API URL') as HTMLInputElement).value).toBe('https://a')
expect((screen.getByLabelText(/^Retries/) as HTMLInputElement).type).toBe('number')
@@ -58,7 +65,7 @@ describe('PluginSettingsForm (#46600, #87934)', () => {
it('submits only what changed, coerced to wire types, secrets routed by env name; clears secrets after save', async () => {
const onSave = vi.fn(async () => true)
- render(<PluginSettingsForm disabled={false} fields={FIELDS} idPrefix="p" onSave={onSave} />)
+ render(<PluginSettingsForm disabled={false} fields={FIELDS} idPrefix="p" onSave={onSave} title="Demo" />)
fireEvent.change(screen.getByLabelText(/^Retries/), { target: { value: '9' } })
fireEvent.click(screen.getByRole('switch', { name: 'Verbose' }))
@@ -74,4 +81,60 @@ describe('PluginSettingsForm (#46600, #87934)', () => {
expect(() => collectChanges(FIELDS, { ...initialDraft(FIELDS), mode: 'reckless' })).toThrow(/Mode/)
expect(() => collectChanges(FIELDS, { ...initialDraft(FIELDS), retries: 'five' })).toThrow(/number/)
})
+
+ it('labels raw keys like native rows and joins helper sentences with punctuation', () => {
+ const fields: PluginSettingField[] = [
+ { description: 'Per-day budget', key: 'daily_budget', label: 'daily_budget', required: false, type: 'number', value: 1 },
+ {
+ description: 'Optional maps key for travel-time estimates',
+ env: 'TRIP_NOTES_MAPS_API_KEY',
+ has_value: false,
+ key: 'maps_api_key',
+ label: 'maps_api_key',
+ required: true,
+ type: 'secret'
+ }
+ ]
+
+ render(<PluginSettingsForm disabled={false} fields={fields} idPrefix="t" onSave={vi.fn(async () => true)} title="Trip" />)
+
+ expect(screen.getByLabelText('Daily budget')).toBeTruthy()
+ expect(screen.getByLabelText('Maps API key')).toBeTruthy()
+ expect(screen.queryByText('daily_budget')).toBeNull()
+ expect(
+ screen.getByText(
+ "Optional maps key for travel-time estimates. Stored in the profile's .env as TRIP_NOTES_MAPS_API_KEY, never in config.yaml; leave blank to keep the current value."
+ )
+ ).toBeTruthy()
+ // Only required fields are marked; optional is the unmarked default, as in native Settings.
+ expect(screen.getAllByText('Required')).toHaveLength(1)
+ expect(screen.queryByText('(optional)')).toBeNull()
+ })
+})
+
+describe('plugin settings labels and helper copy', () => {
+ it('humanizes keys in sentence case, keeping acronyms upper-case', () => {
+ expect(humanizeSettingKey('daily_budget')).toBe('Daily budget')
+ expect(humanizeSettingKey('remind_me')).toBe('Remind me')
+ expect(humanizeSettingKey('maps_api_key')).toBe('Maps API key')
+ expect(humanizeSettingKey('webhook_url')).toBe('Webhook URL')
+ expect(humanizeSettingKey('mcp_server_id')).toBe('MCP server ID')
+ expect(humanizeSettingKey('apiBaseURL')).toBe('API base URL')
+ expect(humanizeSettingKey('allowed-channel-ids')).toBe('Allowed channel IDs')
+ expect(humanizeSettingKey('units')).toBe('Units')
+ })
+
+ it("prefers the manifest's label/title over the humanized key", () => {
+ expect(fieldLabel({ key: 'units', label: 'Unit system' })).toBe('Unit system')
+ // The backend falls back to the bare key when the manifest gave no label.
+ expect(fieldLabel({ key: 'maps_api_key', label: 'maps_api_key' })).toBe('Maps API key')
+ })
+
+ it('ends each sentence before the next begins and drops blanks', () => {
+ expect(joinSentences('Optional maps key', 'Stored in .env.')).toBe('Optional maps key. Stored in .env.')
+ expect(joinSentences('Already ends.', 'Next')).toBe('Already ends. Next')
+ expect(joinSentences('Ask first?', 'Then save.')).toBe('Ask first? Then save.')
+ expect(joinSentences('', ' Only this ', undefined)).toBe('Only this')
+ expect(joinSentences('Lone description')).toBe('Lone description')
+ })
})
diff --git a/apps/desktop/src/app/settings/plugin-settings-form.tsx b/apps/desktop/src/app/settings/plugin-settings-form.tsx
index 55a4bf96b7c..0a216c068c3 100644
--- a/apps/desktop/src/app/settings/plugin-settings-form.tsx
+++ b/apps/desktop/src/app/settings/plugin-settings-form.tsx
@@ -1,14 +1,18 @@
import { type ReactNode, useMemo, useState } from 'react'
import { Button } from '@/components/ui/button'
-import { Field, FieldHint } from '@/components/ui/field'
import { Input } from '@/components/ui/input'
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'
import { Switch } from '@/components/ui/switch'
import { Textarea } from '@/components/ui/textarea'
import { useI18n } from '@/i18n'
+import { Loader2, Save, SlidersHorizontal } from '@/lib/icons'
+import { cn } from '@/lib/utils'
import type { PluginSettingField, PluginSettingFieldType } from '@/store/agent-plugins'
+import { CONTROL_TEXT } from './constants'
+import { ListRow, Pill, SectionHeading } from './primitives'
+
// A plugin manifest's `config_schema` rendered as a form. Every non-secret
// value is edited as TEXT (the draft) and coerced to its wire type on save, so a
// half-typed number never fights the input; secrets are drafted separately and
@@ -31,6 +35,78 @@ interface ControlProps {
secretSetHint: string
}
+// Words a humanized key keeps upper-case ("maps_api_key" → "Maps API key").
+const KEY_ACRONYMS = new Set([
+ 'ai',
+ 'api',
+ 'cpu',
+ 'css',
+ 'dns',
+ 'gpu',
+ 'html',
+ 'http',
+ 'https',
+ 'id',
+ 'ip',
+ 'json',
+ 'llm',
+ 'mcp',
+ 'oauth',
+ 'sql',
+ 'ssh',
+ 'ssl',
+ 'tls',
+ 'tts',
+ 'ui',
+ 'uri',
+ 'url',
+ 'xml'
+])
+
+const ACRONYM_SPELLING: Record<string, string> = { ids: 'IDs', oauth: 'OAuth', urls: 'URLs' }
+
+/** A config key as a sentence-case label: `daily_budget` → "Daily budget",
+ * `maps_api_key` → "Maps API key", `webhookURL` → "Webhook URL". */
+export function humanizeSettingKey(key: string): string {
+ const words = key
+ .replace(/([a-z0-9])([A-Z])/g, '$1 $2')
+ .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')
+ .split(/[\s_.\-/]+/)
+ .filter(Boolean)
+
+ return words
+ .map((word, index) => {
+ const lower = word.toLowerCase()
+
+ if (ACRONYM_SPELLING[lower]) {
+ return ACRONYM_SPELLING[lower]
+ }
+
+ if (KEY_ACRONYMS.has(lower)) {
+ return lower.toUpperCase()
+ }
+
+ return index === 0 ? lower.charAt(0).toUpperCase() + lower.slice(1) : lower
+ })
+ .join(' ')
+}
+
+/** The row label: the manifest's `label`/`title` when it gave one (the backend
+ * falls back to the bare key), else the key humanized. */
+export function fieldLabel(field: Pick<PluginSettingField, 'key' | 'label'>): string {
+ const label = field.label.trim()
+
+ return label && label !== field.key ? label : humanizeSettingKey(field.key)
+}
+
+/** Helper copy from independent sentences (a plugin's description, the secret
+ * storage note): each part ends its sentence before the next begins. */
+export function joinSentences(...parts: (null | string | undefined)[]): string {
+ const kept = parts.map(part => part?.trim() ?? '').filter(Boolean)
+
+ return kept.map((part, index) => (index < kept.length - 1 && !/[.!?。!?…:;]$/.test(part) ? `${part}.` : part)).join(' ')
+}
+
/** What the input shows before the user touches it. */
const INITIAL_TEXT: Record<PluginSettingFieldType, (field: PluginSettingField) => string> = {
boolean: field => (field.value === true ? 'true' : 'false'),
@@ -46,7 +122,7 @@ const COERCE: Record<Exclude<PluginSettingFieldType, 'secret'>, (raw: string, fi
boolean: raw => raw === 'true',
enum: (raw, field) => {
if (!field.choices?.includes(raw)) {
- throw new Error(`${field.label}: not one of ${field.choices?.join(', ') ?? ''}`)
+ throw new Error(`${fieldLabel(field)}: not one of ${field.choices?.join(', ') ?? ''}`)
}
return raw
@@ -55,7 +131,7 @@ const COERCE: Record<Exclude<PluginSettingFieldType, 'secret'>, (raw: string, fi
const parsed: unknown = JSON.parse(raw || 'null')
if (parsed === null || typeof parsed !== 'object') {
- throw new Error(`${field.label}: expected a JSON list or object`)
+ throw new Error(`${fieldLabel(field)}: expected a JSON list or object`)
}
return parsed
@@ -64,7 +140,7 @@ const COERCE: Record<Exclude<PluginSettingFieldType, 'secret'>, (raw: string, fi
const n = Number(raw)
if (raw.trim() === '' || Number.isNaN(n)) {
- throw new Error(`${field.label}: expected a number`)
+ throw new Error(`${fieldLabel(field)}: expected a number`)
}
return n
@@ -72,7 +148,7 @@ const COERCE: Record<Exclude<PluginSettingFieldType, 'secret'>, (raw: string, fi
string: raw => raw
}
-const TEXT_CLASS = 'h-7 text-xs'
+const TEXT_CLASS = cn('w-full', CONTROL_TEXT)
function StringControl({ disabled, id, onChange, raw }: ControlProps) {
return (
@@ -103,7 +179,7 @@ function NumberControl({ disabled, id, onChange, raw }: ControlProps) {
function BooleanControl({ disabled, field, id, onChange, raw }: ControlProps) {
return (
<Switch
- aria-label={field.label}
+ aria-label={fieldLabel(field)}
checked={raw === 'true'}
disabled={disabled}
id={id}
@@ -115,7 +191,7 @@ function BooleanControl({ disabled, field, id, onChange, raw }: ControlProps) {
function EnumControl({ disabled, field, id, onChange, raw }: ControlProps) {
return (
<Select disabled={disabled} onValueChange={onChange} value={raw}>
- <SelectTrigger aria-label={field.label} className={TEXT_CLASS} id={id}>
+ <SelectTrigger aria-label={fieldLabel(field)} className={TEXT_CLASS} id={id}>
<SelectValue />
</SelectTrigger>
<SelectContent>
@@ -148,7 +224,7 @@ function SecretControl({ disabled, field, id, onChange, raw, secretSetHint }: Co
function JsonControl({ disabled, id, onChange, raw }: ControlProps) {
return (
<Textarea
- className="min-h-16 font-mono text-xs"
+ className={cn('min-h-28 resize-y bg-background font-mono', CONTROL_TEXT)}
disabled={disabled}
id={id}
onChange={e => onChange(e.currentTarget.value)}
@@ -204,13 +280,19 @@ export function PluginSettingsForm({
fields,
idPrefix,
disabled,
- onSave
+ intro,
+ onSave,
+ title
}: {
fields: PluginSettingField[]
idPrefix: string
disabled: boolean
+ /** Lead copy under the page heading (the plugin's description). */
+ intro?: ReactNode
/** Resolves true when everything landed; the form then re-seeds from `fields`. */
onSave: (changes: PluginSettingsSave) => Promise<boolean>
+ /** Page title; the Settings breadcrumb owns it, embedded callers show it. */
+ title: string
}) {
const { t } = useI18n()
const s = t.skills.plugins.settingsForm
@@ -218,6 +300,7 @@ export function PluginSettingsForm({
const [draft, setDraft] = useState<PluginSettingsDraft>(seed)
const [seedRef, setSeedRef] = useState(seed)
const [error, setError] = useState<null | string>(null)
+ const [saving, setSaving] = useState(false)
// The row's refreshed copy re-seeds the form (a saved value becomes the new baseline).
if (seedRef !== seed) {
@@ -239,61 +322,97 @@ export function PluginSettingsForm({
}
setError(null)
+ setSaving(true)
- if (await onSave(changes)) {
- // Secrets are never echoed back; clear them so the placeholder shows "set".
- setDraft(current =>
- Object.fromEntries(fields.map(field => [field.key, field.type === 'secret' ? '' : (current[field.key] ?? '')]))
- )
+ try {
+ if (await onSave(changes)) {
+ // Secrets are never echoed back; clear them so the placeholder shows "set".
+ setDraft(current =>
+ Object.fromEntries(fields.map(field => [field.key, field.type === 'secret' ? '' : (current[field.key] ?? '')]))
+ )
+ }
+ } finally {
+ setSaving(false)
}
}
return (
<form
- className="grid gap-3"
data-testid={`${idPrefix}-settings-form`}
onSubmit={event => {
event.preventDefault()
void save()
}}
>
- <div className="grid items-start gap-3 sm:grid-cols-2">
+ {/* The page's one action rides the heading row, like every Settings page
+ with a primary action (Passwords & Logins' Add): never mid-canvas. */}
+ <SectionHeading
+ aside={
+ <Button className="gap-1.5" disabled={disabled || saving || !dirty} size="sm" type="submit">
+ {saving ? <Loader2 className="size-3.5 animate-spin" /> : <Save className="size-3.5" />}
+ {s.save}
+ </Button>
+ }
+ icon={SlidersHorizontal}
+ page
+ title={title}
+ />
+ {intro}
+ {error && (
+ <p className="mb-1 text-[length:var(--conversation-caption-font-size)] text-destructive" role="alert">
+ {error}
+ </p>
+ )}
+ <div>
{fields.map(field => {
const id = `${idPrefix}-${field.key}`
const Control = FIELD_CONTROLS[field.type]
+ const label = fieldLabel(field)
+
+ const control = (
+ <Control
+ disabled={disabled || saving}
+ field={field}
+ id={id}
+ onChange={raw => setDraft(current => ({ ...current, [field.key]: raw }))}
+ raw={draft[field.key] ?? ''}
+ secretSetHint={s.secretSet}
+ />
+ )
- return (
- <Field
- htmlFor={id}
+ const description =
+ joinSentences(field.description, field.type === 'secret' && field.env ? s.secretStoredAs(field.env) : '') ||
+ undefined
+
+ const rowTitle = (
+ <span className="inline-flex flex-wrap items-center gap-2">
+ <label htmlFor={id}>{label}</label>
+ {field.required && <Pill>{s.required}</Pill>}
+ </span>
+ )
+
+ // Editors too big for the control column take the full width under
+ // the description, as native config rows do.
+ return field.type === 'json' ? (
+ <ListRow
+ below={<div className="mt-3">{control}</div>}
+ data-tour={`plugin-field-${field.key}`}
+ description={description}
key={field.key}
- label={field.label}
- optional={!field.required}
- optionalLabel={s.optional}
- >
- <Control
- disabled={disabled}
- field={field}
- id={id}
- onChange={raw => setDraft(current => ({ ...current, [field.key]: raw }))}
- raw={draft[field.key] ?? ''}
- secretSetHint={s.secretSet}
- />
- {(field.description || field.type === 'secret') && (
- <FieldHint>
- {field.description}
- {field.type === 'secret' && field.env ? ` ${s.secretStoredAs(field.env)}` : ''}
- </FieldHint>
- )}
- </Field>
+ title={rowTitle}
+ wide
+ />
+ ) : (
+ <ListRow
+ action={control}
+ data-tour={`plugin-field-${field.key}`}
+ description={description}
+ key={field.key}
+ title={rowTitle}
+ />
)
})}
</div>
- {error && <FieldHint error>{error}</FieldHint>}
- <div className="flex items-center justify-end gap-2">
- <Button disabled={disabled || !dirty} size="xs" type="submit" variant="outline">
- {s.save}
- </Button>
- </div>
</form>
)
}
diff --git a/apps/desktop/src/app/settings/plugin-settings.test.tsx b/apps/desktop/src/app/settings/plugin-settings.test.tsx
index 690675a9465..adcf5dbff87 100644
--- a/apps/desktop/src/app/settings/plugin-settings.test.tsx
+++ b/apps/desktop/src/app/settings/plugin-settings.test.tsx
@@ -119,10 +119,15 @@ describe('Settings ▸ Plugins', () => {
fireEvent.click(railItem('plugins:agent:notes')!)
const region = screen.getByLabelText(/Region/) as HTMLInputElement
+ const saveButton = screen.getByRole('button', { name: 'Save settings' }) as HTMLButtonElement
expect(region.value).toBe('us')
+ // The page action sits on the heading row above the fields, disabled until an edit.
+ expect(saveButton.compareDocumentPosition(region) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy()
+ expect(saveButton.disabled).toBe(true)
fireEvent.change(region, { target: { value: 'eu' } })
- fireEvent.click(screen.getByRole('button', { name: 'Save settings' }))
+ expect(saveButton.disabled).toBe(false)
+ fireEvent.click(saveButton)
await waitFor(() =>
expect(requestGateway).toHaveBeenCalledWith('plugins.manage', {
diff --git a/apps/desktop/src/app/settings/plugin-settings.tsx b/apps/desktop/src/app/settings/plugin-settings.tsx
index 596d64fc9f7..71d833589d0 100644
--- a/apps/desktop/src/app/settings/plugin-settings.tsx
+++ b/apps/desktop/src/app/settings/plugin-settings.tsx
@@ -4,6 +4,7 @@ import { useLocation, useNavigate } from 'react-router'
import { setEnvVar } from '@/api/config'
import { useGatewayRequest } from '@/app/gateway/hooks/use-gateway-request'
+import { Button } from '@/components/ui/button'
import { Codicon, codiconIcon } from '@/components/ui/codicon'
import { $pluginRecords } from '@/contrib/plugins-store'
import { ContribBoundary, ContribRender } from '@/contrib/react/boundary'
@@ -33,7 +34,7 @@ import type { OverlayNavLink } from '../overlays/overlay-split-layout'
import { CAPABILITIES_ROUTE } from '../routes'
import { PluginSettingsForm } from './plugin-settings-form'
-import { EmptyState, ListRowSkeleton, SettingsContent } from './primitives'
+import { EmptyState, ListRowSkeleton, SectionHeading, SettingsContent } from './primitives'
import { SettingsProfileScope } from './profile-scope'
/** Opens Settings ▸ Plugins at an entry (by key) and optional sub-page;
@@ -177,19 +178,9 @@ export function pluginSettingsNavChildren(
})
}
-function ManagePluginsLink() {
- const { t } = useI18n()
-
- return (
- <a
- className="inline-flex items-center gap-1 text-[length:var(--conversation-caption-font-size)] text-(--ui-text-secondary) underline-offset-2 hover:text-foreground hover:underline"
- href={MANAGE_PLUGINS_HREF}
- >
- {t.settings.pluginPages.manage}
- <Codicon name="arrow-right" size="0.75rem" />
- </a>
- )
-}
+// Lead copy under a page heading, the same caption rhythm native pages use.
+const BLURB_CLASS =
+ 'mb-2 text-[length:var(--conversation-caption-font-size)] leading-(--conversation-caption-line-height) text-(--ui-text-tertiary)'
function PluginSettingsOverview({
entries,
@@ -205,51 +196,58 @@ function PluginSettingsOverview({
return (
<SettingsContent>
- <div className="grid max-w-3xl gap-4">
- <div className="flex flex-wrap items-baseline justify-between gap-2">
- <p className="text-[length:var(--conversation-caption-font-size)] leading-(--conversation-caption-line-height) text-(--ui-text-tertiary)">
- {copy.blurb}
- </p>
- <ManagePluginsLink />
- </div>
- {missing && (
- <p className="text-[length:var(--conversation-caption-font-size)] text-(--ui-text-secondary)" role="status">
- {copy.missing}
- </p>
- )}
- {entries.length === 0 ? (
- <EmptyState title={copy.empty} />
- ) : (
- <div className="grid overflow-hidden rounded-lg border border-(--ui-stroke-tertiary)">
- {entries.map(entry => {
- const Icon = entryIcon(entry)
- // The landing page counts as one; sub-pages add to it.
- const pages = entry.children.length + 1
-
- return (
- <button
- className="flex min-h-11 items-center gap-3 border-b border-(--ui-stroke-tertiary) px-3 text-left transition-colors last:border-b-0 hover:bg-(--chrome-action-hover)"
- data-testid={`plugin-settings-row-${entry.key}`}
- key={entry.key}
- onClick={() => onOpen(entry.key)}
- type="button"
- >
- <Icon className="size-4 shrink-0 text-(--ui-text-tertiary)" />
- <span className="min-w-0 flex-1 truncate text-[length:var(--conversation-text-font-size)]">
- {entry.title}
+ <SectionHeading
+ aside={
+ // Page-level action on the heading row, like Passwords & Logins' Add.
+ <Button asChild className="gap-1.5" size="sm" variant="outline">
+ <a href={MANAGE_PLUGINS_HREF}>
+ {copy.manage}
+ <Codicon name="arrow-right" size="0.75rem" />
+ </a>
+ </Button>
+ }
+ icon={PLUGINS_NAV_ICON}
+ page
+ title={t.settings.nav.plugins}
+ />
+ <p className={BLURB_CLASS}>{copy.blurb}</p>
+ {missing && (
+ <p className="mb-2 text-[length:var(--conversation-caption-font-size)] text-(--ui-text-secondary)" role="status">
+ {copy.missing}
+ </p>
+ )}
+ {entries.length === 0 ? (
+ <EmptyState title={copy.empty} />
+ ) : (
+ <div className="mt-2 grid overflow-hidden rounded-lg border border-(--ui-stroke-tertiary)">
+ {entries.map(entry => {
+ const Icon = entryIcon(entry)
+ // The landing page counts as one; sub-pages add to it.
+ const pages = entry.children.length + 1
+
+ return (
+ <button
+ className="flex min-h-11 items-center gap-3 border-b border-(--ui-stroke-tertiary) px-3 text-left transition-colors last:border-b-0 hover:bg-(--chrome-action-hover)"
+ data-testid={`plugin-settings-row-${entry.key}`}
+ key={entry.key}
+ onClick={() => onOpen(entry.key)}
+ type="button"
+ >
+ <Icon className="size-4 shrink-0 text-(--ui-text-tertiary)" />
+ <span className="min-w-0 flex-1 truncate text-[length:var(--conversation-text-font-size)]">
+ {entry.title}
+ </span>
+ {pages > 1 && (
+ <span className="shrink-0 text-[length:var(--conversation-caption-font-size)] text-(--ui-text-tertiary)">
+ {copy.pageCount(pages)}
</span>
- {pages > 1 && (
- <span className="shrink-0 text-[length:var(--conversation-caption-font-size)] text-(--ui-text-tertiary)">
- {copy.pageCount(pages)}
- </span>
- )}
- <Codicon className="text-(--ui-text-tertiary)" name="chevron-right" size="0.8rem" />
- </button>
- )
- })}
- </div>
- )}
- </div>
+ )}
+ <Codicon className="text-(--ui-text-tertiary)" name="chevron-right" size="0.8rem" />
+ </button>
+ )
+ })}
+ </div>
+ )}
</SettingsContent>
)
}
@@ -267,39 +265,38 @@ function PluginSchemaSettingsPage({ agentKey }: { agentKey: string }) {
return (
<SettingsContent>
- <div className="grid max-w-3xl gap-4">
- <SettingsProfileScope />
- {row?.description && (
- <p className="text-[length:var(--conversation-caption-font-size)] leading-(--conversation-caption-line-height) text-(--ui-text-tertiary)">
- {row.description}
- </p>
- )}
- {row?.settings_schema?.length ? (
- <PluginSettingsForm
- disabled={busy}
- fields={row.settings_schema}
- idPrefix={`plugin-settings-${agentKey}`}
- onSave={async changes => {
- const ok = await saveAgentPluginSettings(requestGateway, {
- failMessage: p.settingsForm.saveFailed(row.name),
- key: agentKey,
- profile: scope ?? null,
- secrets: changes.secrets,
- values: changes.values,
- writeSecret: (env, value) => setEnvVar(env, value, scope)
- })
-
- if (ok) {
- notify({ kind: 'success', message: p.settingsForm.saved(row.name) })
- }
-
- return ok
- }}
- />
- ) : (
+ <SettingsProfileScope className="mb-5" />
+ {row?.settings_schema?.length ? (
+ <PluginSettingsForm
+ disabled={busy}
+ fields={row.settings_schema}
+ idPrefix={`plugin-settings-${agentKey}`}
+ intro={row.description ? <p className={BLURB_CLASS}>{row.description}</p> : undefined}
+ onSave={async changes => {
+ const ok = await saveAgentPluginSettings(requestGateway, {
+ failMessage: p.settingsForm.saveFailed(row.name),
+ key: agentKey,
+ profile: scope ?? null,
+ secrets: changes.secrets,
+ values: changes.values,
+ writeSecret: (env, value) => setEnvVar(env, value, scope)
+ })
+
+ if (ok) {
+ notify({ kind: 'success', message: p.settingsForm.saved(row.name) })
+ }
+
+ return ok
+ }}
+ title={row.name}
+ />
+ ) : (
+ <div className="grid gap-1">
+ <ListRowSkeleton />
<ListRowSkeleton />
- )}
- </div>
+ <ListRowSkeleton />
+ </div>
+ )}
</SettingsContent>
)
}
diff --git a/apps/desktop/src/i18n/de.ts b/apps/desktop/src/i18n/de.ts
index 3b147c848a6..4935c2be222 100644
--- a/apps/desktop/src/i18n/de.ts
+++ b/apps/desktop/src/i18n/de.ts
@@ -2912,7 +2912,7 @@ export const deOverrides = {
save: 'Einstellungen speichern',
saved: (name: string) => `Einstellungen von ${name} gespeichert.`,
saveFailed: (name: string) => `Einstellungen von ${name} konnten nicht gespeichert werden`,
- optional: '(optional)',
+ required: 'Erforderlich',
secretSet: '•••••••• (gesetzt)',
secretStoredAs: (env: string) =>
`Wird in der .env des Profils als ${env} gespeichert, nie in config.yaml; leer lassen, um den aktuellen Wert zu behalten.`
diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts
index e01584e844d..f3278813f28 100644
--- a/apps/desktop/src/i18n/en.ts
+++ b/apps/desktop/src/i18n/en.ts
@@ -2562,7 +2562,7 @@ export const en: Translations = {
save: 'Save settings',
saved: (name: string) => `${name} settings saved.`,
saveFailed: (name: string) => `Could not save ${name} settings`,
- optional: '(optional)',
+ required: 'Required',
secretSet: '•••••••• (set)',
secretStoredAs: (env: string) =>
`Stored in the profile's .env as ${env}, never in config.yaml; leave blank to keep the current value.`
diff --git a/apps/desktop/src/i18n/es.ts b/apps/desktop/src/i18n/es.ts
index 17245f15292..05713001876 100644
--- a/apps/desktop/src/i18n/es.ts
+++ b/apps/desktop/src/i18n/es.ts
@@ -2906,7 +2906,7 @@ export const esOverrides = {
save: 'Guardar configuración',
saved: (name: string) => `Configuración de ${name} guardada.`,
saveFailed: (name: string) => `No se pudo guardar la configuración de ${name}`,
- optional: '(opcional)',
+ required: 'Obligatorio',
secretSet: '•••••••• (configurado)',
secretStoredAs: (env: string) =>
`Se guarda en el .env del perfil como ${env}, nunca en config.yaml; déjalo en blanco para conservar el valor actual.`
diff --git a/apps/desktop/src/i18n/fr.ts b/apps/desktop/src/i18n/fr.ts
index 1019efea710..746edc3735a 100644
--- a/apps/desktop/src/i18n/fr.ts
+++ b/apps/desktop/src/i18n/fr.ts
@@ -2924,7 +2924,7 @@ export const frOverrides = {
save: 'Enregistrer les paramètres',
saved: (name: string) => `Paramètres de ${name} enregistrés.`,
saveFailed: (name: string) => `Impossible d’enregistrer les paramètres de ${name}`,
- optional: '(facultatif)',
+ required: 'Obligatoire',
secretSet: '•••••••• (défini)',
secretStoredAs: (env: string) =>
`Stocké dans le .env du profil sous ${env}, jamais dans config.yaml ; laissez vide pour conserver la valeur actuelle.`
diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.ts
index d0d6125dbc2..4562c236327 100644
--- a/apps/desktop/src/i18n/types.ts
+++ b/apps/desktop/src/i18n/types.ts
@@ -2163,7 +2163,7 @@ export interface Translations {
save: string
saved: (name: string) => string
saveFailed: (name: string) => string
- optional: string
+ required: string
secretSet: string
secretStoredAs: (env: string) => string
}
diff --git a/apps/desktop/src/plugins/hello-runtime/plugin.runtime.js b/apps/desktop/src/plugins/hello-runtime/plugin.runtime.js
index c4ebdbbe00a..4d9792551d2 100644
--- a/apps/desktop/src/plugins/hello-runtime/plugin.runtime.js
+++ b/apps/desktop/src/plugins/hello-runtime/plugin.runtime.js
@@ -14,6 +14,8 @@ import { jsx, jsxs } from 'react/jsx-runtime'
const DEFAULTS = { label: 'word', showChip: true }
+const GATEWAY_STATUS = { closed: 'Disconnected', connecting: 'Connecting…', error: 'Error', idle: 'Idle', open: 'Connected' }
+
function RuntimeChip({ prefs }) {
const gateway = useValue(host.state.gateway)
const { label, showChip } = useValue(prefs)
@@ -84,8 +86,8 @@ export default {
],
value: label
}),
- description: 'How much room the chip takes in the status bar.',
- title: 'Label'
+ description: 'Show the word next to the ⚡, or the icon alone to save room.',
+ title: 'Chip style'
})
}
},
@@ -101,7 +103,14 @@ export default {
description: 'Plain ESM loaded through the runtime pipeline (blob import + SDK injection).',
title: 'Loaded at runtime'
}),
- jsx(ListRow, { description: String(gateway), title: 'Gateway' })
+ jsx(ListRow, {
+ action: jsx('span', {
+ className: 'text-[length:var(--conversation-caption-font-size)] text-(--ui-text-secondary)',
+ children: GATEWAY_STATUS[gateway] ?? String(gateway)
+ }),
+ description: 'The chip reads this live through host.state.gateway.',
+ title: 'Gateway connection'
+ })
]
})
}
diff --git a/locales/_keys.desktop.json b/locales/_keys.desktop.json
index b14bd7a410c..45b07f2cc9e 100644
--- a/locales/_keys.desktop.json
+++ b/locales/_keys.desktop.json
@@ -4403,7 +4403,7 @@
"skills.plugins.serverStates.unknown",
"skills.plugins.serverStates.unsupported_gpu",
"skills.plugins.serverStates.version_too_old",
- "skills.plugins.settingsForm.optional",
+ "skills.plugins.settingsForm.required",
"skills.plugins.settingsForm.save",
"skills.plugins.settingsForm.saveFailed",
"skills.plugins.settingsForm.saved",
diff --git a/website/docs/developer-guide/plugins/index.md b/website/docs/developer-guide/plugins/index.md
index f81f15384a0..9447a26faf3 100644
--- a/website/docs/developer-guide/plugins/index.md
+++ b/website/docs/developer-guide/plugins/index.md
@@ -676,8 +676,9 @@ Config and state have different owners: settings are user-visible behavior in
### Settings form in the Desktop
-Every key you declare in the manifest's `config_schema` renders as a field in the
-Desktop app's **Capabilities → Plugins** tab (the gear on the plugin's row). No
+Every key you declare in the manifest's `config_schema` renders as a row on the
+plugin's own page under the Desktop app's **Settings → Plugins** (the gear on the
+plugin's Capabilities → Plugins row opens it). No
Desktop code is needed: the backend's `plugins.manage list` returns the schema
plus each key's current value, and saving writes through the same writer as
`ctx.set_config()`, so `plugins.entries.<id>.settings.<key>` is what your plugin
@@ -691,8 +692,9 @@ reads back. The form is table-driven by `type`:
| `list`, `dict` | JSON editor | |
| `secret` | masked input | `env: MY_PLUGIN_TOKEN` — the `.env` variable it is stored under (default `<PLUGIN_ID>_<KEY>` upper-snaked) |
-Every entry also accepts `label` (shown instead of the key), `description`
-(help text under the field), `default` and `required`.
+Every entry also accepts `label` (or `title`; without one the key is shown in
+sentence case, `maps_api_key` → "Maps API key"), `description` (help text under
+the label), `default` and `required` (marks the row **Required**).
```yaml
config_schema: