AI-native design editor. Open-source Figma alternative.
feat: show where a Settings editor sits as a breadcrumb in the window title (#1475)
Danila Poyarkov717d6b62e807
diff --git a/changes/1475/changed.md b/changes/1475/changed.mdnew file mode 100644index 000000000..949a9ce86--- /dev/null+++ b/changes/1475/changed.md@@ -0,0 +1 @@+- Settings editors for models, media services, MCP connections, and storage show where they sit in the window title, such as **Settings › Models › Edit model**, and the earlier steps go back.diff --git a/changes/1475/fixed.md b/changes/1475/fixed.mdnew file mode 100644index 000000000..1b8a75fbd--- /dev/null+++ b/changes/1475/fixed.md@@ -0,0 +1 @@+- Leaving a model you haven't changed no longer asks to discard changes.diff --git a/packages/vue/src/i18n/locales/de/ai.json b/packages/vue/src/i18n/locales/de/ai.jsonindex 33e093a89..816254857 100644--- a/packages/vue/src/i18n/locales/de/ai.json+++ b/packages/vue/src/i18n/locales/de/ai.json@@ -82,7 +82,6 @@"modelsDescription": "Wiederverwendbare Modelle und ihre Anbieter-Verbindungen konfigurieren.","addModel": "Modell hinzufügen","editModel": "Modell bearbeiten",- "modelEditorDescription": "Anbieter, Modell, Zugangsdaten und Fähigkeiten.","modelName": "Name","modelConfiguration": "Modell","connectionSettings": "Verbindung",diff --git a/packages/vue/src/i18n/locales/de/automation.json b/packages/vue/src/i18n/locales/de/automation.jsonindex 14b1ca555..af1cc2111 100644--- a/packages/vue/src/i18n/locales/de/automation.json+++ b/packages/vue/src/i18n/locales/de/automation.json@@ -13,7 +13,6 @@"connectionsDescription": "Gewähre ACP-Agenten Zugriff auf vertrauenswürdige entfernte Tools und Dienste.","addServerConnection": "MCP-Verbindung hinzufügen","editConnection": "MCP-Verbindung bearbeiten",- "connectionEditorDescription": "Konfiguriere einen Streamable-HTTP-Server und optionale Authentifizierung.","serverURL": "MCP-Server-URL","enableConnection": "Für ACP-Agenten aktivieren","bearerAuthentication": "Bearer-Authentifizierung verwenden",diff --git a/packages/vue/src/i18n/locales/de/settings.json b/packages/vue/src/i18n/locales/de/settings.jsonindex 8f4249993..7b8bd6529 100644--- a/packages/vue/src/i18n/locales/de/settings.json+++ b/packages/vue/src/i18n/locales/de/settings.json@@ -60,7 +60,6 @@"edit": "Bearbeiten","configured": "Konfiguriert","notConfigured": "Nicht konfiguriert",- "saveChangesDescription": "Änderungen werden beim Speichern übernommen.","partialSaveWarning": "Einige Änderungen sind möglicherweise bereits gespeichert. Prüfe die Einstellungen und versuche es erneut.","requiredField": "Dieses Feld ist erforderlich.","invalidURL": "Gib eine gültige HTTP- oder HTTPS-URL ohne eingebettete Zugangsdaten ein.",diff --git a/packages/vue/src/i18n/locales/es/ai.json b/packages/vue/src/i18n/locales/es/ai.jsonindex 10661aeb4..678cff2f6 100644--- a/packages/vue/src/i18n/locales/es/ai.json+++ b/packages/vue/src/i18n/locales/es/ai.json@@ -82,7 +82,6 @@"modelsDescription": "Configura modelos reutilizables y sus conexiones de proveedor.","addModel": "Añadir modelo","editModel": "Editar modelo",- "modelEditorDescription": "Proveedor, modelo, credenciales y capacidades.","modelName": "Nombre","modelConfiguration": "Modelo","connectionSettings": "Conexión",diff --git a/packages/vue/src/i18n/locales/es/automation.json b/packages/vue/src/i18n/locales/es/automation.jsonindex 45ddb414d..d1d1dbc1c 100644--- a/packages/vue/src/i18n/locales/es/automation.json+++ b/packages/vue/src/i18n/locales/es/automation.json@@ -13,7 +13,6 @@"connectionsDescription": "Da acceso a los agentes ACP a herramientas y servicios remotos de confianza.","addServerConnection": "Añadir conexión MCP","editConnection": "Editar conexión MCP",- "connectionEditorDescription": "Configura un servidor Streamable HTTP y autenticación opcional.","serverURL": "URL del servidor MCP","enableConnection": "Activar para agentes ACP","bearerAuthentication": "Usar autenticación Bearer",diff --git a/packages/vue/src/i18n/locales/es/settings.json b/packages/vue/src/i18n/locales/es/settings.jsonindex dc36964f7..f658f07fc 100644--- a/packages/vue/src/i18n/locales/es/settings.json+++ b/packages/vue/src/i18n/locales/es/settings.json@@ -60,7 +60,6 @@"edit": "Editar","configured": "Configurado","notConfigured": "Sin configurar",- "saveChangesDescription": "Los cambios se aplican al guardar.","partialSaveWarning": "Es posible que algunos cambios ya se hayan guardado. Revisa la configuración e inténtalo de nuevo.","requiredField": "Este campo es obligatorio.","invalidURL": "Introduce una URL HTTP o HTTPS válida sin credenciales incorporadas.",diff --git a/packages/vue/src/i18n/locales/fr/ai.json b/packages/vue/src/i18n/locales/fr/ai.jsonindex a86d2d2f2..5f8438662 100644--- a/packages/vue/src/i18n/locales/fr/ai.json+++ b/packages/vue/src/i18n/locales/fr/ai.json@@ -82,7 +82,6 @@"modelsDescription": "Configurez des modèles réutilisables et leurs connexions fournisseur.","addModel": "Ajouter un modèle","editModel": "Modifier le modèle",- "modelEditorDescription": "Fournisseur, modèle, identifiants et capacités.","modelName": "Nom","modelConfiguration": "Modèle","connectionSettings": "Connexion",diff --git a/packages/vue/src/i18n/locales/fr/automation.json b/packages/vue/src/i18n/locales/fr/automation.jsonindex 33a93af07..bc6c69aa3 100644--- a/packages/vue/src/i18n/locales/fr/automation.json+++ b/packages/vue/src/i18n/locales/fr/automation.json@@ -13,7 +13,6 @@"connectionsDescription": "Donnez aux agents ACP accès à des outils et services distants de confiance.","addServerConnection": "Ajouter une connexion MCP","editConnection": "Modifier la connexion MCP",- "connectionEditorDescription": "Configurez un serveur Streamable HTTP et une authentification facultative.","serverURL": "URL du serveur MCP","enableConnection": "Activer pour les agents ACP","bearerAuthentication": "Utiliser l’authentification Bearer",diff --git a/packages/vue/src/i18n/locales/fr/settings.json b/packages/vue/src/i18n/locales/fr/settings.jsonindex 2d94abc54..d3b5ccfda 100644--- a/packages/vue/src/i18n/locales/fr/settings.json+++ b/packages/vue/src/i18n/locales/fr/settings.json@@ -60,7 +60,6 @@"edit": "Modifier","configured": "Configuré","notConfigured": "Non configuré",- "saveChangesDescription": "Les modifications s’appliquent à l’enregistrement.","partialSaveWarning": "Certaines modifications sont peut-être déjà enregistrées. Vérifiez les paramètres et réessayez.","requiredField": "Ce champ est obligatoire.","invalidURL": "Saisissez une URL HTTP ou HTTPS valide sans identifiants intégrés.",diff --git a/packages/vue/src/i18n/locales/it/ai.json b/packages/vue/src/i18n/locales/it/ai.jsonindex 34d3732d9..d75bc8eb4 100644--- a/packages/vue/src/i18n/locales/it/ai.json+++ b/packages/vue/src/i18n/locales/it/ai.json@@ -82,7 +82,6 @@"modelsDescription": "Configura modelli riutilizzabili e le connessioni ai provider.","addModel": "Aggiungi modello","editModel": "Modifica modello",- "modelEditorDescription": "Provider, modello, credenziali e funzionalità.","modelName": "Nome","modelConfiguration": "Modello","connectionSettings": "Connessione",diff --git a/packages/vue/src/i18n/locales/it/automation.json b/packages/vue/src/i18n/locales/it/automation.jsonindex 38d7ab5fa..2d839d436 100644--- a/packages/vue/src/i18n/locales/it/automation.json+++ b/packages/vue/src/i18n/locales/it/automation.json@@ -13,7 +13,6 @@"connectionsDescription": "Consenti agli agenti ACP di accedere a strumenti e servizi remoti attendibili.","addServerConnection": "Aggiungi connessione MCP","editConnection": "Modifica connessione MCP",- "connectionEditorDescription": "Configura un server Streamable HTTP e l’autenticazione facoltativa.","serverURL": "URL server MCP","enableConnection": "Abilita per gli agenti ACP","bearerAuthentication": "Usa autenticazione Bearer",diff --git a/packages/vue/src/i18n/locales/it/settings.json b/packages/vue/src/i18n/locales/it/settings.jsonindex b2d83dc54..7d7080680 100644--- a/packages/vue/src/i18n/locales/it/settings.json+++ b/packages/vue/src/i18n/locales/it/settings.json@@ -60,7 +60,6 @@"edit": "Modifica","configured": "Configurato","notConfigured": "Non configurato",- "saveChangesDescription": "Le modifiche vengono applicate al salvataggio.","partialSaveWarning": "Alcune modifiche potrebbero essere già salvate. Controlla le impostazioni e riprova.","requiredField": "Questo campo è obbligatorio.","invalidURL": "Inserisci un URL HTTP o HTTPS valido senza credenziali incorporate.",diff --git a/packages/vue/src/i18n/locales/ja/ai.json b/packages/vue/src/i18n/locales/ja/ai.jsonindex 40cf8c70e..af7d82e3e 100644--- a/packages/vue/src/i18n/locales/ja/ai.json+++ b/packages/vue/src/i18n/locales/ja/ai.json@@ -82,7 +82,6 @@"modelsDescription": "再利用可能なモデルとプロバイダー接続を設定します。","addModel": "モデルを追加","editModel": "モデルを編集",- "modelEditorDescription": "プロバイダー、モデル、認証情報、機能。","modelName": "名前","modelConfiguration": "モデル","connectionSettings": "接続",diff --git a/packages/vue/src/i18n/locales/ja/automation.json b/packages/vue/src/i18n/locales/ja/automation.jsonindex c3f903d12..533690353 100644--- a/packages/vue/src/i18n/locales/ja/automation.json+++ b/packages/vue/src/i18n/locales/ja/automation.json@@ -13,7 +13,6 @@"connectionsDescription": "ACPエージェントに信頼できるリモートツールやサービスへのアクセスを許可します。","addServerConnection": "MCP接続を追加","editConnection": "MCP接続を編集",- "connectionEditorDescription": "Streamable HTTPサーバーと任意の認証を設定します。","serverURL": "MCPサーバーURL","enableConnection": "ACPエージェントで有効にする","bearerAuthentication": "Bearer認証を使用",diff --git a/packages/vue/src/i18n/locales/ja/settings.json b/packages/vue/src/i18n/locales/ja/settings.jsonindex bde6aa61d..3e6477ee7 100644--- a/packages/vue/src/i18n/locales/ja/settings.json+++ b/packages/vue/src/i18n/locales/ja/settings.json@@ -60,7 +60,6 @@"edit": "編集","configured": "設定済み","notConfigured": "未設定",- "saveChangesDescription": "保存すると変更が適用されます。","partialSaveWarning": "一部の変更はすでに保存されている可能性があります。設定を確認して、もう一度お試しください。","requiredField": "この項目は必須です。","invalidURL": "認証情報を含まない有効な HTTP または HTTPS URL を入力してください。",diff --git a/packages/vue/src/i18n/locales/pl/ai.json b/packages/vue/src/i18n/locales/pl/ai.jsonindex f26df4255..6b54afc12 100644--- a/packages/vue/src/i18n/locales/pl/ai.json+++ b/packages/vue/src/i18n/locales/pl/ai.json@@ -82,7 +82,6 @@"modelsDescription": "Skonfiguruj modele wielokrotnego użytku i połączenia z dostawcami.","addModel": "Dodaj model","editModel": "Edytuj model",- "modelEditorDescription": "Dostawca, model, dane logowania i możliwości.","modelName": "Nazwa","modelConfiguration": "Model","connectionSettings": "Połączenie",diff --git a/packages/vue/src/i18n/locales/pl/automation.json b/packages/vue/src/i18n/locales/pl/automation.jsonindex 9964df07e..e4565ed1c 100644--- a/packages/vue/src/i18n/locales/pl/automation.json+++ b/packages/vue/src/i18n/locales/pl/automation.json@@ -13,7 +13,6 @@"connectionsDescription": "Zapewnij agentom ACP dostęp do zaufanych zdalnych narzędzi i usług.","addServerConnection": "Dodaj połączenie MCP","editConnection": "Edytuj połączenie MCP",- "connectionEditorDescription": "Skonfiguruj serwer Streamable HTTP i opcjonalne uwierzytelnianie.","serverURL": "URL serwera MCP","enableConnection": "Włącz dla agentów ACP","bearerAuthentication": "Użyj uwierzytelniania Bearer",diff --git a/packages/vue/src/i18n/locales/pl/settings.json b/packages/vue/src/i18n/locales/pl/settings.jsonindex 16380f532..3a319bbbb 100644--- a/packages/vue/src/i18n/locales/pl/settings.json+++ b/packages/vue/src/i18n/locales/pl/settings.json@@ -60,7 +60,6 @@"edit": "Edytuj","configured": "Skonfigurowano","notConfigured": "Nie skonfigurowano",- "saveChangesDescription": "Zmiany zostaną zastosowane po zapisaniu.","partialSaveWarning": "Niektóre zmiany mogły już zostać zapisane. Sprawdź ustawienia i spróbuj ponownie.","requiredField": "To pole jest wymagane.","invalidURL": "Wpisz poprawny adres HTTP lub HTTPS bez osadzonych danych uwierzytelniających.",diff --git a/packages/vue/src/i18n/locales/ru/ai.json b/packages/vue/src/i18n/locales/ru/ai.jsonindex c2ff57175..ba0b4793a 100644--- a/packages/vue/src/i18n/locales/ru/ai.json+++ b/packages/vue/src/i18n/locales/ru/ai.json@@ -82,7 +82,6 @@"modelsDescription": "Настройте переиспользуемые модели и подключения к провайдерам.","addModel": "Добавить модель","editModel": "Изменить модель",- "modelEditorDescription": "Провайдер, модель, учётные данные и возможности.","modelName": "Название","modelConfiguration": "Модель","connectionSettings": "Подключение",diff --git a/packages/vue/src/i18n/locales/ru/automation.json b/packages/vue/src/i18n/locales/ru/automation.jsonindex b43449854..db627c00a 100644--- a/packages/vue/src/i18n/locales/ru/automation.json+++ b/packages/vue/src/i18n/locales/ru/automation.json@@ -13,7 +13,6 @@"connectionsDescription": "Предоставьте ACP-агентам доступ к доверенным удалённым инструментам и сервисам.","addServerConnection": "Добавить подключение MCP","editConnection": "Изменить подключение MCP",- "connectionEditorDescription": "Настройте сервер Streamable HTTP и необязательную аутентификацию.","serverURL": "URL сервера MCP","enableConnection": "Включить для ACP-агентов","bearerAuthentication": "Использовать Bearer-аутентификацию",diff --git a/packages/vue/src/i18n/locales/ru/settings.json b/packages/vue/src/i18n/locales/ru/settings.jsonindex 64da44d84..79c109efb 100644--- a/packages/vue/src/i18n/locales/ru/settings.json+++ b/packages/vue/src/i18n/locales/ru/settings.json@@ -60,7 +60,6 @@"edit": "Изменить","configured": "Настроено","notConfigured": "Не настроено",- "saveChangesDescription": "Изменения применяются при сохранении.","partialSaveWarning": "Некоторые изменения могли уже сохраниться. Проверьте настройки и попробуйте снова.","requiredField": "Это поле обязательно.","invalidURL": "Введите корректный HTTP- или HTTPS-адрес без встроенных учётных данных.",diff --git a/packages/vue/src/i18n/locales/zh-cn/ai.json b/packages/vue/src/i18n/locales/zh-cn/ai.jsonindex 7270c6bea..e78e6041d 100644--- a/packages/vue/src/i18n/locales/zh-cn/ai.json+++ b/packages/vue/src/i18n/locales/zh-cn/ai.json@@ -82,7 +82,6 @@"modelsDescription": "配置可复用模型及其提供商连接。","addModel": "添加模型","editModel": "编辑模型",- "modelEditorDescription": "提供商、模型、凭据和能力。","modelName": "名称","modelConfiguration": "模型","connectionSettings": "连接",diff --git a/packages/vue/src/i18n/locales/zh-cn/automation.json b/packages/vue/src/i18n/locales/zh-cn/automation.jsonindex 3f05c63db..fe2c46004 100644--- a/packages/vue/src/i18n/locales/zh-cn/automation.json+++ b/packages/vue/src/i18n/locales/zh-cn/automation.json@@ -13,7 +13,6 @@"connectionsDescription": "允许 ACP 代理访问受信任的远程工具和服务。","addServerConnection": "添加 MCP 连接","editConnection": "编辑 MCP 连接",- "connectionEditorDescription": "配置 Streamable HTTP 服务器和可选身份验证。","serverURL": "MCP 服务器 URL","enableConnection": "为 ACP 代理启用","bearerAuthentication": "使用 Bearer 身份验证",diff --git a/packages/vue/src/i18n/locales/zh-cn/settings.json b/packages/vue/src/i18n/locales/zh-cn/settings.jsonindex 5fb0a6ce5..9d5bed5d6 100644--- a/packages/vue/src/i18n/locales/zh-cn/settings.json+++ b/packages/vue/src/i18n/locales/zh-cn/settings.json@@ -60,7 +60,6 @@"edit": "编辑","configured": "已配置","notConfigured": "未配置",- "saveChangesDescription": "保存后更改才会生效。","partialSaveWarning": "部分更改可能已保存。请检查设置后重试。","requiredField": "此字段为必填项。","invalidURL": "请输入有效的 HTTP 或 HTTPS 地址,且不要包含凭据。",diff --git a/packages/vue/src/i18n/messages/ai.ts b/packages/vue/src/i18n/messages/ai.tsindex 352e31b18..9eedfe964 100644--- a/packages/vue/src/i18n/messages/ai.ts+++ b/packages/vue/src/i18n/messages/ai.ts@@ -134,7 +134,6 @@ export const aiMessageDefaults = {modelsDescription: 'Configure reusable models and their provider connections.',addModel: 'Add model',editModel: 'Edit model',- modelEditorDescription: 'Provider, model, credentials, and capabilities.',modelName: 'Name',modelConfiguration: 'Model',connectionSettings: 'Connection',diff --git a/packages/vue/src/i18n/messages/automation.ts b/packages/vue/src/i18n/messages/automation.tsindex 77ce396be..49d5606b1 100644--- a/packages/vue/src/i18n/messages/automation.ts+++ b/packages/vue/src/i18n/messages/automation.ts@@ -67,7 +67,6 @@ export const automationMessageDefaults = {addConnection: 'Add connection',addServerConnection: 'Add MCP connection',editConnection: 'Edit MCP connection',- connectionEditorDescription: 'Configure a Streamable HTTP server and optional authentication.',connectionName: 'Connection name',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.',diff --git a/packages/vue/src/i18n/messages/settings.ts b/packages/vue/src/i18n/messages/settings.tsindex f8827f625..ce7c1a108 100644--- a/packages/vue/src/i18n/messages/settings.ts+++ b/packages/vue/src/i18n/messages/settings.ts@@ -59,7 +59,6 @@ export const settingsMessageDefaults = {edit: 'Edit',configured: 'Configured',notConfigured: 'Not configured',- saveChangesDescription: 'Changes apply when you save.',requiredField: 'This field is required.',invalidURL: 'Enter a valid HTTP or HTTPS URL without embedded credentials.',saveFailed: 'Could not save these changes. Check the settings and try again.',diff --git a/src/app/ai/models/settings/profile-editor/selection.ts b/src/app/ai/models/settings/profile-editor/selection.tsindex b0818a253..091c24c41 100644--- a/src/app/ai/models/settings/profile-editor/selection.ts+++ b/src/app/ai/models/settings/profile-editor/selection.ts@@ -15,7 +15,16 @@ import { supportsThinkingLevel } from '@/app/ai/models/thinking'export function useProfileModelSelection(draft: AIModelProfileDraft,- ai: Readonly<Ref<ModelPickerLabels & { customModel: string }>>+ 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+ } = {}) {const CUSTOM_MODEL_VALUE = '__custom__'const DEFAULT_MAX_OUTPUT_TOKENS = 16384@@ -107,8 +116,10 @@ export function useProfileModelSelection(const resolved = await resolveModelsDevModel(providerID, modelID)if (providerID !== draft.providerID || modelID !== effectiveModelID()) return- catalogModel.value = resolved- applyKnownModelMetadata()+ applyCatalogDetails(() => {+ catalogModel.value = resolved+ applyKnownModelMetadata()+ })}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 688b2be8a..2515a1092 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, toRaw, watch } from 'vue'+import { computed, reactive, ref, shallowRef, 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)+ const selection = useProfileModelSelection(draft, ai, { applyCatalogDetails })const {providerDef,isACP,@@ -51,7 +51,19 @@ export function useModelProfileEditor({ profileId, keyInput, labels: ai }: Proficonst saveError = ref<string | null>(null)const saveResult = ref<SettingsSaveResult | null>(null)const busy = ref(false)- const initialDraft = structuredClone(toRaw(draft))+ /** 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))+ }tryOnScopeDispose(() => {keyInput.value = ''})@@ -68,7 +80,7 @@ export function useModelProfileEditor({ profileId, keyInput, labels: ai }: Profi} = useProfileConnection({ draft, keyInput })const dirty = computed(- () => !isEqual(draft, initialDraft) || keyInput.value.length > 0 || keyCleared.value+ () => !isEqual(draft, baseline.value) || keyInput.value.length > 0 || keyCleared.value)const canDelete = computed(() => (profileId ? canRemoveModelProfile(profileId) : false))diff --git a/src/app/settings/navigation/use.ts b/src/app/settings/navigation/use.tsindex 30e3c18a0..36a85fa4c 100644--- a/src/app/settings/navigation/use.ts+++ b/src/app/settings/navigation/use.ts@@ -1,9 +1,25 @@-import { computed, inject, provide, shallowRef, watch, type InjectionKey, type Ref } from 'vue'+import { noop } from 'es-toolkit'+import {+ computed,+ inject,+ provide,+ shallowRef,+ toValue,+ watch,+ type InjectionKey,+ type MaybeRefOrGetter,+ type Ref+} from 'vue'interface SettingsFormGuard {dirty: Readonly<Ref<boolean>>busy: Readonly<Ref<boolean>>cancel: () => void+ /**+ * An editor that replaces a list names itself and the list, and the window's header shows them+ * as a breadcrumb with the way back, instead of the editor drawing its own title and back row.+ */+ crumb?: { parent: MaybeRefOrGetter<string>; title: MaybeRefOrGetter<string> }}/** One navigation policy for every editor in the Settings window. */@@ -17,8 +33,20 @@ export function createSettingsNavigation() {action()}+ function request(action: () => void) {+ const form = active.value+ if (form?.busy.value) return+ if (form?.dirty.value) pending.value = { form, action }+ else leave(form, action)+ }+return {editing: computed(() => active.value !== null),+ crumb: computed(() => {+ const crumb = active.value?.crumb+ if (!crumb) return null+ return { parent: toValue(crumb.parent), title: toValue(crumb.title) }+ }),confirming: computed(() => pending.value !== null),register(form: SettingsFormGuard) {active.value = form@@ -27,11 +55,10 @@ export function createSettingsNavigation() {if (pending.value?.form === form) pending.value = null}},- request(action: () => void) {- const form = active.value- if (form?.busy.value) return- if (form?.dirty.value) pending.value = { form, action }- else leave(form, action)+ request,+ /** Leaves the open editor for its list, asking first when it holds unsaved changes. */+ back() {+ request(noop)},keepEditing() {pending.value = nulldiff --git a/src/components/settings/SettingsDialog.vue b/src/components/settings/SettingsDialog.vueindex f7a149aa1..310562acd 100644--- a/src/components/settings/SettingsDialog.vue+++ b/src/components/settings/SettingsDialog.vue@@ -44,7 +44,7 @@ const { isMobile } = useViewportKind()const { settings, common } = useI18n()const navigation = provideSettingsNavigation()tryOnScopeDispose(registerSettingsNavigation(navigation.request))-const { editing, confirming } = navigation+const { editing, confirming, crumb } = navigationconst sections = computed(() =>[@@ -90,7 +90,31 @@ function onOpenChange(open: boolean): void {:heading="settings.title":description="settings.description":close-label="common.close"- />+ >+ <!-- An open editor turns the title into the path back to where it was opened from. -->+ <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>+ </template>+ </AppDialogHeader><AppTabsRoot:model-value="settingsDialogSection"diff --git a/src/components/settings/mcp/MCPConnectionEditor.vue b/src/components/settings/mcp/MCPConnectionEditor.vueindex 2e96eade2..eb070ae7a 100644--- a/src/components/settings/mcp/MCPConnectionEditor.vue+++ b/src/components/settings/mcp/MCPConnectionEditor.vue@@ -17,7 +17,6 @@ import SettingsGroup from '@/components/settings/layout/SettingsGroup.vue'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 SettingsSection from '@/components/settings/layout/SettingsSection.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'@@ -63,11 +62,7 @@ defineExpose({ focusInvalid: () => focusInvalidField(formElement.value) })@submit.prevent="$emit('save')"><SettingsPage>- <SettingsSection>- <template #title>{{- draft.id ? automation.editConnection : automation.addServerConnection- }}</template>- <template #description>{{ automation.connectionEditorDescription }}</template>+ <div class="flex flex-col gap-3"><fieldset :disabled="busy" class="flex min-w-0 flex-col gap-3"><ProviderSettingsFieldv-slot="{ control }"@@ -143,7 +138,7 @@ defineExpose({ focusInvalid: () => focusInvalidField(formElement.value) })/></fieldset><SettingsSaveFeedback :error="error" :result="saveResult" />- </SettingsSection>+ </div><template #footer><AppButtonv-if="draft.id"diff --git a/src/components/settings/mcp/MCPConnectionsSection.vue b/src/components/settings/mcp/MCPConnectionsSection.vueindex 7855cabf2..abd61035b 100644--- a/src/components/settings/mcp/MCPConnectionsSection.vue+++ b/src/components/settings/mcp/MCPConnectionsSection.vue@@ -44,7 +44,19 @@ const dirty = computed(() => form.dirty.value || tokenDraft.value.length > 0 || connection.credentialCleared.value)const busy = computed(() => connection.busy.value || form.isSubmitting.value)-useSettingsFormGuard({ dirty, busy, cancel }, editing)+useSettingsFormGuard(+ {+ dirty,+ busy,+ cancel,+ crumb: {+ parent: () => automation.value.connections,+ title: () =>+ draft.value.id ? automation.value.editConnection : automation.value.addServerConnection+ }+ },+ editing+)function startAdd() {connection.startAdd()editing.value = truediff --git a/src/components/settings/media/MediaCredentialEditor.vue b/src/components/settings/media/MediaCredentialEditor.vueindex 7fb13372c..6aabf9646 100644--- a/src/components/settings/media/MediaCredentialEditor.vue+++ b/src/components/settings/media/MediaCredentialEditor.vue@@ -12,7 +12,6 @@ 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 SettingsSection from '@/components/settings/layout/SettingsSection.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'@@ -21,7 +20,6 @@ const { service } = defineProps<{ service: MediaSettingsService }>()const emit = defineEmits<{ done: [] }>()const editor = useMediaSettingsEditor(service)const { key, providerID, keyStatus, error, dirty, busy, clearCredential } = editor-useSettingsFormGuard({ dirty, busy, cancel: () => emit('done') })const common = useCommonMessages()const credentials = useCredentialMessages()const media = useMediaMessages()@@ -32,6 +30,12 @@ const title = computed(() => {if (service === 'vectorize') return media.value.vectorizationreturn service === 'pexels' ? 'Pexels' : 'Unsplash'})+useSettingsFormGuard({+ dirty,+ busy,+ cancel: () => emit('done'),+ crumb: { parent: () => settings.value.media, title }+})const keyLabel = computed(() =>service === 'unsplash' ? credentials.value.accessKey : credentials.value.apiKey)@@ -52,8 +56,7 @@ async function save() {<template><form class="flex min-h-0 min-w-0 flex-1 flex-col" :aria-busy="busy" @submit.prevent="save"><SettingsPage>- <SettingsSection class="gap-5">- <template #title>{{ title }}</template>+ <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 }}@@ -81,7 +84,7 @@ async function save() {/></fieldset><SettingsSaveFeedback :error="error" />- </SettingsSection>+ </div><template #footer><AppButton :disabled="busy" @click="emit('done')">{{ common.cancel }}</AppButton><AppButton type="submit" color="primary" variant="solid" :loading="busy">{{diff --git a/src/components/settings/models/ModelsPanel.vue b/src/components/settings/models/ModelsPanel.vueindex 64b3a47c6..6f0ec9943 100644--- a/src/components/settings/models/ModelsPanel.vue+++ b/src/components/settings/models/ModelsPanel.vue@@ -89,6 +89,7 @@ const { connectionState, refresh: refreshAgents } = useModelConnectionStates(sta:open="editing":back="common.back":parent="ai.modelsTitle"+ back-in-detail@back="closeEditor"@open-auto-focus="focusEditor">diff --git a/src/components/settings/models/ProfileEditor.vue b/src/components/settings/models/ProfileEditor.vueindex e03fc34da..c99a371da 100644--- a/src/components/settings/models/ProfileEditor.vue+++ b/src/components/settings/models/ProfileEditor.vue@@ -13,6 +13,7 @@ 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'@@ -23,7 +24,6 @@ import ProviderSettingsField from '@/components/settings/provider/ProviderSettinimport ProviderSettingsInput from '@/components/settings/provider/ProviderSettingsInput.vue'import ProviderSettingsKeyField from '@/components/settings/provider/ProviderSettingsKeyField.vue'import AppButton from '@/components/ui/button/AppButton.vue'-import AppCollapsible from '@/components/ui/collapsible/AppCollapsible.vue'import { AppConfirmationDialog } from '@/components/ui/dialog'import AppInput from '@/components/ui/input/AppInput.vue'import AppCombobox from '@/components/ui/select/AppCombobox.vue'@@ -73,7 +73,15 @@ const feedback = useModelProfileFeedback(profile, keyInput, settings)const { errors: fieldErrors } = feedbackconst busy = computed(() => saving.value || connectionTestStatus.value === 'testing')const thinkingLevelOptions = computed(() => buildThinkingLevelOptions(ai.value))-useSettingsFormGuard({ dirty, busy, cancel: () => emit('done') })+useSettingsFormGuard({+ dirty,+ busy,+ cancel: () => emit('done'),+ crumb: {+ parent: () => ai.value.modelsTitle,+ title: () => (profileId ? ai.value.editModel : ai.value.addModel)+ }+})const CUSTOM_MODEL_VALUE = '__custom__'const advancedOpen = ref(Boolean(draft.customModelID.trim()))function updateProvider(id: AIProviderID) {@@ -119,27 +127,26 @@ async function remove() {@submit.prevent="save"><SettingsPage data-test-id="settings-model-editor">- <SettingsSection>- <template #title>{{ profileId ? ai.editModel : ai.addModel }}</template>- <template #description>{{ ai.modelEditorDescription }}</template>- <fieldset :disabled="busy" class="flex min-w-0 flex-col gap-3">- <ProviderSettingsField- v-slot="{ control }"- :label="ai.modelName"- :hint="settings.modelNameHint"- :error="fieldErrors.name"- @blur="feedback.blur('name')"- >- <AppInput- ref="nameInput"- v-bind="control"- v-model="draft.name"- :aria-label="ai.modelName"- :placeholder="modelDisplayName"- size="sm"- />- </ProviderSettingsField>+ <fieldset :disabled="busy" class="flex min-w-0 flex-col gap-6">+ <ProviderSettingsField+ v-slot="{ control }"+ :label="ai.modelName"+ :hint="settings.modelNameHint"+ :error="fieldErrors.name"+ @blur="feedback.blur('name')"+ >+ <AppInput+ ref="nameInput"+ v-bind="control"+ v-model="draft.name"+ :aria-label="ai.modelName"+ :placeholder="modelDisplayName"+ size="sm"+ />+ </ProviderSettingsField>+ <SettingsSection>+ <template #title>{{ ai.modelConfiguration }}</template><ProviderSettingsField :label="ai.provider"><ProviderSelect:model-value="draft.providerID"@@ -148,7 +155,6 @@ async function remove() {@update:model-value="updateProvider"/></ProviderSettingsField>-<divv-if="codingAgent.agent.value && codingAgent.state.value"class="flex flex-col gap-2"@@ -174,15 +180,7 @@ async function remove() {@install-bridge="pi.installBridge()"/></div>-<template v-if="!isACP">- <div class="flex items-center gap-2 pt-1">- <p class="text-[10px] font-medium uppercase tracking-wide text-muted">- {{ ai.modelConfiguration }}- </p>- <div class="h-px flex-1 bg-border" />- </div>-<ProviderSettingsFieldv-if="modelOptions.length && !isHarness"v-slot="{ control }"@@ -218,13 +216,12 @@ async function remove() {:placeholder="customModelPlaceholder"/></ProviderSettingsField>+ </template>+ </SettingsSection>- <div class="flex items-center gap-2 pt-1">- <p class="text-[10px] font-medium uppercase tracking-wide text-muted">- {{ ai.connectionSettings }}- </p>- <div class="h-px flex-1 bg-border" />- </div>+ <template v-if="!isACP">+ <SettingsSection>+ <template #title>{{ ai.connectionSettings }}</template><ProviderSettingsFieldv-if="providerDef.supportsCustomBaseURL"@@ -292,19 +289,11 @@ async function remove() {:disabled="busy"@test="testConnection"/>- </template>+ </SettingsSection>- <AppCollapsible- v-if="!isACP"- v-model:open="advancedOpen"- :ui="{- root: 'rounded border border-border',- trigger: 'px-2.5 py-2 text-[11px] text-muted hover:text-surface',- icon: 'size-3'- }"- >+ <SettingsDisclosure v-model:open="advancedOpen"><template #label>{{ ai.advancedModelSettings }}</template>- <div class="flex flex-col gap-3 border-t border-border p-2.5">+ <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">@@ -363,11 +352,11 @@ async function remove() {</p></div></div>- </AppCollapsible>+ </SettingsDisclosure>+ </template>- <SettingsSaveFeedback :error="saveError" :result="saveResult" />- </fieldset>- </SettingsSection>+ <SettingsSaveFeedback :error="saveError" :result="saveResult" />+ </fieldset><template #footer><AppButton v-if="canDelete" color="error" :disabled="busy" @click="deleteOpen = true">diff --git a/src/components/settings/provider/ProviderConnectionTestButton.vue b/src/components/settings/provider/ProviderConnectionTestButton.vueindex 2db1907a7..319c638a1 100644--- a/src/components/settings/provider/ProviderConnectionTestButton.vue+++ b/src/components/settings/provider/ProviderConnectionTestButton.vue@@ -62,6 +62,7 @@ const statusStyles = computed(() => tv(statusTheme)({ tone: resultTone.value }))<template><div class="flex flex-col gap-1"><AppButton+ class="self-start"variant="outline"data-test-id="provider-test-connection":loading="isTesting"diff --git a/src/components/settings/storage/StorageSettingsPanel.vue b/src/components/settings/storage/StorageSettingsPanel.vueindex a8bb84f9d..10c9c5cce 100644--- a/src/components/settings/storage/StorageSettingsPanel.vue+++ b/src/components/settings/storage/StorageSettingsPanel.vue@@ -50,7 +50,15 @@ const {saveResult,clearCredential} = connection-useSettingsFormGuard({ dirty, busy, cancel }, editing)+useSettingsFormGuard(+ {+ dirty,+ busy,+ cancel,+ crumb: { parent: () => settings.value.storage, title: () => provider.value.label }+ },+ editing+)function preferenceLabel(field: string) {if (field === 'endpoint') return storage.value.endpoint@@ -134,9 +142,7 @@ async function testConnection() {</p></SettingsSection></div>- <SettingsSection v-else>- <template #title>{{ settings.storage }}</template>- <template #description>{{ settings.saveChangesDescription }}</template>+ <div v-else class="flex flex-col gap-3"><fieldset :disabled="busy" class="flex min-w-0 flex-col gap-4"><ProviderSettingsFieldv-for="field in provider.preferenceFields"@@ -208,7 +214,7 @@ async function testConnection() {"/><SettingsSaveFeedback :error="error" :result="saveResult" />- </SettingsSection>+ </div><template v-if="editing" #footer><AppButton :disabled="busy" @click="cancel">{{ common.cancel }}</AppButton><AppButtondiff --git a/src/components/ui/panel/PanelDrillIn.vue b/src/components/ui/panel/PanelDrillIn.vueindex 733efeca1..175252cd1 100644--- a/src/components/ui/panel/PanelDrillIn.vue+++ b/src/components/ui/panel/PanelDrillIn.vue@@ -13,12 +13,23 @@ import drillInTheme from '@/theme/panel/drill-in'* 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.*/-const { open, back, parent, ui } = defineProps<{+const {+ open,+ back,+ parent,+ backInDetail = false,+ ui+} = defineProps<{open: boolean/** The accessible verb, "Back". */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?: booleanui?: ComponentUI<typeof drillInTheme>}>()const emit = defineEmits<{ back: []; openAutoFocus: [event: Event] }>()@@ -46,7 +57,7 @@ function uncover(element: Element) {:class="styles.detail({ class: ui?.detail })"@mount-auto-focus="emit('openAutoFocus', $event)">- <div data-slot="header" :class="styles.header({ class: ui?.header })">+ <div v-if="!backInDetail" 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/tests/e2e/settings/model-editor.spec.ts b/tests/e2e/settings/model-editor.spec.tsindex 2cf3801e5..cd38d2657 100644--- a/tests/e2e/settings/model-editor.spec.ts+++ b/tests/e2e/settings/model-editor.spec.ts@@ -18,9 +18,18 @@ test('model editing keeps the Settings shell stable and isolates the form', asynawait expect(editor).toBeVisible()await expect(dialog.getByText('Chat', { exact: true })).not.toBeVisible()await expect(dialog.getByRole('button', { name: 'Back', exact: true })).toHaveCount(0)+ await expect(page.getByTestId('settings-breadcrumb')).toHaveText(/Settings\s*Models\s*Add model/)await expect(page.getByTestId('app-settings-done')).toHaveCount(0)expect(await dialog.boundingBox()).toEqual(before)+ // An untouched form goes back through the breadcrumb without asking.+ await page.getByTestId('settings-editor-back').click()+ await expect(editor).toHaveCount(0)+ await expect(page.getByRole('alertdialog')).toHaveCount(0)+ await expect(page.getByTestId('settings-breadcrumb')).toHaveCount(0)+ await page.getByTestId('settings-add-model').click()+ await expect(editor).toBeVisible()+// Accidental dismissal must not throw away an in-progress profile.await editor.getByRole('textbox', { name: 'Name', exact: true }).fill('Draft profile')await page.keyboard.press('Escape')diff --git a/tests/engine/app/ai/profile-selection.test.ts b/tests/engine/app/ai/profile-selection.test.tsindex 56eb790bd..c68d2cbd8 100644--- a/tests/engine/app/ai/profile-selection.test.ts+++ b/tests/engine/app/ai/profile-selection.test.ts@@ -70,3 +70,53 @@ test('selection immediately applies loaded catalog metadata and display name', aresetModelsDevCatalogForTests()}})++test('catalog details read after opening go through the editor, which decides they are not edits', async () => {+ const originalFetch = globalThis.fetch+ globalThis.fetch = fetchStub(+ async () =>+ new Response(+ JSON.stringify({+ openai: {+ models: {+ 'catalog-model': {+ name: 'Catalog model',+ tool_call: true,+ attachment: true,+ modalities: { output: ['text'] },+ limit: { output: 32000 }+ }+ }+ }+ })+ )+ )+ resetModelsDevCatalogForTests()+ const scope = effectScope()+ try {+ const draft = reactive(createModelProfileDraft())+ draft.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++) {+ await new Promise((resolve) => {+ setTimeout(resolve, 0)+ })+ }+ expect(applied).toEqual([['tools', 'vision']])+ expect(draft.maxOutputTokens).toBe(32000)+ } finally {+ scope.stop()+ globalThis.fetch = originalFetch+ resetModelsDevCatalogForTests()+ }+})diff --git a/tools/checks/i18n/mixed-script-baseline.txt b/tools/checks/i18n/mixed-script-baseline.txtindex 394aeb0f7..59df82043 100644--- a/tools/checks/i18n/mixed-script-baseline.txt+++ b/tools/checks/i18n/mixed-script-baseline.txt@@ -92,7 +92,6 @@ ja:automation.bearerTokenja:automation.bearerTokenPlaceholderja:automation.bearerTokenRequiredja:automation.builtInAI-ja:automation.connectionEditorDescriptionja:automation.connectionNameHintja:automation.connectionNameInvalidja:automation.connections@@ -317,7 +316,6 @@ zh-cn:automation.bearerTokenzh-cn:automation.bearerTokenPlaceholderzh-cn:automation.bearerTokenRequiredzh-cn:automation.builtInAI-zh-cn:automation.connectionEditorDescriptionzh-cn:automation.connectionNameHintzh-cn:automation.connectionNameInvalidzh-cn:automation.connections