AI-native design editor. Open-source Figma alternative.
feat: show model capabilities directly and build Settings editors from shared parts (#1486)
Danila Poyarkov385c1c4e184b
diff --git a/changes/1486/changed.md b/changes/1486/changed.mdnew file mode 100644index 000000000..085ab0e28--- /dev/null+++ b/changes/1486/changed.md@@ -0,0 +1 @@+- The model editor shows a model's capabilities, output limit, and thinking level directly instead of under **Advanced settings**, and the media, MCP connection, and storage editors slide in from their lists like it, returning focus to the row that opened them.diff --git a/changes/1486/fixed.md b/changes/1486/fixed.mdnew file mode 100644index 000000000..cc8d3a01f--- /dev/null+++ b/changes/1486/fixed.md@@ -0,0 +1 @@+- In Settings, the model and provider fields, such as a model's name and API keys, use the same fill as the selects beside them, and every switch row and description uses the same text sizes.diff --git a/packages/vue/src/i18n/locales/de/ai.json b/packages/vue/src/i18n/locales/de/ai.jsonindex 0e49f9fcf..f8771d8b9 100644--- a/packages/vue/src/i18n/locales/de/ai.json+++ b/packages/vue/src/i18n/locales/de/ai.json@@ -136,7 +136,6 @@"customModelID": "Benutzerdefinierte Modell-ID","customModel": "Benutzerdefiniertes Modell…","customModelGroup": "Eigenes Modell",- "advancedModelSettings": "Erweiterte Einstellungen","outputLimit": "Ausgabelimit","outputLimitAutomatic": "Automatische Empfehlung","maxOutputTokens": "Maximale Ausgabetoken",diff --git a/packages/vue/src/i18n/locales/de/automation.json b/packages/vue/src/i18n/locales/de/automation.jsonindex af1cc2111..db1835d00 100644--- a/packages/vue/src/i18n/locales/de/automation.json+++ b/packages/vue/src/i18n/locales/de/automation.json@@ -67,7 +67,7 @@"noMatchingTools": "Keine Tools entsprechen deiner Suche.","connectionNameHint": "Verwende einen eindeutigen Namen mit höchstens 80 Zeichen. Der Name open-pencil ist reserviert.","connectionNameInvalid": "Wähle einen eindeutigen Namen mit höchstens 80 Zeichen, der nicht open-pencil lautet.",- "serverURLHint": "Verwende HTTPS. HTTP ist nur für localhost oder eine Loopback-Adresse erlaubt. Die URL darf keine Zugangsdaten enthalten.",+ "serverURLHint": "Der Server muss Streamable HTTP unterstützen. Verwende HTTPS. HTTP ist nur für localhost oder eine Loopback-Adresse erlaubt. Die URL darf keine Zugangsdaten enthalten.","mcpFailureNotInstalled": "MCP-Server ist nicht installiert","mcpFailureNotInstalledHint": "Damit der OpenPencil-Download klein bleibt, wird der MCP-Server separat installiert.","mcpFailureOutdated": "MCP-Server passt nicht zu dieser OpenPencil-Version",diff --git a/packages/vue/src/i18n/locales/es/ai.json b/packages/vue/src/i18n/locales/es/ai.jsonindex 9fa7d7aef..ace91d329 100644--- a/packages/vue/src/i18n/locales/es/ai.json+++ b/packages/vue/src/i18n/locales/es/ai.json@@ -142,7 +142,6 @@"customModelID": "ID de modelo personalizado","customModel": "Modelo personalizado…","customModelGroup": "Modelo personalizado",- "advancedModelSettings": "Ajustes avanzados","outputLimit": "Límite de salida","outputLimitAutomatic": "Recomendación automática","maxOutputTokens": "Tokens de salida máx.",diff --git a/packages/vue/src/i18n/locales/es/automation.json b/packages/vue/src/i18n/locales/es/automation.jsonindex d1d1dbc1c..d7d810ace 100644--- a/packages/vue/src/i18n/locales/es/automation.json+++ b/packages/vue/src/i18n/locales/es/automation.json@@ -67,7 +67,7 @@"noMatchingTools": "Ninguna herramienta coincide con tu búsqueda.","connectionNameHint": "Usa un nombre único de hasta 80 caracteres. El nombre open-pencil está reservado.","connectionNameInvalid": "Elige un nombre único de hasta 80 caracteres que no sea open-pencil.",- "serverURLHint": "Usa HTTPS. HTTP solo se permite para localhost o una dirección de bucle local. No incluyas credenciales en la URL.",+ "serverURLHint": "El servidor debe admitir Streamable HTTP. Usa HTTPS. HTTP solo se permite para localhost o una dirección de bucle local. No incluyas credenciales en la URL.","mcpFailureNotInstalled": "El servidor MCP no está instalado","mcpFailureNotInstalledHint": "Para que la descarga de OpenPencil sea pequeña, el servidor MCP se instala por separado.","mcpFailureOutdated": "El servidor MCP no coincide con esta versión de OpenPencil",diff --git a/packages/vue/src/i18n/locales/fr/ai.json b/packages/vue/src/i18n/locales/fr/ai.jsonindex 997acd142..738b7a7c5 100644--- a/packages/vue/src/i18n/locales/fr/ai.json+++ b/packages/vue/src/i18n/locales/fr/ai.json@@ -136,7 +136,6 @@"customModelID": "ID du modèle personnalisé","customModel": "Modèle personnalisé…","customModelGroup": "Modèle personnalisé",- "advancedModelSettings": "Paramètres avancés","outputLimit": "Limite de sortie","outputLimitAutomatic": "Recommandation automatique","maxOutputTokens": "Jetons de sortie maximum",diff --git a/packages/vue/src/i18n/locales/fr/automation.json b/packages/vue/src/i18n/locales/fr/automation.jsonindex bc6c69aa3..9610fabea 100644--- a/packages/vue/src/i18n/locales/fr/automation.json+++ b/packages/vue/src/i18n/locales/fr/automation.json@@ -67,7 +67,7 @@"noMatchingTools": "Aucun outil ne correspond à votre recherche.","connectionNameHint": "Utilisez un nom unique de 80 caractères maximum. Le nom open-pencil est réservé.","connectionNameInvalid": "Choisissez un nom unique de 80 caractères maximum, différent de open-pencil.",- "serverURLHint": "Utilisez HTTPS. HTTP n’est autorisé que pour localhost ou une adresse de bouclage. N’incluez pas d’identifiants dans l’URL.",+ "serverURLHint": "Le serveur doit prendre en charge Streamable HTTP. Utilisez HTTPS. HTTP n’est autorisé que pour localhost ou une adresse de bouclage. N’incluez pas d’identifiants dans l’URL.","mcpFailureNotInstalled": "Le serveur MCP n’est pas installé","mcpFailureNotInstalledHint": "Pour que le téléchargement d’OpenPencil reste léger, le serveur MCP s’installe séparément.","mcpFailureOutdated": "Le serveur MCP ne correspond pas à cette version d’OpenPencil",diff --git a/packages/vue/src/i18n/locales/it/ai.json b/packages/vue/src/i18n/locales/it/ai.jsonindex 83bc4fa09..53afa7d2f 100644--- a/packages/vue/src/i18n/locales/it/ai.json+++ b/packages/vue/src/i18n/locales/it/ai.json@@ -142,7 +142,6 @@"customModelID": "ID modello personalizzato","customModel": "Modello personalizzato…","customModelGroup": "Modello personalizzato",- "advancedModelSettings": "Impostazioni avanzate","outputLimit": "Limite di output","outputLimitAutomatic": "Raccomandazione automatica","maxOutputTokens": "Token di output massimi",diff --git a/packages/vue/src/i18n/locales/it/automation.json b/packages/vue/src/i18n/locales/it/automation.jsonindex 2d839d436..7e1ba07d8 100644--- a/packages/vue/src/i18n/locales/it/automation.json+++ b/packages/vue/src/i18n/locales/it/automation.json@@ -67,7 +67,7 @@"noMatchingTools": "Nessuno strumento corrisponde alla ricerca.","connectionNameHint": "Usa un nome univoco di massimo 80 caratteri. Il nome open-pencil è riservato.","connectionNameInvalid": "Scegli un nome univoco di massimo 80 caratteri, diverso da open-pencil.",- "serverURLHint": "Usa HTTPS. HTTP è consentito solo per localhost o un indirizzo di loopback. Non includere credenziali nell’URL.",+ "serverURLHint": "Il server deve supportare Streamable HTTP. Usa HTTPS. HTTP è consentito solo per localhost o un indirizzo di loopback. Non includere credenziali nell’URL.","mcpFailureNotInstalled": "Il server MCP non è installato","mcpFailureNotInstalledHint": "Per mantenere leggero il download di OpenPencil, il server MCP si installa separatamente.","mcpFailureOutdated": "Il server MCP non corrisponde a questa versione di OpenPencil",diff --git a/packages/vue/src/i18n/locales/ja/ai.json b/packages/vue/src/i18n/locales/ja/ai.jsonindex 55b151702..94bdc362a 100644--- a/packages/vue/src/i18n/locales/ja/ai.json+++ b/packages/vue/src/i18n/locales/ja/ai.json@@ -142,7 +142,6 @@"customModelID": "カスタムモデル ID","customModel": "カスタムモデル…","customModelGroup": "カスタムモデル",- "advancedModelSettings": "詳細設定","outputLimit": "出力上限","outputLimitAutomatic": "自動推奨値","maxOutputTokens": "最大出力トークン数",diff --git a/packages/vue/src/i18n/locales/ja/automation.json b/packages/vue/src/i18n/locales/ja/automation.jsonindex 533690353..310d15459 100644--- a/packages/vue/src/i18n/locales/ja/automation.json+++ b/packages/vue/src/i18n/locales/ja/automation.json@@ -67,7 +67,7 @@"noMatchingTools": "検索に一致するツールはありません。","connectionNameHint": "80 文字以内の重複しない名前を使用してください。open-pencil は予約済みです。","connectionNameInvalid": "open-pencil 以外の、80 文字以内で重複しない名前を選んでください。",- "serverURLHint": "HTTPS を使用してください。HTTP は localhost またはループバックアドレスでのみ使用できます。URL に認証情報を含めないでください。",+ "serverURLHint": "サーバーは Streamable HTTP に対応している必要があります。HTTPS を使用してください。HTTP は localhost またはループバックアドレスでのみ使用できます。URL に認証情報を含めないでください。","mcpFailureNotInstalled": "MCP サーバーがインストールされていません","mcpFailureNotInstalledHint": "OpenPencil のダウンロードサイズを小さく保つため、MCP サーバーは別途インストールします。","mcpFailureOutdated": "MCP サーバーがこのバージョンの OpenPencil と一致しません",diff --git a/packages/vue/src/i18n/locales/pl/ai.json b/packages/vue/src/i18n/locales/pl/ai.jsonindex 5cdfb9923..de5f8d17e 100644--- a/packages/vue/src/i18n/locales/pl/ai.json+++ b/packages/vue/src/i18n/locales/pl/ai.json@@ -136,7 +136,6 @@"customModelID": "Identyfikator modelu niestandardowego","customModel": "Model niestandardowy…","customModelGroup": "Własny model",- "advancedModelSettings": "Ustawienia zaawansowane","outputLimit": "Limit wyjścia","outputLimitAutomatic": "Automatyczna rekomendacja","maxOutputTokens": "Maks. tokenów wyjściowych",diff --git a/packages/vue/src/i18n/locales/pl/automation.json b/packages/vue/src/i18n/locales/pl/automation.jsonindex e4565ed1c..e7d5f1fb4 100644--- a/packages/vue/src/i18n/locales/pl/automation.json+++ b/packages/vue/src/i18n/locales/pl/automation.json@@ -67,7 +67,7 @@"noMatchingTools": "Brak narzędzi pasujących do wyszukiwania.","connectionNameHint": "Użyj unikalnej nazwy o długości do 80 znaków. Nazwa open-pencil jest zarezerwowana.","connectionNameInvalid": "Wybierz unikalną nazwę o długości do 80 znaków, inną niż open-pencil.",- "serverURLHint": "Użyj HTTPS. HTTP jest dozwolone tylko dla localhost lub adresu pętli zwrotnej. Nie umieszczaj danych uwierzytelniających w adresie URL.",+ "serverURLHint": "Serwer musi obsługiwać Streamable HTTP. Użyj HTTPS. HTTP jest dozwolone tylko dla localhost lub adresu pętli zwrotnej. Nie umieszczaj danych uwierzytelniających w adresie URL.","mcpFailureNotInstalled": "Serwer MCP nie jest zainstalowany","mcpFailureNotInstalledHint": "Aby pobieranie OpenPencil było niewielkie, serwer MCP instaluje się osobno.","mcpFailureOutdated": "Serwer MCP nie pasuje do tej wersji OpenPencil",diff --git a/packages/vue/src/i18n/locales/ru/ai.json b/packages/vue/src/i18n/locales/ru/ai.jsonindex 24e843e3b..ab28bf7db 100644--- a/packages/vue/src/i18n/locales/ru/ai.json+++ b/packages/vue/src/i18n/locales/ru/ai.json@@ -136,7 +136,6 @@"customModelID": "ID пользовательской модели","customModel": "Пользовательская модель…","customModelGroup": "Своя модель",- "advancedModelSettings": "Расширенные настройки","outputLimit": "Лимит вывода","outputLimitAutomatic": "Автоматическая рекомендация","maxOutputTokens": "Максимум выходных токенов",diff --git a/packages/vue/src/i18n/locales/ru/automation.json b/packages/vue/src/i18n/locales/ru/automation.jsonindex db627c00a..e3de9727e 100644--- a/packages/vue/src/i18n/locales/ru/automation.json+++ b/packages/vue/src/i18n/locales/ru/automation.json@@ -67,7 +67,7 @@"noMatchingTools": "По вашему запросу инструменты не найдены.","connectionNameHint": "Укажите уникальное название длиной до 80 символов. Название open-pencil зарезервировано.","connectionNameInvalid": "Выберите уникальное название длиной до 80 символов, отличное от open-pencil.",- "serverURLHint": "Используйте HTTPS. HTTP разрешён только для localhost или адреса обратной петли. Не включайте учётные данные в URL.",+ "serverURLHint": "Сервер должен поддерживать Streamable HTTP. Используйте HTTPS. HTTP разрешён только для localhost или адреса обратной петли. Не включайте учётные данные в URL.","mcpFailureNotInstalled": "MCP-сервер не установлен","mcpFailureNotInstalledHint": "Чтобы загрузка OpenPencil оставалась небольшой, MCP-сервер устанавливается отдельно.","mcpFailureOutdated": "MCP-сервер не соответствует этой версии OpenPencil",diff --git a/packages/vue/src/i18n/locales/zh-cn/ai.json b/packages/vue/src/i18n/locales/zh-cn/ai.jsonindex 8dd88ba48..aa936677f 100644--- a/packages/vue/src/i18n/locales/zh-cn/ai.json+++ b/packages/vue/src/i18n/locales/zh-cn/ai.json@@ -142,7 +142,6 @@"customModelID": "自定义模型 ID","customModel": "自定义模型…","customModelGroup": "自定义模型",- "advancedModelSettings": "高级设置","outputLimit": "输出限制","outputLimitAutomatic": "自动建议","maxOutputTokens": "最大输出词元数",diff --git a/packages/vue/src/i18n/locales/zh-cn/automation.json b/packages/vue/src/i18n/locales/zh-cn/automation.jsonindex fe2c46004..c115fab58 100644--- a/packages/vue/src/i18n/locales/zh-cn/automation.json+++ b/packages/vue/src/i18n/locales/zh-cn/automation.json@@ -67,7 +67,7 @@"noMatchingTools": "没有与搜索匹配的工具。","connectionNameHint": "使用不超过 80 个字符的唯一名称。open-pencil 为保留名称。","connectionNameInvalid": "请选择不超过 80 个字符且不是 open-pencil 的唯一名称。",- "serverURLHint": "请使用 HTTPS。仅 localhost 或回环地址允许使用 HTTP。请勿在 URL 中包含凭据。",+ "serverURLHint": "服务器必须支持 Streamable HTTP。请使用 HTTPS。仅 localhost 或回环地址允许使用 HTTP。请勿在 URL 中包含凭据。","mcpFailureNotInstalled": "未安装 MCP 服务器","mcpFailureNotInstalledHint": "为了让 OpenPencil 的下载体积保持较小,MCP 服务器需要单独安装。","mcpFailureOutdated": "MCP 服务器与此版本的 OpenPencil 不匹配",diff --git a/packages/vue/src/i18n/messages/ai.ts b/packages/vue/src/i18n/messages/ai.tsindex 3459c9e62..254563452 100644--- a/packages/vue/src/i18n/messages/ai.ts+++ b/packages/vue/src/i18n/messages/ai.ts@@ -195,7 +195,6 @@ export const aiMessageDefaults = {customModelID: 'Custom model ID',customModel: 'Custom model…',customModelGroup: 'Custom model',- advancedModelSettings: 'Advanced settings',outputLimit: 'Output limit',outputLimitAutomatic: 'Automatic recommendation',maxOutputTokens: 'Max output tokens',diff --git a/packages/vue/src/i18n/messages/automation.ts b/packages/vue/src/i18n/messages/automation.tsindex 49d5606b1..c78cd038e 100644--- a/packages/vue/src/i18n/messages/automation.ts+++ b/packages/vue/src/i18n/messages/automation.ts@@ -71,7 +71,7 @@ export const automationMessageDefaults = {connectionNameHint: 'Use a unique name, up to 80 characters. The name open-pencil is reserved.',connectionNameInvalid: 'Choose a unique name of at most 80 characters, other than open-pencil.',serverURLHint:- 'Use HTTPS. HTTP is allowed only for localhost or a loopback address. Do not include credentials in the URL.',+ 'The server must support Streamable HTTP. Use HTTPS. HTTP is allowed only for localhost or a loopback address. Do not include credentials in the URL.',serverURL: 'MCP server URL',enableConnection: 'Enable for ACP agents',bearerAuthentication: 'Use bearer authentication',diff --git a/src/app/ai/models/settings/profile-editor/selection.ts b/src/app/ai/models/settings/profile-editor/selection.tsindex 9eda87483..c734970f0 100644--- a/src/app/ai/models/settings/profile-editor/selection.ts+++ b/src/app/ai/models/settings/profile-editor/selection.ts@@ -18,16 +18,7 @@ import { useCloudModelSelection } from './cloud'export function useProfileModelSelection(draft: AIModelProfileDraft,- ai: Readonly<Ref<ModelPickerLabels & { customModel: string }>>,- {- applyCatalogDetails = (apply) => apply()- }: {- /**- * Applies what the catalog says about the model once it has been read. The read finishes- * after the editor opens, so the editor decides whether its changes count as edits.- */- applyCatalogDetails?: (apply: () => void) => void- } = {}+ ai: Readonly<Ref<ModelPickerLabels & { customModel: string }>>) {const CUSTOM_MODEL_VALUE = '__custom__'const DEFAULT_MAX_OUTPUT_TOKENS = 16384@@ -122,11 +113,9 @@ export function useProfileModelSelection(const modelID = effectiveModelID()const resolved = await resolveModelsDevModel(providerID, modelID)if (providerID !== draft.providerID || modelID !== effectiveModelID()) return-- applyCatalogDetails(() => {- catalogModel.value = resolved- applyKnownModelMetadata()- })+ // Shown at once, written into the profile on save: a read that finishes after the editor+ // opens is not an edit.+ catalogModel.value = resolved}function applyKnownModelMetadata(): void {diff --git a/src/app/ai/models/settings/profile-editor/use.ts b/src/app/ai/models/settings/profile-editor/use.tsindex 4e38c0c07..c96bbdf3b 100644--- a/src/app/ai/models/settings/profile-editor/use.ts+++ b/src/app/ai/models/settings/profile-editor/use.ts@@ -1,6 +1,6 @@import { tryOnScopeDispose } from '@vueuse/core'import { isEqual } from 'es-toolkit'-import { computed, reactive, ref, shallowRef, toRaw, watch } from 'vue'+import { computed, reactive, ref, toRaw, watch } from 'vue'import type { Ref } from 'vue'import type { AIProviderID } from '@open-pencil/core/constants'@@ -30,7 +30,7 @@ interface ProfileEditorOptions {export function useModelProfileEditor({ profileId, keyInput, labels: ai }: ProfileEditorOptions) {const draft = reactive(createModelProfileDraft(profileId))- const selection = useProfileModelSelection(draft, ai, { applyCatalogDetails })+ const selection = useProfileModelSelection(draft, ai)const {providerDef,isACP,@@ -56,18 +56,7 @@ export function useModelProfileEditor({ profileId, keyInput, labels: ai }: Proficonst saveResult = ref<SettingsSaveResult | null>(null)const busy = ref(false)/** What the draft was when the editor opened, which unsaved changes are measured against. */- const baseline = shallowRef(structuredClone(toRaw(draft)))-- /**- * The catalog's capabilities and output limit land after the editor opens. On an unchanged- * draft they are not the person's edits, so they move the baseline with them; a key typed- * meanwhile is not part of the draft and stays an edit of its own.- */- function applyCatalogDetails(apply: () => void): void {- const untouched = isEqual(draft, baseline.value)- apply()- if (untouched) baseline.value = structuredClone(toRaw(draft))- }+ const baseline = structuredClone(toRaw(draft))tryOnScopeDispose(() => {keyInput.value = ''})@@ -84,7 +73,7 @@ export function useModelProfileEditor({ profileId, keyInput, labels: ai }: Profi} = useProfileConnection({ draft, keyInput })const dirty = computed(- () => !isEqual(draft, baseline.value) || keyInput.value.length > 0 || keyCleared.value+ () => !isEqual(draft, baseline) || keyInput.value.length > 0 || keyCleared.value)const canDelete = computed(() => (profileId ? canRemoveModelProfile(profileId) : false))diff --git a/src/components/settings/SettingsDialog.vue b/src/components/settings/SettingsDialog.vueindex e9231a615..a1c6d1821 100644--- a/src/components/settings/SettingsDialog.vue+++ b/src/components/settings/SettingsDialog.vue@@ -18,6 +18,7 @@ import { CloudSettingsSection } from '@/components/cloud/integration'import ChatSettingsSection from '@/components/settings/chat/ChatSettingsSection.vue'import DiagnosticsSettingsPanel from '@/components/settings/diagnostics/DiagnosticsSettingsPanel.vue'import GeneralSettingsPanel from '@/components/settings/general/GeneralSettingsPanel.vue'+import SettingsBreadcrumb from '@/components/settings/layout/SettingsBreadcrumb.vue'import SettingsPage from '@/components/settings/layout/SettingsPage.vue'import MCPWorkspacePanel from '@/components/settings/mcp/MCPWorkspacePanel.vue'import MediaSettingsPanel from '@/components/settings/media/MediaSettingsPanel.vue'@@ -94,28 +95,15 @@ function onOpenChange(open: boolean): void {:description="settings.description":close-label="common.close">- <!-- An open editor turns the title into the path back to where it was opened from. -->+ <!-- An open editor turns the title into the path back to where it was opened from. On a+ phone the section picker below already names the section, so the path starts at the+ list. --><template v-if="crumb" #title>- <span class="flex min-w-0 items-center gap-1.5" data-test-id="settings-breadcrumb">- <button- type="button"- class="cursor-pointer rounded-sm text-muted hover:text-surface focus-visible:ring-2 focus-visible:ring-accent/50 focus-visible:outline-none"- @click="navigation.back()"- >- {{ settings.title }}- </button>- <icon-lucide-chevron-right class="size-3.5 shrink-0 text-muted" aria-hidden="true" />- <button- type="button"- class="cursor-pointer rounded-sm text-muted hover:text-surface focus-visible:ring-2 focus-visible:ring-accent/50 focus-visible:outline-none"- data-test-id="settings-editor-back"- @click="navigation.back()"- >- {{ crumb.parent }}- </button>- <icon-lucide-chevron-right class="size-3.5 shrink-0 text-muted" aria-hidden="true" />- <span class="truncate" aria-current="page">{{ crumb.title }}</span>- </span>+ <SettingsBreadcrumb+ :steps="isMobile ? [crumb.parent] : [settings.title, crumb.parent]"+ :current="crumb.title"+ @back="navigation.back()"+ /></template></AppDialogHeader>diff --git a/src/components/settings/cloud/CloudWaitlist.vue b/src/components/settings/cloud/CloudWaitlist.vueindex d7bd974c4..2c9efba70 100644--- a/src/components/settings/cloud/CloudWaitlist.vue+++ b/src/components/settings/cloud/CloudWaitlist.vue@@ -6,9 +6,9 @@ import { useStorageMessages } from '@open-pencil/vue/i18n'import { useWaitlistSignup } from '@/app/cloud/waitlist/signup'import { openExternalLink } from '@/app/shell/ui'import ProviderSettingsField from '@/components/settings/provider/ProviderSettingsField.vue'+import ProviderSettingsInput from '@/components/settings/provider/ProviderSettingsInput.vue'import AppButton from '@/components/ui/button/AppButton.vue'import AppAlert from '@/components/ui/feedback/AppAlert.vue'-import AppInput from '@/components/ui/input/AppInput.vue'import { CLOUD_WAITLIST_URL, IS_TAURI } from '@/constants'import { cloudServers } from '@/theme/cloud/servers'@@ -67,12 +67,11 @@ const failure = computed(() => {:label="storage.waitlistEmail":error="status === 'invalid' ? storage.waitlistInvalid : undefined">- <AppInput+ <ProviderSettingsInputv-bind="control"v-model="email"type="email"autocomplete="email"- tone="panel":placeholder="storage.waitlistPlaceholder":disabled="submitting"@update:model-value="edit"diff --git a/src/components/settings/credentials/CredentialSettingsSection.vue b/src/components/settings/credentials/CredentialSettingsSection.vueindex c1a5173ce..4555ccec1 100644--- a/src/components/settings/credentials/CredentialSettingsSection.vue+++ b/src/components/settings/credentials/CredentialSettingsSection.vue@@ -4,6 +4,7 @@ import { useI18n } from '@open-pencil/vue/i18n'import { useCredentialSettings } from '@/app/settings/credentials/preferences/use'import SettingsGroup from '@/components/settings/layout/SettingsGroup.vue'+import SettingsRow from '@/components/settings/layout/SettingsRow.vue'import SettingsSection from '@/components/settings/layout/SettingsSection.vue'import AppButton from '@/components/ui/button/AppButton.vue'import AppAlert from '@/components/ui/feedback/AppAlert.vue'@@ -17,15 +18,13 @@ const { busy, paused, failed, checkFailed, remembered, retry, retryCheck } = use<SettingsSection v-if="!IS_TAURI || paused || failed || checkFailed"><template #title>{{ credentials.settingsTitle }}</template><SettingsGroup v-if="!IS_TAURI">- <label class="flex items-center justify-between gap-4 px-3 py-2.5">- <span>- <span class="block text-xs text-surface">{{ credentials.rememberDevice }}</span>- <span v-if="!remembered" class="block text-[11px] text-muted">{{- credentials.sessionOnly- }}</span>- </span>+ <SettingsRow+ as="label"+ :label="credentials.rememberDevice"+ :description="!remembered ? credentials.sessionOnly : undefined"+ ><AppSwitch v-model="remembered" :label="credentials.rememberDevice" />- </label>+ </SettingsRow></SettingsGroup><AppAlert v-if="checkFailed" tone="warning" :heading="credentials.checkFailed"><template #actions>diff --git a/src/components/settings/diagnostics/DiagnosticsEventList.vue b/src/components/settings/diagnostics/DiagnosticsEventList.vueindex 2d9ede1e7..4132db744 100644--- a/src/components/settings/diagnostics/DiagnosticsEventList.vue+++ b/src/components/settings/diagnostics/DiagnosticsEventList.vue@@ -89,7 +89,7 @@ const categoryOptions = computed(() => [<icon-lucide-info v-else class="size-3.5 shrink-0 text-muted" /><span class="min-w-0"><span class="block truncate text-surface">{{ event.label }}</span>- <span v-if="event.detail" class="block truncate text-[10px] text-muted">{{+ <span v-if="event.detail" class="block truncate text-[11px] text-muted">{{event.detail}}</span></span>@@ -97,7 +97,7 @@ const categoryOptions = computed(() => [<span class="shrink-0 text-muted">{{ dates.format(event.timestamp, 'clock') }}</span></CollapsibleTrigger><CollapsibleContent :class="collapsibleContentMotion">- <div class="space-y-1.5 px-3 pb-2.5 pl-8.5 font-mono text-[10px] text-muted">+ <div class="space-y-1.5 px-3 pb-2.5 pl-8.5 font-mono text-[11px] text-muted"><dl class="grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5"><template v-for="[name, value] in event.fields" :key="name"><dt>{{ name }}</dt>diff --git a/src/components/settings/diagnostics/DiagnosticsSettingsPanel.vue b/src/components/settings/diagnostics/DiagnosticsSettingsPanel.vueindex d3fb9d349..eec18754d 100644--- a/src/components/settings/diagnostics/DiagnosticsSettingsPanel.vue+++ b/src/components/settings/diagnostics/DiagnosticsSettingsPanel.vue@@ -79,24 +79,20 @@ async function saveDiagnostics() {<template #title>{{ diagnosticMessages.title }}</template><template #description>{{ diagnosticMessages.description }}</template><SettingsGroup>- <label class="flex items-center justify-between gap-4 px-3 py-2.5">- <span- ><span class="block text-xs text-surface">{{ diagnosticMessages.localDiagnostics }}</span- ><span class="block text-[10px] text-muted">{{- diagnosticMessages.localDiagnosticsDescription- }}</span></span- >+ <SettingsRow+ as="label"+ :label="diagnosticMessages.localDiagnostics"+ :description="diagnosticMessages.localDiagnosticsDescription"+ ><AppSwitch v-model="diagnosticsEnabled" :label="diagnosticMessages.localDiagnostics" />- </label>- <label class="flex items-center justify-between gap-4 px-3 py-2.5">- <span- ><span class="block text-xs text-surface">{{ diagnosticMessages.usageHistory }}</span- ><span v-if="usageEnabled" class="block text-[10px] text-muted">{{- diagnosticMessages.usageHistoryDescription- }}</span></span- >+ </SettingsRow>+ <SettingsRow+ as="label"+ :label="diagnosticMessages.usageHistory"+ :description="usageEnabled ? diagnosticMessages.usageHistoryDescription : undefined"+ ><AppSwitch v-model="usageEnabled" :label="diagnosticMessages.usageHistory" />- </label>+ </SettingsRow><SettingsRow:label="diagnosticMessages.retention":description="diagnosticMessages.retentionDescription"diff --git a/src/components/settings/general/GeneralSettingsPanel.vue b/src/components/settings/general/GeneralSettingsPanel.vueindex f6a58fd80..e58f9d60b 100644--- a/src/components/settings/general/GeneralSettingsPanel.vue+++ b/src/components/settings/general/GeneralSettingsPanel.vue@@ -123,19 +123,17 @@ const snapToPixelGrid = computed({<template #title>{{ recovery.settingsTitle }}</template><SettingsGroup>- <label class="flex items-center justify-between gap-4 px-3 py-2.5">- <span>- <span class="block text-xs text-surface">{{ recovery.preserveUnsavedWork }}</span>- <span class="block text-[10px] text-muted">{{- recovery.preserveUnsavedWorkDescription- }}</span>- </span>+ <SettingsRow+ as="label"+ :label="recovery.preserveUnsavedWork"+ :description="recovery.preserveUnsavedWorkDescription"+ ><AppSwitchv-model="preserveUnsavedWork":label="recovery.preserveUnsavedWork"data-test-id="settings-recovery-enabled"/>- </label>+ </SettingsRow></SettingsGroup></SettingsSection>@@ -144,45 +142,39 @@ const snapToPixelGrid = computed({<template #description>{{ settings.snappingDescription }}</template><SettingsGroup>- <label class="flex items-center justify-between gap-4 px-3 py-2.5">- <span>- <span class="block text-xs text-surface">{{ settings.snapToGeometry }}</span>- <span class="block text-[10px] text-muted">{{- settings.snapToGeometryDescription- }}</span>- </span>+ <SettingsRow+ as="label"+ :label="settings.snapToGeometry"+ :description="settings.snapToGeometryDescription"+ ><AppSwitchv-model="snapToGeometry":label="settings.snapToGeometry"data-test-id="settings-snap-geometry"/>- </label>- <label class="flex items-center justify-between gap-4 px-3 py-2.5">- <span>- <span class="block text-xs text-surface">{{ settings.snapToObjects }}</span>- <span class="block text-[10px] text-muted">{{- settings.snapToObjectsDescription- }}</span>- </span>+ </SettingsRow>+ <SettingsRow+ as="label"+ :label="settings.snapToObjects"+ :description="settings.snapToObjectsDescription"+ ><AppSwitchv-model="snapToObjects":label="settings.snapToObjects"data-test-id="settings-snap-objects"/>- </label>- <label class="flex items-center justify-between gap-4 px-3 py-2.5">- <span>- <span class="block text-xs text-surface">{{ settings.snapToPixelGrid }}</span>- <span class="block text-[10px] text-muted">{{- settings.snapToPixelGridDescription- }}</span>- </span>+ </SettingsRow>+ <SettingsRow+ as="label"+ :label="settings.snapToPixelGrid"+ :description="settings.snapToPixelGridDescription"+ ><AppSwitchv-model="snapToPixelGrid":label="settings.snapToPixelGrid"data-test-id="settings-snap-pixel-grid"/>- </label>+ </SettingsRow></SettingsGroup><p class="text-[11px] text-muted">{{ settings.temporaryDisableSnappingHint }}</p>diff --git a/src/components/settings/general/RenderingSettingsSection.vue b/src/components/settings/general/RenderingSettingsSection.vueindex aaf779e7a..19d73d9a6 100644--- a/src/components/settings/general/RenderingSettingsSection.vue+++ b/src/components/settings/general/RenderingSettingsSection.vue@@ -6,6 +6,7 @@ import { useI18n } from '@open-pencil/vue/i18n'import { appRuntimeConfig } from '@/app/runtime/config'import { appPreferences, updateCanvasRenderingMode } from '@/app/settings/preferences/store'import SettingsGroup from '@/components/settings/layout/SettingsGroup.vue'+import SettingsRow from '@/components/settings/layout/SettingsRow.vue'import SettingsSection from '@/components/settings/layout/SettingsSection.vue'import AppAlert from '@/components/ui/feedback/AppAlert.vue'import AppBadge from '@/components/ui/feedback/AppBadge.vue'@@ -29,25 +30,22 @@ function setTiledRendering(enabled: boolean): void {<template #description>{{ rendering.settingsDescription }}</template><SettingsGroup>- <label class="flex items-center justify-between gap-4 px-3 py-2.5">- <span>- <span class="flex flex-wrap items-center gap-2 text-xs text-surface">+ <SettingsRow as="label" :description="rendering.progressiveTiledDescription">+ <template #label>+ <span class="flex flex-wrap items-center gap-2">{{ rendering.progressiveTiled }}<AppBadge :ui="{ base: 'bg-hover text-surface' }">{{rendering.experimental}}</AppBadge></span>- <span class="block text-[10px] text-muted">{{- rendering.progressiveTiledDescription- }}</span>- </span>+ </template><AppSwitch:model-value="tiledRendering":label="rendering.progressiveTiled"data-test-id="settings-progressive-tiled-rendering"@update:model-value="setTiledRendering"/>- </label>+ </SettingsRow></SettingsGroup><AppAlert v-if="hasURLOverride" :heading="rendering.urlOverride" />diff --git a/src/components/settings/layout/SettingsBreadcrumb.vue b/src/components/settings/layout/SettingsBreadcrumb.vuenew file mode 100644index 000000000..2973118a5--- /dev/null+++ b/src/components/settings/layout/SettingsBreadcrumb.vue@@ -0,0 +1,32 @@+<script setup lang="ts">+import { tv } from 'tailwind-variants'++import { vTestId } from '@open-pencil/vue/testing'++import theme from '@/theme/settings/breadcrumb'++/**+ * Where an open editor sits, drawn as the window's title: each earlier step leads back to the+ * list the editor came from, and the editor's own name gives way first to a narrow window.+ */+const { steps, current } = defineProps<{ steps: string[]; current: string }>()+const emit = defineEmits<{ back: [] }>()+const styles = tv(theme)()+</script>++<template>+ <span :class="styles.root()" data-test-id="settings-breadcrumb">+ <template v-for="(step, index) in steps" :key="index">+ <button+ type="button"+ :class="styles.step()"+ v-test-id="index === steps.length - 1 ? 'settings-editor-back' : undefined"+ @click="emit('back')"+ >+ {{ step }}+ </button>+ <icon-lucide-chevron-right :class="styles.separator()" aria-hidden="true" />+ </template>+ <span :class="styles.current()" aria-current="page">{{ current }}</span>+ </span>+</template>diff --git a/src/components/settings/layout/SettingsDisclosure.vue b/src/components/settings/layout/SettingsDisclosure.vueindex 8448bfe73..cbde35dde 100644--- a/src/components/settings/layout/SettingsDisclosure.vue+++ b/src/components/settings/layout/SettingsDisclosure.vue@@ -5,7 +5,8 @@ const open = defineModel<boolean>('open', { default: false })</script><template>- <AppCollapsible v-model:open="open" :ui="{ trigger: 'py-3' }">+ <!-- The chevron glyph is inset in its box; pulling it back lines it up with the fields. -->+ <AppCollapsible v-model:open="open" :ui="{ trigger: 'py-3', icon: '-ml-1' }"><template #label><slot name="label" /></template><template v-if="$slots.actions" #actions><slot name="actions" /></template><div class="pb-3"><slot /></div>diff --git a/src/components/settings/layout/SettingsRow.vue b/src/components/settings/layout/SettingsRow.vueindex 167c8b307..9330f3e97 100644--- a/src/components/settings/layout/SettingsRow.vue+++ b/src/components/settings/layout/SettingsRow.vue@@ -1,14 +1,32 @@<script setup lang="ts">-const { label, description } = defineProps<{ label: string; description?: string }>()+import { Primitive } from 'reka-ui'++/**+ * One line of a `SettingsGroup`: a label, an optional description, and its control on the right.+ * As a `label`, clicking the text works the control, as a switch row does.+ */+const {+ label,+ description,+ as = 'div'+} = defineProps<{ label?: string; description?: string; as?: 'div' | 'label' }>()</script><template>- <div class="flex items-center justify-between gap-4 px-3 py-2.5" data-slot="settings-row">- <div class="min-w-0 flex-1">- <p class="text-xs font-medium text-surface">{{ label }}</p>- <p v-if="description" class="mt-1 text-xs leading-relaxed text-muted">{{ description }}</p>+ <Primitive+ :as="as"+ class="flex items-center justify-between gap-4 px-3 py-2.5"+ data-slot="settings-row"+ >+ <span class="block min-w-0 flex-1">+ <span class="block text-xs font-medium text-surface"+ ><slot name="label">{{ label }}</slot></span+ >+ <span v-if="description" class="mt-1 block text-[11px] leading-relaxed text-muted">{{+ description+ }}</span><slot name="description" />- </div>- <div class="shrink-0"><slot /></div>- </div>+ </span>+ <span class="shrink-0"><slot /></span>+ </Primitive></template>diff --git a/src/components/settings/mcp/MCPConnectionEditor.vue b/src/components/settings/mcp/MCPConnectionEditor.vueindex eb070ae7a..d939bb164 100644--- a/src/components/settings/mcp/MCPConnectionEditor.vue+++ b/src/components/settings/mcp/MCPConnectionEditor.vue@@ -18,9 +18,9 @@ import SettingsPage from '@/components/settings/layout/SettingsPage.vue'import SettingsRow from '@/components/settings/layout/SettingsRow.vue'import SettingsSaveFeedback from '@/components/settings/layout/SettingsSaveFeedback.vue'import ProviderSettingsField from '@/components/settings/provider/ProviderSettingsField.vue'+import ProviderSettingsInput from '@/components/settings/provider/ProviderSettingsInput.vue'import ProviderSettingsKeyField from '@/components/settings/provider/ProviderSettingsKeyField.vue'import AppButton from '@/components/ui/button/AppButton.vue'-import AppInput from '@/components/ui/input/AppInput.vue'import AppSwitch from '@/components/ui/toggle/AppSwitch.vue'const draft = defineModel<MCPConnectionDraft>('draft', { required: true })@@ -71,10 +71,9 @@ defineExpose({ focusInvalid: () => focusInvalidField(formElement.value) }):error="fieldErrors.name"@blur="$emit('blurField', 'name')">- <AppInput+ <ProviderSettingsInputv-bind="control"v-model="draft.name"- tone="panel":aria-label="automation.connectionName"autocomplete="off"/>@@ -86,11 +85,10 @@ defineExpose({ focusInvalid: () => focusInvalidField(formElement.value) }):error="fieldErrors.url"@blur="$emit('blurField', 'url')">- <AppInput+ <ProviderSettingsInputv-bind="control"v-model="draft.url"type="url"- tone="panel":aria-label="automation.serverURL"placeholder="https://example.com/mcp"autocomplete="off"diff --git a/src/components/settings/mcp/MCPConnectionsSection.vue b/src/components/settings/mcp/MCPConnectionsSection.vueindex abd61035b..7a2b99a74 100644--- a/src/components/settings/mcp/MCPConnectionsSection.vue+++ b/src/components/settings/mcp/MCPConnectionsSection.vue@@ -19,6 +19,7 @@ import AppButton from '@/components/ui/button/AppButton.vue'import { AppAlertDialogRoot, AppDialogFooter, AppDialogHeader } from '@/components/ui/dialog'import AppPlaceholder from '@/components/ui/feedback/AppPlaceholder.vue'import AppActionRow from '@/components/ui/list/AppActionRow.vue'+import PanelDrillIn from '@/components/ui/panel/PanelDrillIn.vue'import { MCP_CONNECTIONS_DOCS_URL } from '@/constants'import MCPConnectionEditor from './MCPConnectionEditor.vue'@@ -65,9 +66,15 @@ async function startEdit(id: string) {if (await connection.startEdit(id)) editing.value = true}function cancel() {- connection.cancel()editing.value = false}+/**+ * The draft and token are cleared once the editor has slid away, so it never shows them emptying;+ * an editor opened again meanwhile has set its own.+ */+function closed() {+ if (!editing.value) connection.cancel()+}const submit = form.handleSubmit(async () => {if ((await connection.save()) === 'saved') cancel()})@@ -83,57 +90,60 @@ async function remove() {</script><template>- <MCPConnectionEditor- v-if="editing"- ref="editorElement"- v-model:draft="draft"- v-model:token="tokenDraft"- :token-status="tokenStatus"- :error="error"- :save-result="saveResult"- :field-errors="fieldErrors"- :busy="busy"- @cancel="cancel"- @save="save"- @blur-field="form.blur"- @remove="deleteOpen = true"- @clear="clearCredential"- />- <SettingsPage v-else>- <div class="flex flex-col gap-6">- <slot />- <SettingsSection :aria-busy="busy" data-mcp-connections>- <template #title>{{ automation.connections }}</template>- <template #description>- {{ automation.connectionsDescription }}- <SettingsLink :href="MCP_CONNECTIONS_DOCS_URL">{{ common.learnMore }}</SettingsLink>- </template>- <template #actions>- <AppButton variant="outline" :loading="busy" @click="startAdd">- <template #leading><icon-lucide-plus class="size-3.5" /></template>- {{ automation.addConnection }}- </AppButton>- </template>- <div v-if="mcpConnectionSettings.connections.length" class="flex flex-col gap-1.5">- <AppActionRow- v-for="item in mcpConnectionSettings.connections"- :key="item.id"- :disabled="busy"- @click="startEdit(item.id)"- >- <template #leading><icon-lucide-plug class="size-3.5" /></template>- {{ item.name }}- <template #description>{{ item.transport.url }}</template>- <template #trailing>- <span class="text-xs">{{ item.enabled ? common.enabled : common.disabled }}</span>- <icon-lucide-chevron-right class="size-3.5" />- </template>- </AppActionRow>- </div>- <AppPlaceholder v-else size="compact" :fill="false" :label="automation.noConnections" />- </SettingsSection>- </div>- </SettingsPage>+ <PanelDrillIn :open="editing" @closed="closed">+ <template #detail>+ <MCPConnectionEditor+ ref="editorElement"+ v-model:draft="draft"+ v-model:token="tokenDraft"+ :token-status="tokenStatus"+ :error="error"+ :save-result="saveResult"+ :field-errors="fieldErrors"+ :busy="busy"+ @cancel="cancel"+ @save="save"+ @blur-field="form.blur"+ @remove="deleteOpen = true"+ @clear="clearCredential"+ />+ </template>+ <SettingsPage>+ <div class="flex flex-col gap-6">+ <slot />+ <SettingsSection :aria-busy="busy" data-mcp-connections>+ <template #title>{{ automation.connections }}</template>+ <template #description>+ {{ automation.connectionsDescription }}+ <SettingsLink :href="MCP_CONNECTIONS_DOCS_URL">{{ common.learnMore }}</SettingsLink>+ </template>+ <template #actions>+ <AppButton variant="outline" :loading="busy" @click="startAdd">+ <template #leading><icon-lucide-plus class="size-3.5" /></template>+ {{ automation.addConnection }}+ </AppButton>+ </template>+ <div v-if="mcpConnectionSettings.connections.length" class="flex flex-col gap-1.5">+ <AppActionRow+ v-for="item in mcpConnectionSettings.connections"+ :key="item.id"+ :disabled="busy"+ @click="startEdit(item.id)"+ >+ <template #leading><icon-lucide-plug class="size-3.5" /></template>+ {{ item.name }}+ <template #description>{{ item.transport.url }}</template>+ <template #trailing>+ <span class="text-xs">{{ item.enabled ? common.enabled : common.disabled }}</span>+ <icon-lucide-chevron-right class="size-3.5" />+ </template>+ </AppActionRow>+ </div>+ <AppPlaceholder v-else size="compact" :fill="false" :label="automation.noConnections" />+ </SettingsSection>+ </div>+ </SettingsPage>+ </PanelDrillIn><AppAlertDialogRoot v-model:open="deleteOpen"><AppDialogHeader:heading="automation.deleteConnection"diff --git a/src/components/settings/media/MediaCredentialEditor.vue b/src/components/settings/media/MediaCredentialEditor.vueindex 6aabf9646..00c82e92c 100644--- a/src/components/settings/media/MediaCredentialEditor.vue+++ b/src/components/settings/media/MediaCredentialEditor.vue@@ -12,6 +12,7 @@ import { useMediaSettingsEditor, type MediaSettingsService } from '@/app/settingimport { useSettingsFormGuard } from '@/app/settings/navigation/use'import SettingsPage from '@/components/settings/layout/SettingsPage.vue'import SettingsSaveFeedback from '@/components/settings/layout/SettingsSaveFeedback.vue'+import ProviderSettingsField from '@/components/settings/provider/ProviderSettingsField.vue'import ProviderSettingsKeyField from '@/components/settings/provider/ProviderSettingsKeyField.vue'import AppButton from '@/components/ui/button/AppButton.vue'import AppSelect from '@/components/ui/select/AppSelect.vue'@@ -57,16 +58,20 @@ async function save() {<form class="flex min-h-0 min-w-0 flex-1 flex-col" :aria-busy="busy" @submit.prevent="save"><SettingsPage><div class="flex flex-col gap-5">- <fieldset :disabled="busy" class="flex w-full min-w-0 max-w-md flex-col gap-5">- <label v-if="service === 'vectorize'" class="flex flex-col gap-1.5 text-xs text-surface">- {{ media.vectorizeProvider }}+ <fieldset :disabled="busy" class="flex w-full min-w-0 flex-col gap-5">+ <ProviderSettingsField+ v-if="service === 'vectorize'"+ v-slot="{ control }"+ :label="media.vectorizeProvider"+ ><AppSelect+ v-bind="control"v-model="providerID":options="providerOptions":label="media.vectorizeProvider":disabled="busy"/>- </label>+ </ProviderSettingsField><ProviderSettingsKeyFieldv-model="key":label="keyLabel"diff --git a/src/components/settings/media/MediaSettingsPanel.vue b/src/components/settings/media/MediaSettingsPanel.vueindex b425e8d77..22f1b5024 100644--- a/src/components/settings/media/MediaSettingsPanel.vue+++ b/src/components/settings/media/MediaSettingsPanel.vue@@ -9,10 +9,14 @@ import type { MediaSettingsService } from '@/app/settings/media/use'import SettingsPage from '@/components/settings/layout/SettingsPage.vue'import SettingsSection from '@/components/settings/layout/SettingsSection.vue'import AppActionRow from '@/components/ui/list/AppActionRow.vue'+import { useHeldContent } from '@/components/ui/overlay/held'+import PanelDrillIn from '@/components/ui/panel/PanelDrillIn.vue'import MediaCredentialEditor from './MediaCredentialEditor.vue'const editing = ref<MediaSettingsService | null>(null)+// The editor keeps its service while it slides away.+const editedService = useHeldContent(editing)const settings = useSettingsMessages()const media = useMediaMessages()const stockServices = computed(() => [@@ -25,14 +29,16 @@ const vectorProvider = computed(() =></script><template>- <div class="flex min-h-0 min-w-0 flex-1 flex-col" data-test-id="settings-media-panel">- <MediaCredentialEditor- v-if="editing"- :key="editing"- :service="editing"- @done="editing = null"- />- <SettingsPage v-else>+ <PanelDrillIn :open="editing !== null" data-test-id="settings-media-panel">+ <template #detail>+ <MediaCredentialEditor+ v-if="editedService"+ :key="editedService"+ :service="editedService"+ @done="editing = null"+ />+ </template>+ <SettingsPage><div class="flex flex-col gap-6"><SettingsSection><template #title>{{ settings.media }}</template>@@ -62,5 +68,5 @@ const vectorProvider = computed(() =></SettingsSection></div></SettingsPage>- </div>+ </PanelDrillIn></template>diff --git a/src/components/settings/models/ModelsPanel.vue b/src/components/settings/models/ModelsPanel.vueindex 6f0ec9943..6e687fde7 100644--- a/src/components/settings/models/ModelsPanel.vue+++ b/src/components/settings/models/ModelsPanel.vue@@ -85,14 +85,8 @@ const { connectionState, refresh: refreshAgents } = useModelConnectionStates(sta</script><template>- <PanelDrillIn- :open="editing"- :back="common.back"- :parent="ai.modelsTitle"- back-in-detail- @back="closeEditor"- @open-auto-focus="focusEditor"- >+ <!-- The Settings window's breadcrumb is the way back, so the drill-in draws no back bar. -->+ <PanelDrillIn :open="editing" @open-auto-focus="focusEditor"><template #detail><ProfileEditorref="editor"diff --git a/src/components/settings/models/ProfileCapabilities.vue b/src/components/settings/models/ProfileCapabilities.vuenew file mode 100644index 000000000..fd3e5783c--- /dev/null+++ b/src/components/settings/models/ProfileCapabilities.vue@@ -0,0 +1,94 @@+<script setup lang="ts">+import { computed } from 'vue'++import { useI18n } from '@open-pencil/vue/i18n'++import type { AIModelCapability, HarnessPermissionMode, ThinkingLevel } from '@/app/ai/models'+import { thinkingLevelOptions as buildThinkingLevelOptions } from '@/app/ai/models/thinking'+import SettingsGroup from '@/components/settings/layout/SettingsGroup.vue'+import SettingsRow from '@/components/settings/layout/SettingsRow.vue'+import SettingsSection from '@/components/settings/layout/SettingsSection.vue'+import ProviderSettingsField from '@/components/settings/provider/ProviderSettingsField.vue'+import AppSelect from '@/components/ui/select/AppSelect.vue'+import AppSwitch from '@/components/ui/toggle/AppSwitch.vue'++/**+ * What a model can do and how it answers. A model the catalog knows shows its capabilities; one+ * it doesn't takes them from the person.+ */+const {+ detected,+ capabilities,+ outputTokens,+ thinking = false,+ harness = false+} = defineProps<{+ /** The catalog knows the model, so `capabilities` are its and not editable. */+ detected: boolean+ capabilities: AIModelCapability[]+ outputTokens: number+ /** The provider takes a thinking level. */+ thinking?: boolean+ /** The model runs through the Pi companion, which asks which tools it may use. */+ harness?: boolean+}>()+const tools = defineModel<boolean>('tools', { required: true })+const vision = defineModel<boolean>('vision', { required: true })+const thinkingLevel = defineModel<ThinkingLevel>('thinkingLevel', { required: true })+const permissionMode = defineModel<HarnessPermissionMode>('permissionMode', { required: true })++const { ai, common } = useI18n()+const thinkingLevelOptions = computed(() => buildThinkingLevelOptions(ai.value))+const permissionOptions = computed(() => [+ { value: 'allow-reads', label: ai.value.harnessPermissionReads },+ { value: 'allow-edits', label: ai.value.harnessPermissionEdits },+ { value: 'allow-all', label: ai.value.harnessPermissionAll }+])+const support = (capability: AIModelCapability) =>+ capabilities.includes(capability) ? common.value.supported : common.value.unsupported+</script>++<template>+ <SettingsSection>+ <template #title>{{ ai.modelCapabilities }}</template>+ <template #description>{{+ detected ? ai.modelCapabilitiesDetected : ai.modelCapabilitiesManual+ }}</template>+ <SettingsGroup>+ <SettingsRow :as="detected ? 'div' : 'label'" :label="ai.modelCapabilityTools">+ <span v-if="detected" class="text-xs text-surface">{{ support('tools') }}</span>+ <AppSwitch v-else v-model="tools" :label="ai.modelCapabilityTools" />+ </SettingsRow>+ <SettingsRow :as="detected ? 'div' : 'label'" :label="ai.modelCapabilityVision">+ <span v-if="detected" class="text-xs text-surface">{{ support('vision') }}</span>+ <AppSwitch v-else v-model="vision" :label="ai.modelCapabilityVision" />+ </SettingsRow>+ <SettingsRow :label="ai.outputLimit" :description="ai.outputLimitAutomatic">+ <span class="text-xs text-surface tabular-nums"+ >{{ outputTokens.toLocaleString() }} {{ common.tokens }}</span+ >+ </SettingsRow>+ </SettingsGroup>+ <ProviderSettingsField+ v-if="thinking"+ v-slot="{ control }"+ :label="ai.thinkingLevel"+ :hint="ai.thinkingLevelDescription"+ >+ <AppSelect+ v-bind="control"+ v-model="thinkingLevel"+ :label="ai.thinkingLevel"+ :options="thinkingLevelOptions"+ />+ </ProviderSettingsField>+ <ProviderSettingsField v-if="harness" v-slot="{ control }" :label="ai.harnessToolPermissions">+ <AppSelect+ v-bind="control"+ v-model="permissionMode"+ :label="ai.harnessToolPermissions"+ :options="permissionOptions"+ />+ </ProviderSettingsField>+ </SettingsSection>+</template>diff --git a/src/components/settings/models/ProfileEditor.vue b/src/components/settings/models/ProfileEditor.vueindex cb8f905bf..44e406c40 100644--- a/src/components/settings/models/ProfileEditor.vue+++ b/src/components/settings/models/ProfileEditor.vue@@ -8,15 +8,14 @@ import { useCodingAgentSetup, usePiSetup } from '@/app/ai/agents/setup/use'import { useModelProfileFeedback } from '@/app/ai/models/settings/profile-editor/feedback'import { useProfileSignIn } from '@/app/ai/models/settings/profile-editor/sign-in'import { useModelProfileEditor } from '@/app/ai/models/settings/profile-editor/use'-import { thinkingLevelOptions as buildThinkingLevelOptions } from '@/app/ai/models/thinking'import { useSettingsFormGuard } from '@/app/settings/navigation/use'import AgentSetup from '@/components/settings/agents/AgentSetup.vue'import PiSetup from '@/components/settings/agents/PiSetup.vue'import { focusInvalidField } from '@/components/settings/layout/focus'-import SettingsDisclosure from '@/components/settings/layout/SettingsDisclosure.vue'import SettingsPage from '@/components/settings/layout/SettingsPage.vue'import SettingsSaveFeedback from '@/components/settings/layout/SettingsSaveFeedback.vue'import SettingsSection from '@/components/settings/layout/SettingsSection.vue'+import ProfileCapabilities from '@/components/settings/models/ProfileCapabilities.vue'import ProviderSelect from '@/components/settings/provider-select/ProviderSelect.vue'import ChatGPTSignInField from '@/components/settings/provider/ChatGPTSignInField.vue'import ProviderConnectionTestButton from '@/components/settings/provider/ProviderConnectionTestButton.vue'@@ -25,10 +24,8 @@ import ProviderSettingsInput from '@/components/settings/provider/ProviderSettinimport ProviderSettingsKeyField from '@/components/settings/provider/ProviderSettingsKeyField.vue'import AppButton from '@/components/ui/button/AppButton.vue'import { AppConfirmationDialog } from '@/components/ui/dialog'-import AppInput from '@/components/ui/input/AppInput.vue'import AppCombobox from '@/components/ui/select/AppCombobox.vue'import AppSelect from '@/components/ui/select/AppSelect.vue'-import AppSwitch from '@/components/ui/toggle/AppSwitch.vue'const { profileId } = defineProps<{ profileId?: string }>()const emit = defineEmits<{ done: []; deleted: [] }>()const { ai, common, credentials, settings } = useI18n()@@ -76,7 +73,6 @@ const customModelPlaceholder = computed(() =>const feedback = useModelProfileFeedback(profile, keyInput, settings)const { errors: fieldErrors } = feedbackconst busy = computed(() => saving.value || connectionTestStatus.value === 'testing')-const thinkingLevelOptions = computed(() => buildThinkingLevelOptions(ai.value))const cloudWorkspaceOptions = computed(() =>cloudWorkspaces.value.map((workspace) => ({ value: workspace.id, label: workspace.name })))@@ -97,17 +93,12 @@ useSettingsFormGuard({}})const CUSTOM_MODEL_VALUE = '__custom__'-const advancedOpen = ref(Boolean(draft.customModelID.trim()))function updateProvider(id: AIProviderID) {// A sign-in still waiting must not land in another provider's key.signIn.cancel()profile.updateProvider(id)- advancedOpen.value = id === 'harness:pi'-}-function updateModel(id: string) {- profile.updateModel(id)- if (id === CUSTOM_MODEL_VALUE) advancedOpen.value = true}+async function save() {if (busy.value) returnif (!(await feedback.validate('save'))) {@@ -149,13 +140,12 @@ async function remove() {:error="fieldErrors.name"@blur="feedback.blur('name')">- <AppInput+ <ProviderSettingsInputref="nameInput"v-bind="control"v-model="draft.name":aria-label="ai.modelName":placeholder="modelDisplayName"- size="sm"/></ProviderSettingsField>@@ -200,7 +190,7 @@ async function remove() {class="flex items-start justify-between gap-2"data-test-id="settings-cloud-ai-notice">- <p class="text-[11px] leading-relaxed text-muted">{{ cloudNotice }}</p>+ <p class="text-xs leading-relaxed text-muted">{{ cloudNotice }}</p><AppButtonv-if="cloudState === 'catalog-failed' || cloudState === 'workspaces-failed'"variant="outline"@@ -242,7 +232,7 @@ async function remove() {:placeholder="ai.selectModel":search-placeholder="ai.searchModels":empty-label="common.noResults"- @update:model-value="updateModel(String($event))"+ @update:model-value="profile.updateModel(String($event))"/></ProviderSettingsField>@@ -337,68 +327,17 @@ async function remove() {/></SettingsSection>- <SettingsDisclosure v-model:open="advancedOpen">- <template #label>{{ ai.advancedModelSettings }}</template>- <div class="flex flex-col gap-3">- <div>- <p class="text-[11px] font-medium text-surface">{{ ai.modelCapabilities }}</p>- <p class="mt-0.5 text-[10px] text-muted">- {{ knownModel ? ai.modelCapabilitiesDetected : ai.modelCapabilitiesManual }}- </p>- </div>-- <div class="flex flex-col gap-2">- <div class="flex items-center justify-between gap-3">- <span class="text-[11px] text-muted">{{ ai.modelCapabilityTools }}</span>- <span v-if="knownModel" class="text-[10px] text-surface">- {{- knownCapabilities.includes('tools') ? common.supported : common.unsupported- }}- </span>- <AppSwitch v-else v-model="toolsEnabled" :label="ai.modelCapabilityTools" />- </div>- <div class="flex items-center justify-between gap-3">- <span class="text-[11px] text-muted">{{ ai.modelCapabilityVision }}</span>- <span v-if="knownModel" class="text-[10px] text-surface">- {{- knownCapabilities.includes('vision') ? common.supported : common.unsupported- }}- </span>- <AppSwitch v-else v-model="visionEnabled" :label="ai.modelCapabilityVision" />- </div>- </div>-- <ProviderSettingsField v-if="supportsThinking" :label="ai.thinkingLevel">- <AppSelect- v-model="draft.thinkingLevel"- :label="ai.thinkingLevel"- :options="thinkingLevelOptions"- />- <p class="mt-1 text-[10px] text-muted">{{ ai.thinkingLevelDescription }}</p>- </ProviderSettingsField>-- <ProviderSettingsField v-if="isHarness" :label="ai.harnessToolPermissions">- <AppSelect- v-model="draft.harnessPermissionMode"- :label="ai.harnessToolPermissions"- :options="[- { value: 'allow-reads', label: ai.harnessPermissionReads },- { value: 'allow-edits', label: ai.harnessPermissionEdits },- { value: 'allow-all', label: ai.harnessPermissionAll }- ]"- />- </ProviderSettingsField>-- <div class="border-t border-border pt-2.5">- <p class="text-[11px] font-medium text-surface">{{ ai.outputLimit }}</p>- <p class="mt-0.5 text-[10px] text-muted">- {{ ai.outputLimitAutomatic }} ·- {{ outputTokenRecommendation.toLocaleString() }}- {{ common.tokens }}- </p>- </div>- </div>- </SettingsDisclosure>+ <ProfileCapabilities+ v-model:tools="toolsEnabled"+ v-model:vision="visionEnabled"+ v-model:thinking-level="draft.thinkingLevel"+ v-model:permission-mode="draft.harnessPermissionMode"+ :detected="knownModel !== null"+ :capabilities="knownCapabilities"+ :output-tokens="outputTokenRecommendation"+ :thinking="supportsThinking"+ :harness="isHarness"+ /></template><SettingsSaveFeedback :error="saveError" :result="saveResult" />diff --git a/src/components/settings/provider/ChatGPTSignInField.vue b/src/components/settings/provider/ChatGPTSignInField.vueindex 183ccf2ae..076993c05 100644--- a/src/components/settings/provider/ChatGPTSignInField.vue+++ b/src/components/settings/provider/ChatGPTSignInField.vue@@ -35,7 +35,7 @@ const failure = computed(() => {<template><div class="flex flex-col gap-2" data-test-id="settings-chatgpt-sign-in">- <p class="text-[10px] text-muted">{{ ai.aiSetupChatGPTUsage }}</p>+ <p class="text-[11px] text-muted">{{ ai.aiSetupChatGPTUsage }}</p><div v-if="status === 'waiting'" class="flex flex-wrap items-center gap-2"><p role="status" class="flex items-center gap-1.5 text-[11px] text-muted"><icon-lucide-loader-2 class="size-3.5 animate-spin" aria-hidden="true" />diff --git a/src/components/settings/provider/ProviderSettingsInput.vue b/src/components/settings/provider/ProviderSettingsInput.vueindex 47bcd7bd3..b4a1c029a 100644--- a/src/components/settings/provider/ProviderSettingsInput.vue+++ b/src/components/settings/provider/ProviderSettingsInput.vue@@ -1,31 +1,18 @@<script setup lang="ts">-import AppInput from '@/components/ui/input/AppInput.vue'--interface ProviderSettingsInputProps {- id?: string- type?: 'text' | 'password' | 'number'- placeholder?: string- min?: number- max?: number- step?: number-}+import { useTemplateRef } from 'vue'-const { id, type = 'text', placeholder, min, max, step } = defineProps<ProviderSettingsInputProps>()+import AppInput from '@/components/ui/input/AppInput.vue'+/**+ * The text field of every Settings form, so fields read alike beside the selects they sit with.+ * Everything else, such as type, placeholder, autocomplete and listeners, passes through to+ * `AppInput`.+ */const modelValue = defineModel<string | number>({ required: true })-const emit = defineEmits<{ change: [] }>()+const input = useTemplateRef('input')+defineExpose({ focus: (options?: FocusOptions) => input.value?.focus(options) })</script><template>- <AppInput- v-model="modelValue"- :id="id"- :type="type"- :placeholder="placeholder"- :min="min"- :max="max"- :step="step"- size="sm"- @change="emit('change')"- />+ <AppInput ref="input" v-model="modelValue" size="sm" tone="panel" /></template>diff --git a/src/components/settings/storage/StorageSettingsPanel.vue b/src/components/settings/storage/StorageSettingsPanel.vueindex 10c9c5cce..c8a1ee6b4 100644--- a/src/components/settings/storage/StorageSettingsPanel.vue+++ b/src/components/settings/storage/StorageSettingsPanel.vue@@ -20,10 +20,11 @@ import SettingsPage from '@/components/settings/layout/SettingsPage.vue'import SettingsSaveFeedback from '@/components/settings/layout/SettingsSaveFeedback.vue'import SettingsSection from '@/components/settings/layout/SettingsSection.vue'import ProviderSettingsField from '@/components/settings/provider/ProviderSettingsField.vue'+import ProviderSettingsInput from '@/components/settings/provider/ProviderSettingsInput.vue'import AppButton from '@/components/ui/button/AppButton.vue'import AppAlert from '@/components/ui/feedback/AppAlert.vue'-import AppInput from '@/components/ui/input/AppInput.vue'import AppActionRow from '@/components/ui/list/AppActionRow.vue'+import PanelDrillIn from '@/components/ui/panel/PanelDrillIn.vue'const storage = useStorageMessages()const settings = useSettingsMessages()@@ -78,9 +79,15 @@ function edit() {editing.value = true}function cancel() {- connection.cancel()editing.value = false}+/**+ * The drafts are reset once the editor has slid away, so it never shows them reverting; an+ * editor opened again meanwhile has begun its own.+ */+function closed() {+ if (!editing.value) connection.cancel()+}async function save() {if (busy.value) returnif (!(await feedback.validate('save'))) {@@ -107,16 +114,108 @@ async function testConnection() {</script><template>- <form- ref="formElement"- class="flex min-h-0 min-w-0 flex-1 flex-col"- novalidate- :aria-busy="busy"- @submit.prevent="save"- >- <SettingsPage data-test-id="settings-storage-panel">+ <PanelDrillIn :open="editing" data-test-id="settings-storage-panel" @closed="closed">+ <template #detail>+ <form+ ref="formElement"+ class="flex min-h-0 min-w-0 flex-1 flex-col"+ novalidate+ :aria-busy="busy"+ @submit.prevent="save"+ >+ <SettingsPage>+ <div class="flex flex-col gap-3">+ <fieldset :disabled="busy" class="flex min-w-0 flex-col gap-4">+ <ProviderSettingsField+ v-for="field in provider.preferenceFields"+ :key="field.id"+ v-slot="{ control }"+ :label="preferenceLabel(field.id)"+ :hint="field.kind === 'url' ? settings.baseURLHint : field.placeholder"+ :error="fieldErrors[field.id]"+ @blur="feedback.blur(field.id)"+ >+ <ProviderSettingsInput+ v-bind="control"+ :model-value="preferenceDrafts[field.id] ?? ''"+ @update:model-value="preferenceDrafts[field.id] = String($event)"+ :type="field.kind"+ :placeholder="field.placeholder"+ :aria-label="preferenceLabel(field.id)"+ />+ </ProviderSettingsField>+ <ProviderSettingsField+ v-for="field in provider.credentialFields"+ :key="field.id"+ v-slot="{ control }"+ :label="credentialLabel(field.id)"+ :label-for="`storage-${field.id}`"+ :hint="+ credentialStatuses[field.id] === 'configured'+ ? settings.savedCredentialHint+ : field.placeholder+ "+ :error="fieldErrors[`credential:${field.id}`]"+ :clear-label="+ credentialStatuses[field.id] === 'configured' ? common.clear : undefined+ "+ @clear="clearCredential(field.id)"+ @blur="feedback.blur(`credential:${field.id}`)"+ >+ <ProviderSettingsInput+ v-bind="control"+ :model-value="credentialDrafts[field.id] ?? ''"+ @update:model-value="credentialDrafts[field.id] = String($event)"+ type="password"+ :aria-label="credentialLabel(field.id)"+ :placeholder="+ credentialStatuses[field.id] === 'configured'+ ? credentials.savedReplace+ : field.placeholder+ "+ autocomplete="new-password"+ />+ </ProviderSettingsField>+ </fieldset>+ <AppButton+ class="self-start"+ variant="outline"+ :loading="testing"+ :disabled="busy"+ data-test-id="settings-storage-test"+ @click="testConnection"+ >+ <template #leading><icon-lucide-plug-zap aria-hidden="true" /></template>+ {{ testing ? common.testingConnection : common.testConnection }}+ </AppButton>+ <AppAlert+ v-if="testResult"+ :tone="testResult === 'success' ? 'success' : 'error'"+ :heading="+ testResult === 'success'+ ? notifications.storageConnected+ : settings.connectionFailed+ "+ />+ <SettingsSaveFeedback :error="error" :result="saveResult" />+ </div>+ <template #footer>+ <AppButton :disabled="busy" @click="cancel">{{ common.cancel }}</AppButton>+ <AppButton+ type="submit"+ color="primary"+ variant="solid"+ :loading="busy && !testing"+ :disabled="busy"+ >{{ common.save }}</AppButton+ >+ </template>+ </SettingsPage>+ </form>+ </template>+ <SettingsPage><!-- Sections are spaced as other multi-section pages space them. -->- <div v-if="!editing" class="flex flex-col gap-6">+ <div class="flex flex-col gap-6"><SettingsSection><template #title>{{ settings.storage }}</template><template #description>{{ provider.description }}</template>@@ -142,90 +241,6 @@ async function testConnection() {</p></SettingsSection></div>- <div v-else class="flex flex-col gap-3">- <fieldset :disabled="busy" class="flex min-w-0 flex-col gap-4">- <ProviderSettingsField- v-for="field in provider.preferenceFields"- :key="field.id"- v-slot="{ control }"- :label="preferenceLabel(field.id)"- :hint="field.kind === 'url' ? settings.baseURLHint : field.placeholder"- :error="fieldErrors[field.id]"- @blur="feedback.blur(field.id)"- >- <AppInput- v-bind="control"- :model-value="preferenceDrafts[field.id] ?? ''"- @update:model-value="preferenceDrafts[field.id] = String($event)"- :type="field.kind"- :placeholder="field.placeholder"- :aria-label="preferenceLabel(field.id)"- tone="panel"- />- </ProviderSettingsField>- <ProviderSettingsField- v-for="field in provider.credentialFields"- :key="field.id"- v-slot="{ control }"- :label="credentialLabel(field.id)"- :label-for="`storage-${field.id}`"- :hint="- credentialStatuses[field.id] === 'configured'- ? settings.savedCredentialHint- : field.placeholder- "- :error="fieldErrors[`credential:${field.id}`]"- :clear-label="credentialStatuses[field.id] === 'configured' ? common.clear : undefined"- @clear="clearCredential(field.id)"- @blur="feedback.blur(`credential:${field.id}`)"- >- <AppInput- v-bind="control"- :model-value="credentialDrafts[field.id] ?? ''"- @update:model-value="credentialDrafts[field.id] = String($event)"- type="password"- :aria-label="credentialLabel(field.id)"- :placeholder="- credentialStatuses[field.id] === 'configured'- ? credentials.savedReplace- : field.placeholder- "- tone="panel"- autocomplete="new-password"- />- </ProviderSettingsField>- </fieldset>- <AppButton- class="self-start"- variant="outline"- :loading="testing"- :disabled="busy"- data-test-id="settings-storage-test"- @click="testConnection"- >- <template #leading><icon-lucide-plug-zap aria-hidden="true" /></template>- {{ testing ? common.testingConnection : common.testConnection }}- </AppButton>- <AppAlert- v-if="testResult"- :tone="testResult === 'success' ? 'success' : 'error'"- :heading="- testResult === 'success' ? notifications.storageConnected : settings.connectionFailed- "- />- <SettingsSaveFeedback :error="error" :result="saveResult" />- </div>- <template v-if="editing" #footer>- <AppButton :disabled="busy" @click="cancel">{{ common.cancel }}</AppButton>- <AppButton- type="submit"- color="primary"- variant="solid"- :loading="busy && !testing"- :disabled="busy"- >{{ common.save }}</AppButton- >- </template></SettingsPage>- </form>+ </PanelDrillIn></template>diff --git a/src/components/settings/usage/UsageSettingsPanel.vue b/src/components/settings/usage/UsageSettingsPanel.vueindex a1c6ac057..1da770f53 100644--- a/src/components/settings/usage/UsageSettingsPanel.vue+++ b/src/components/settings/usage/UsageSettingsPanel.vue@@ -35,7 +35,7 @@ const totals = computed(() => {<div class="grid grid-cols-2 gap-2"><div v-for="total in totals" :key="total.label" class="rounded border border-border p-3">- <div class="text-[10px] text-muted">{{ total.label }}</div>+ <div class="text-[11px] text-muted">{{ total.label }}</div><div class="mt-1 text-sm font-semibold text-surface">{{ total.value }}</div></div></div>@@ -62,6 +62,6 @@ const totals = computed(() => {</div></div>- <p class="text-[10px] text-muted">{{ diagnosticMessages.usageCacheNote }}</p>+ <p class="text-[11px] text-muted">{{ diagnosticMessages.usageCacheNote }}</p></SettingsSection></template>diff --git a/src/components/ui/panel/PanelDrillIn.vue b/src/components/ui/panel/PanelDrillIn.vueindex 175252cd1..3ecc959e8 100644--- a/src/components/ui/panel/PanelDrillIn.vue+++ b/src/components/ui/panel/PanelDrillIn.vue@@ -9,30 +9,22 @@ import { drillInTransition } from '@/theme/motion/styles'import drillInTheme from '@/theme/panel/drill-in'/**- * A list with a detail view that slides in over it. The back control names the view it returns- * to, like "‹ Models". Focus moves into the detail as it opens, to the back control unless- * `open-auto-focus` is prevented to focus a field instead, and back to what opened it.+ * A list with a detail view that slides in over it. Given a `parent`, a bar above the detail+ * holds the back control, which names the view it returns to, like "‹ Models"; without one the+ * way back is drawn elsewhere, such as a window's breadcrumb. Focus moves into the detail as it+ * opens, to the back control unless `open-auto-focus` is prevented to focus a field instead, and+ * back to what opened it. `closed` fires once the detail has slid away, for state that would+ * show changing if it were reset while the detail was still on screen.*/-const {- open,- back,- parent,- backInDetail = false,- ui-} = defineProps<{+const { open, back, parent, ui } = defineProps<{open: boolean/** The accessible verb, "Back". */- back: string+ back?: string/** What Back returns to, shown on the control: "Models". */- parent: string- /**- * The way back is drawn elsewhere, such as a window's breadcrumb, so no bar is drawn above- * the detail.- */- backInDetail?: boolean+ parent?: stringui?: ComponentUI<typeof drillInTheme>}>()-const emit = defineEmits<{ back: []; openAutoFocus: [event: Event] }>()+const emit = defineEmits<{ back: []; closed: []; openAutoFocus: [event: Event] }>()const styles = tv(drillInTheme)()/**@@ -50,14 +42,19 @@ function uncover(element: Element) {<template><div :class="styles.root({ class: ui?.root })">- <Transition v-bind="drillInTransition" @after-enter="covered = true" @before-leave="uncover">+ <Transition+ v-bind="drillInTransition"+ @after-enter="covered = true"+ @before-leave="uncover"+ @after-leave="emit('closed')"+ ><FocusScopev-if="open"data-slot="detail":class="styles.detail({ class: ui?.detail })"@mount-auto-focus="emit('openAutoFocus', $event)">- <div v-if="!backInDetail" data-slot="header" :class="styles.header({ class: ui?.header })">+ <div v-if="parent" data-slot="header" :class="styles.header({ class: ui?.header })"><AppButton variant="ghost" size="sm" data-slot="back" @click="emit('back')"><template #leading><icon-lucide-chevron-left class="size-4" /></template><span class="sr-only">{{ back }}:</span>diff --git a/src/theme/settings/breadcrumb.ts b/src/theme/settings/breadcrumb.tsnew file mode 100644index 000000000..af585a3a8--- /dev/null+++ b/src/theme/settings/breadcrumb.ts@@ -0,0 +1,9 @@+/** The path in the Settings window's title while an editor is open. */+export default {+ slots: {+ root: 'flex min-w-0 items-center gap-1.5',+ step: 'shrink-0 cursor-pointer rounded-sm whitespace-nowrap text-muted outline-none hover:text-surface focus-visible:ring-2 focus-visible:ring-accent/50',+ separator: 'size-3.5 shrink-0 text-muted',+ current: 'min-w-0 truncate'+ }+}diff --git a/tests/engine/app/ai/profile-selection.test.ts b/tests/engine/app/ai/profile-selection.test.tsindex c68d2cbd8..6eeeb1c58 100644--- a/tests/engine/app/ai/profile-selection.test.ts+++ b/tests/engine/app/ai/profile-selection.test.ts@@ -71,7 +71,7 @@ test('selection immediately applies loaded catalog metadata and display name', a}})-test('catalog details read after opening go through the editor, which decides they are not edits', async () => {+test('catalog details read after opening show without editing the draft until saved', async () => {const originalFetch = globalThis.fetchglobalThis.fetch = fetchStub(async () =>@@ -98,21 +98,22 @@ test('catalog details read after opening go through the editor, which decides thdraft.providerID = 'openai'draft.modelID = 'catalog-model'draft.capabilities = ['tools']- const applied: string[][] = []- scope.run(() =>- useProfileModelSelection(draft, labels, {- applyCatalogDetails: (apply) => {- apply()- applied.push([...draft.capabilities])- }- })- )- for (let attempt = 0; attempt < 20 && applied.length === 0; attempt++) {+ draft.maxOutputTokens = 16384+ const selection = scope.run(() => useProfileModelSelection(draft, labels))+ if (!selection) throw new Error('Missing selection scope')+ for (let attempt = 0; attempt < 20; attempt++) {await new Promise((resolve) => {setTimeout(resolve, 0)})+ if (selection.knownCapabilities.value.includes('vision')) break}- expect(applied).toEqual([['tools', 'vision']])+ expect(selection.knownCapabilities.value).toEqual(['tools', 'vision'])+ expect(selection.outputTokenRecommendation.value).toBe(32000)+ expect(draft.capabilities).toEqual(['tools'])+ expect(draft.maxOutputTokens).toBe(16384)++ selection.applyKnownModelMetadata()+ expect(draft.capabilities).toEqual(['tools', 'vision'])expect(draft.maxOutputTokens).toBe(32000)} finally {scope.stop()