Skip to content

AI-native design editor. Open-source Figma alternative.

refactor(settings): share section layout and polish General

Danila Poyarkov99e7e1909e12
diff --git a/AGENTS.md b/AGENTS.md
index cc8a3a3fd..4a592dbe3 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -24,6 +24,8 @@ The root Tauri/Vite app lives in `src/`; app services and state belong under `sr
### Settings UI ownership
+Compose Settings sections with `SettingsSection` and its `title`, `description`, and default content slots. It owns heading association and internal spacing; `SettingsGroup` owns bordered row grouping. Do not repeat section/header/spacing markup in each feature.
+
Settings components own layout, translated copy, confirmation visibility, and emits. Reactive settings workflows live under the owning app domain's `settings/` folder (for example `src/app/ai/models/settings/profile-editor/{use,selection,connection}.ts`), not a global composables bucket. Use `use.ts` for orchestration and focused sibling modules for substantial sub-workflows. Keep persistence and external operations in domain services, and pure option projections as ordinary functions. Return operation outcomes rather than importing dialogs, routers, or toast UI into workflow composables. Keep newly entered secrets short-lived, never expose saved secrets, and guard async results against changed targets. Small presentation-only computed bindings can remain in components. New explicit settings forms use headless VeeValidate v5 with native Valibot schemas and existing controlled UI components; keep form state in the owning settings domain. Saved secrets and replacement-secret drafts stay outside form snapshots and devtools, and persistence/concurrency remain in domain workflows rather than form callbacks.
### Public package exports
diff --git a/packages/vue/src/i18n/locales/de/credentials.json b/packages/vue/src/i18n/locales/de/credentials.json
index 00233ac2b..8a724dc85 100644
--- a/packages/vue/src/i18n/locales/de/credentials.json
+++ b/packages/vue/src/i18n/locales/de/credentials.json
@@ -8,7 +8,7 @@
"getAPIKey": "API-Schlüssel abrufen →",
"retryAccess": "Zugriff erneut versuchen",
"retryFailed": "Der Zugriff konnte nicht zurückgesetzt werden. Versuche es erneut.",
- "settingsTitle": "Gespeicherte Passwörter und API-Schlüssel",
+ "settingsTitle": "Gespeicherte Zugangsdaten",
"accessPaused": "Der Zugriff auf gespeicherte Zugangsdaten ist pausiert.",
"rememberDevice": "API-Schlüssel auf diesem Gerät speichern",
"sessionOnly": "Schlüssel werden nur bis zum Ende dieser Sitzung gespeichert.",
diff --git a/packages/vue/src/i18n/locales/de/rendering.json b/packages/vue/src/i18n/locales/de/rendering.json
index 95a937a23..ed2a4b14a 100644
--- a/packages/vue/src/i18n/locales/de/rendering.json
+++ b/packages/vue/src/i18n/locales/de/rendering.json
@@ -1,8 +1,9 @@
{
"settingsTitle": "Darstellung",
"settingsDescription": "Wähle, wie OpenPencil große Arbeitsflächen darstellt.",
- "progressiveTiled": "Progressive gekachelte Darstellung",
- "progressiveTiledDescription": "Aktualisiert große Arbeitsflächen beim Navigieren in begrenzten Kacheln. Experimentell; Neuladen erforderlich.",
+ "progressiveTiled": "Progressives Rendering",
+ "progressiveTiledDescription": "Aktualisiert große Zeichenflächen beim Navigieren in kleineren Kacheln.",
"reloadRequired": "Lade OpenPencil neu, um diese Änderung anzuwenden.",
- "urlOverride": "Der Renderer dieser Sitzung wird durch einen URL-Parameter gesteuert. Deine gespeicherte Einstellung gilt, sobald der Parameter entfernt wird."
+ "urlOverride": "Der Renderer dieser Sitzung wird durch einen URL-Parameter gesteuert. Deine gespeicherte Einstellung gilt, sobald der Parameter entfernt wird.",
+ "experimental": "Experimentell"
}
diff --git a/packages/vue/src/i18n/locales/es/credentials.json b/packages/vue/src/i18n/locales/es/credentials.json
index 94f692827..81ad3317d 100644
--- a/packages/vue/src/i18n/locales/es/credentials.json
+++ b/packages/vue/src/i18n/locales/es/credentials.json
@@ -8,7 +8,7 @@
"getAPIKey": "Obtener clave API →",
"retryAccess": "Reintentar acceso",
"retryFailed": "No se pudo restablecer el acceso. Inténtalo de nuevo.",
- "settingsTitle": "Contraseñas y claves API guardadas",
+ "settingsTitle": "Credenciales guardadas",
"accessPaused": "El acceso a las credenciales guardadas está en pausa.",
"rememberDevice": "Recordar claves API en este dispositivo",
"sessionOnly": "Las claves se conservan solo hasta que cierres esta sesión.",
diff --git a/packages/vue/src/i18n/locales/es/rendering.json b/packages/vue/src/i18n/locales/es/rendering.json
index 89800c2ce..20174fad8 100644
--- a/packages/vue/src/i18n/locales/es/rendering.json
+++ b/packages/vue/src/i18n/locales/es/rendering.json
@@ -1,8 +1,9 @@
{
"settingsTitle": "Renderizado",
"settingsDescription": "Elige cómo presenta OpenPencil los lienzos grandes.",
- "progressiveTiled": "Renderizado progresivo por mosaicos",
- "progressiveTiledDescription": "Actualiza los lienzos grandes en mosaicos limitados durante la navegación. Experimental; requiere recargar.",
+ "progressiveTiled": "Renderizado progresivo",
+ "progressiveTiledDescription": "Actualiza los lienzos grandes en mosaicos más pequeños mientras navegas.",
"reloadRequired": "Recarga OpenPencil para aplicar este cambio.",
- "urlOverride": "El renderizador de esta sesión está controlado por un parámetro de URL. Tu preferencia guardada se aplicará al eliminarlo."
+ "urlOverride": "El renderizador de esta sesión está controlado por un parámetro de URL. Tu preferencia guardada se aplicará al eliminarlo.",
+ "experimental": "Experimental"
}
diff --git a/packages/vue/src/i18n/locales/fr/credentials.json b/packages/vue/src/i18n/locales/fr/credentials.json
index efe579576..5cb717d2c 100644
--- a/packages/vue/src/i18n/locales/fr/credentials.json
+++ b/packages/vue/src/i18n/locales/fr/credentials.json
@@ -8,7 +8,7 @@
"getAPIKey": "Obtenir une clé API →",
"retryAccess": "Réessayer l’accès",
"retryFailed": "Impossible de réinitialiser l’accès. Réessayez.",
- "settingsTitle": "Mots de passe et clés API enregistrés",
+ "settingsTitle": "Identifiants enregistrés",
"accessPaused": "L’accès aux identifiants enregistrés est suspendu.",
"rememberDevice": "Mémoriser les clés API sur cet appareil",
"sessionOnly": "Les clés sont conservées uniquement jusqu’à la fermeture de cette session.",
diff --git a/packages/vue/src/i18n/locales/fr/rendering.json b/packages/vue/src/i18n/locales/fr/rendering.json
index cc930683a..0e70ec748 100644
--- a/packages/vue/src/i18n/locales/fr/rendering.json
+++ b/packages/vue/src/i18n/locales/fr/rendering.json
@@ -1,8 +1,9 @@
{
"settingsTitle": "Rendu",
"settingsDescription": "Choisissez comment OpenPencil affiche les grandes zones de travail.",
- "progressiveTiled": "Rendu progressif par tuiles",
- "progressiveTiledDescription": "Met à jour les grandes zones de travail par tuiles limitées pendant la navigation. Expérimental ; rechargement requis.",
+ "progressiveTiled": "Rendu progressif",
+ "progressiveTiledDescription": "Actualise les grands canevas par petites tuiles pendant la navigation.",
"reloadRequired": "Rechargez OpenPencil pour appliquer cette modification.",
- "urlOverride": "Le rendu de cette session est contrôlé par un paramètre d’URL. Votre préférence enregistrée s’appliquera après sa suppression."
+ "urlOverride": "Le rendu de cette session est contrôlé par un paramètre d’URL. Votre préférence enregistrée s’appliquera après sa suppression.",
+ "experimental": "Expérimental"
}
diff --git a/packages/vue/src/i18n/locales/it/credentials.json b/packages/vue/src/i18n/locales/it/credentials.json
index af91374d6..ee56afcc0 100644
--- a/packages/vue/src/i18n/locales/it/credentials.json
+++ b/packages/vue/src/i18n/locales/it/credentials.json
@@ -8,7 +8,7 @@
"getAPIKey": "Ottieni chiave API →",
"retryAccess": "Riprova l’accesso",
"retryFailed": "Impossibile ripristinare l’accesso. Riprova.",
- "settingsTitle": "Password e chiavi API salvate",
+ "settingsTitle": "Credenziali salvate",
"accessPaused": "L’accesso alle credenziali salvate è sospeso.",
"rememberDevice": "Ricorda le chiavi API su questo dispositivo",
"sessionOnly": "Le chiavi vengono conservate solo fino alla chiusura di questa sessione.",
diff --git a/packages/vue/src/i18n/locales/it/rendering.json b/packages/vue/src/i18n/locales/it/rendering.json
index e4e82ae8a..67be91e06 100644
--- a/packages/vue/src/i18n/locales/it/rendering.json
+++ b/packages/vue/src/i18n/locales/it/rendering.json
@@ -1,8 +1,9 @@
{
"settingsTitle": "Rendering",
"settingsDescription": "Scegli come OpenPencil visualizza le aree di lavoro di grandi dimensioni.",
- "progressiveTiled": "Rendering progressivo a riquadri",
- "progressiveTiledDescription": "Aggiorna le aree di lavoro grandi in riquadri limitati durante la navigazione. Sperimentale; richiede il ricaricamento.",
+ "progressiveTiled": "Rendering progressivo",
+ "progressiveTiledDescription": "Aggiorna le tele di grandi dimensioni in riquadri più piccoli durante la navigazione.",
"reloadRequired": "Ricarica OpenPencil per applicare questa modifica.",
- "urlOverride": "Il renderer della sessione corrente è controllato da un parametro URL. La preferenza salvata verrà applicata quando il parametro sarà rimosso."
+ "urlOverride": "Il renderer della sessione corrente è controllato da un parametro URL. La preferenza salvata verrà applicata quando il parametro sarà rimosso.",
+ "experimental": "Sperimentale"
}
diff --git a/packages/vue/src/i18n/locales/ja/credentials.json b/packages/vue/src/i18n/locales/ja/credentials.json
index c268b6ef6..5df049ad6 100644
--- a/packages/vue/src/i18n/locales/ja/credentials.json
+++ b/packages/vue/src/i18n/locales/ja/credentials.json
@@ -8,7 +8,7 @@
"getAPIKey": "APIキーを取得 →",
"retryAccess": "アクセスを再試行",
"retryFailed": "アクセスをリセットできませんでした。もう一度お試しください。",
- "settingsTitle": "保存済みパスワードとAPIキー",
+ "settingsTitle": "保存済みの認証情報",
"accessPaused": "保存済み認証情報へのアクセスは一時停止中です。",
"rememberDevice": "このデバイスにAPIキーを保存",
"sessionOnly": "キーはこのセッションを閉じるまでのみ保持されます。",
diff --git a/packages/vue/src/i18n/locales/ja/rendering.json b/packages/vue/src/i18n/locales/ja/rendering.json
index 640f6afef..49eed7faa 100644
--- a/packages/vue/src/i18n/locales/ja/rendering.json
+++ b/packages/vue/src/i18n/locales/ja/rendering.json
@@ -1,8 +1,9 @@
{
"settingsTitle": "レンダリング",
"settingsDescription": "大きなキャンバスを OpenPencil で表示する方法を選択します。",
- "progressiveTiled": "プログレッシブタイルレンダリング",
- "progressiveTiledDescription": "移動中に大きなキャンバスを限定されたタイル単位で更新します。試験機能のため、再読み込みが必要です。",
+ "progressiveTiled": "段階的な描画",
+ "progressiveTiledDescription": "移動中に大きなキャンバスを小さなタイルに分けて更新します。",
"reloadRequired": "この変更を適用するには OpenPencil を再読み込みしてください。",
- "urlOverride": "現在のセッションのレンダラーは URL パラメーターで指定されています。保存した設定はパラメーターを削除すると適用されます。"
+ "urlOverride": "現在のセッションのレンダラーは URL パラメーターで指定されています。保存した設定はパラメーターを削除すると適用されます。",
+ "experimental": "試験的機能"
}
diff --git a/packages/vue/src/i18n/locales/pl/credentials.json b/packages/vue/src/i18n/locales/pl/credentials.json
index 6170a3706..b6cc8415a 100644
--- a/packages/vue/src/i18n/locales/pl/credentials.json
+++ b/packages/vue/src/i18n/locales/pl/credentials.json
@@ -8,7 +8,7 @@
"getAPIKey": "Pobierz klucz API →",
"retryAccess": "Ponów dostęp",
"retryFailed": "Nie udało się zresetować dostępu. Spróbuj ponownie.",
- "settingsTitle": "Zapisane hasła i klucze API",
+ "settingsTitle": "Zapisane dane uwierzytelniające",
"accessPaused": "Dostęp do zapisanych danych logowania jest wstrzymany.",
"rememberDevice": "Zapamiętaj klucze API na tym urządzeniu",
"sessionOnly": "Klucze są przechowywane tylko do zamknięcia tej sesji.",
diff --git a/packages/vue/src/i18n/locales/pl/rendering.json b/packages/vue/src/i18n/locales/pl/rendering.json
index 4596df46e..cf1e970a7 100644
--- a/packages/vue/src/i18n/locales/pl/rendering.json
+++ b/packages/vue/src/i18n/locales/pl/rendering.json
@@ -1,8 +1,9 @@
{
"settingsTitle": "Renderowanie",
"settingsDescription": "Wybierz sposób wyświetlania dużych obszarów roboczych w OpenPencil.",
- "progressiveTiled": "Progresywne renderowanie kafelkowe",
- "progressiveTiledDescription": "Podczas nawigacji aktualizuje duże obszary robocze w ograniczonych kafelkach. Funkcja eksperymentalna; wymaga ponownego wczytania.",
+ "progressiveTiled": "Renderowanie progresywne",
+ "progressiveTiledDescription": "Aktualizuje duże płótna w mniejszych kafelkach podczas nawigacji.",
"reloadRequired": "Wczytaj ponownie OpenPencil, aby zastosować tę zmianę.",
- "urlOverride": "Renderer bieżącej sesji jest kontrolowany przez parametr URL. Zapisana preferencja zostanie użyta po usunięciu parametru."
+ "urlOverride": "Renderer bieżącej sesji jest kontrolowany przez parametr URL. Zapisana preferencja zostanie użyta po usunięciu parametru.",
+ "experimental": "Eksperymentalne"
}
diff --git a/packages/vue/src/i18n/locales/ru/credentials.json b/packages/vue/src/i18n/locales/ru/credentials.json
index 655fa3e4b..96aa96c6f 100644
--- a/packages/vue/src/i18n/locales/ru/credentials.json
+++ b/packages/vue/src/i18n/locales/ru/credentials.json
@@ -8,7 +8,7 @@
"getAPIKey": "Получить API-ключ →",
"retryAccess": "Повторить доступ",
"retryFailed": "Не удалось сбросить блокировку доступа. Повторите попытку.",
- "settingsTitle": "Сохранённые пароли и API-ключи",
+ "settingsTitle": "Сохранённые учётные данные",
"accessPaused": "Доступ к сохранённым учётным данным приостановлен.",
"rememberDevice": "Запоминать API-ключи на этом устройстве",
"sessionOnly": "Ключи хранятся только до закрытия этой сессии.",
diff --git a/packages/vue/src/i18n/locales/ru/rendering.json b/packages/vue/src/i18n/locales/ru/rendering.json
index 385557f31..6be58e56e 100644
--- a/packages/vue/src/i18n/locales/ru/rendering.json
+++ b/packages/vue/src/i18n/locales/ru/rendering.json
@@ -1,8 +1,9 @@
{
"settingsTitle": "Отрисовка",
"settingsDescription": "Выберите способ отображения больших холстов в OpenPencil.",
- "progressiveTiled": "Прогрессивная плиточная отрисовка",
- "progressiveTiledDescription": "При навигации обновляет большие холсты ограниченными плитками. Экспериментальная функция; требуется перезагрузка.",
+ "progressiveTiled": "Поэтапная отрисовка",
+ "progressiveTiledDescription": "Обновляет большие холсты небольшими плитками во время навигации.",
"reloadRequired": "Перезагрузите OpenPencil, чтобы применить изменение.",
- "urlOverride": "Режим отрисовки текущего сеанса задан параметром URL. Сохранённая настройка применится после удаления параметра."
+ "urlOverride": "Режим отрисовки текущего сеанса задан параметром URL. Сохранённая настройка применится после удаления параметра.",
+ "experimental": "Экспериментально"
}
diff --git a/packages/vue/src/i18n/locales/zh-cn/credentials.json b/packages/vue/src/i18n/locales/zh-cn/credentials.json
index 9ed3e336c..3457b4a02 100644
--- a/packages/vue/src/i18n/locales/zh-cn/credentials.json
+++ b/packages/vue/src/i18n/locales/zh-cn/credentials.json
@@ -8,7 +8,7 @@
"getAPIKey": "获取 API 密钥 →",
"retryAccess": "重试访问",
"retryFailed": "无法重置凭据访问。请重试。",
- "settingsTitle": "已保存的密码和 API 密钥",
+ "settingsTitle": "已保存的凭据",
"accessPaused": "对已保存凭据的访问已暂停。",
"rememberDevice": "在此设备上记住 API 密钥",
"sessionOnly": "密钥仅保留到此会话关闭。",
diff --git a/packages/vue/src/i18n/locales/zh-cn/rendering.json b/packages/vue/src/i18n/locales/zh-cn/rendering.json
index 24c75324f..d03769f8d 100644
--- a/packages/vue/src/i18n/locales/zh-cn/rendering.json
+++ b/packages/vue/src/i18n/locales/zh-cn/rendering.json
@@ -1,8 +1,9 @@
{
"settingsTitle": "渲染",
"settingsDescription": "选择 OpenPencil 显示大型画布的方式。",
- "progressiveTiled": "渐进式分块画布渲染",
- "progressiveTiledDescription": "导航时以有限大小的分块更新大型画布。此功能为实验性功能,需要重新加载。",
+ "progressiveTiled": "渐进式渲染",
+ "progressiveTiledDescription": "导航时将大型画布分成较小的图块进行更新。",
"reloadRequired": "重新加载 OpenPencil 以应用此更改。",
- "urlOverride": "当前会话的渲染器由 URL 参数控制。移除该参数后将应用已保存的偏好设置。"
+ "urlOverride": "当前会话的渲染器由 URL 参数控制。移除该参数后将应用已保存的偏好设置。",
+ "experimental": "实验性功能"
}
diff --git a/packages/vue/src/i18n/messages/credentials.ts b/packages/vue/src/i18n/messages/credentials.ts
index 983836ee6..43ba2fa68 100644
--- a/packages/vue/src/i18n/messages/credentials.ts
+++ b/packages/vue/src/i18n/messages/credentials.ts
@@ -6,7 +6,7 @@ export const credentialsMessageDefaults = {
checkFailed: 'Could not check access to saved credentials.',
retryCheck: 'Retry check',
retryAccess: 'Retry access',
- settingsTitle: 'Saved passwords and API keys',
+ settingsTitle: 'Saved credentials',
accessPaused: 'Access to saved credentials is paused.',
rememberDevice: 'Remember API keys on this device',
sessionOnly: 'Keys are kept only until you close this session.',
diff --git a/packages/vue/src/i18n/messages/rendering.ts b/packages/vue/src/i18n/messages/rendering.ts
index 45e7eae6e..bfc6a8613 100644
--- a/packages/vue/src/i18n/messages/rendering.ts
+++ b/packages/vue/src/i18n/messages/rendering.ts
@@ -3,9 +3,9 @@ import { i18n } from '#vue/i18n/create'
export const renderingMessageDefaults = {
settingsTitle: 'Rendering',
settingsDescription: 'Choose how OpenPencil presents large canvases.',
- progressiveTiled: 'Progressive tiled canvas rendering',
- progressiveTiledDescription:
- 'Updates large canvases in bounded tiles while navigating. Experimental; reload required.',
+ progressiveTiled: 'Progressive rendering',
+ progressiveTiledDescription: 'Updates large canvases in smaller tiles as you navigate.',
+ experimental: 'Experimental',
reloadRequired: 'Reload OpenPencil to apply this change.',
urlOverride:
'The current session renderer is controlled by a URL override. Your saved preference applies when the override is removed.'
diff --git a/src/components/settings/credentials/CredentialSettingsSection.vue b/src/components/settings/credentials/CredentialSettingsSection.vue
index 714533561..19a4f9b57 100644
--- a/src/components/settings/credentials/CredentialSettingsSection.vue
+++ b/src/components/settings/credentials/CredentialSettingsSection.vue
@@ -4,7 +4,7 @@ import { useI18n } from '@open-pencil/vue'
import { useCredentialSettings } from '@/app/settings/credentials/preferences/use'
import SettingsGroup from '@/components/settings/layout/SettingsGroup.vue'
-import SettingsSectionHeader from '@/components/settings/layout/SettingsSectionHeader.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'
import AppSwitch from '@/components/ui/toggle/AppSwitch.vue'
@@ -14,8 +14,8 @@ const { busy, paused, failed, checkFailed, remembered, retry, retryCheck } = use
</script>
<template>
- <template v-if="!IS_TAURI || paused || failed || checkFailed">
- <SettingsSectionHeader>{{ credentials.settingsTitle }}</SettingsSectionHeader>
+ <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>
@@ -42,5 +42,5 @@ const { busy, paused, failed, checkFailed, remembered, retry, retryCheck } = use
</template>
</AppAlert>
<AppAlert v-if="failed" tone="error" :heading="credentials.retryFailed" />
- </template>
+ </SettingsSection>
</template>
diff --git a/src/components/settings/general/GeneralSettingsPanel.vue b/src/components/settings/general/GeneralSettingsPanel.vue
index 8dd2a54b8..958e52fe6 100644
--- a/src/components/settings/general/GeneralSettingsPanel.vue
+++ b/src/components/settings/general/GeneralSettingsPanel.vue
@@ -11,13 +11,14 @@ import { useAppTheme } from '@/app/shell/theme'
import CredentialSettingsSection from '@/components/settings/credentials/CredentialSettingsSection.vue'
import RenderingSettingsSection from '@/components/settings/general/RenderingSettingsSection.vue'
import SettingsGroup from '@/components/settings/layout/SettingsGroup.vue'
-import SettingsSectionHeader from '@/components/settings/layout/SettingsSectionHeader.vue'
+import SettingsSection from '@/components/settings/layout/SettingsSection.vue'
import AppSelect from '@/components/ui/select/AppSelect.vue'
import AppSwitch from '@/components/ui/toggle/AppSwitch.vue'
const { availableLocales, locale, localeLabels, menu, recovery, setLocale, settings } = useI18n()
const { theme } = useAppTheme()
+const selectUI = { trigger: 'w-full sm:w-52' }
const language = computed<Locale>({
get: () => locale.value,
@@ -51,27 +52,26 @@ const snapToPixelGrid = computed({
</script>
<template>
- <section class="flex flex-col gap-4" data-test-id="settings-general-panel">
- <div>
- <h3 class="text-xs font-semibold text-surface">{{ menu.language }}</h3>
- <p class="mt-1 text-[11px] text-muted">{{ settings.languageDescription }}</p>
- </div>
-
- <div class="flex flex-col rounded border border-border">
- <label class="flex items-center justify-between gap-4 px-3 py-2.5">
- <span class="text-xs text-surface">{{ menu.language }}</span>
- <AppSelect
- v-model="language"
- :label="menu.language"
- :options="languageOptions"
- class="w-44"
- data-test-id="settings-language"
- />
- </label>
- </div>
-
- <section class="flex flex-col gap-4" :aria-label="settings.appearance">
- <SettingsSectionHeader>{{ settings.appearance }}</SettingsSectionHeader>
+ <section class="flex flex-col gap-6" data-test-id="settings-general-panel">
+ <SettingsSection>
+ <template #title>{{ menu.language }}</template>
+ <template #description>{{ settings.languageDescription }}</template>
+ <SettingsGroup>
+ <label class="flex items-center justify-between gap-4 px-3 py-2.5">
+ <span class="text-xs text-surface">{{ menu.language }}</span>
+ <AppSelect
+ v-model="language"
+ :label="menu.language"
+ :options="languageOptions"
+ :ui="selectUI"
+ data-test-id="settings-language"
+ />
+ </label>
+ </SettingsGroup>
+ </SettingsSection>
+
+ <SettingsSection>
+ <template #title>{{ settings.appearance }}</template>
<SettingsGroup>
<label class="flex items-center justify-between gap-4 px-3 py-2.5">
<span class="text-xs text-surface">{{ menu.theme }}</span>
@@ -83,7 +83,7 @@ const snapToPixelGrid = computed({
{ value: 'light', label: menu.themeLight },
{ value: 'dark', label: menu.themeDark }
]"
- class="w-44"
+ :ui="selectUI"
/>
</label>
<label class="flex items-center justify-between gap-4 px-3 py-2.5">
@@ -95,77 +95,80 @@ const snapToPixelGrid = computed({
{ value: 'system', label: settings.animationsSystem },
{ value: 'off', label: settings.animationsOff }
]"
- class="w-44"
+ :ui="selectUI"
+ />
+ </label>
+ </SettingsGroup>
+ </SettingsSection>
+
+ <SettingsSection>
+ <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>
+ <AppSwitch
+ v-model="preserveUnsavedWork"
+ :label="recovery.preserveUnsavedWork"
+ data-test-id="settings-recovery-enabled"
/>
</label>
</SettingsGroup>
- </section>
-
- <SettingsSectionHeader>
- {{ recovery.settingsTitle }}
- <template #description>{{ recovery.settingsDescription }}</template>
- </SettingsSectionHeader>
-
- <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>
- <AppSwitch
- v-model="preserveUnsavedWork"
- :label="recovery.preserveUnsavedWork"
- data-test-id="settings-recovery-enabled"
- />
- </label>
- </SettingsGroup>
-
- <SettingsSectionHeader>
- {{ settings.editing }}
+ </SettingsSection>
+
+ <SettingsSection>
+ <template #title>{{ settings.editing }}</template>
<template #description>{{ settings.snappingDescription }}</template>
- </SettingsSectionHeader>
-
- <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>
- <AppSwitch
- v-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>
- <AppSwitch
- v-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>
- <AppSwitch
- v-model="snapToPixelGrid"
- :label="settings.snapToPixelGrid"
- data-test-id="settings-snap-pixel-grid"
- />
- </label>
- </SettingsGroup>
-
- <p class="text-[10px] text-muted">{{ settings.temporaryDisableSnappingHint }}</p>
+
+ <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>
+ <AppSwitch
+ v-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>
+ <AppSwitch
+ v-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>
+ <AppSwitch
+ v-model="snapToPixelGrid"
+ :label="settings.snapToPixelGrid"
+ data-test-id="settings-snap-pixel-grid"
+ />
+ </label>
+ </SettingsGroup>
+
+ <p class="text-[11px] text-muted">{{ settings.temporaryDisableSnappingHint }}</p>
+ </SettingsSection>
<CredentialSettingsSection />
<RenderingSettingsSection />
diff --git a/src/components/settings/general/RenderingSettingsSection.vue b/src/components/settings/general/RenderingSettingsSection.vue
index 85674ae18..d894370b7 100644
--- a/src/components/settings/general/RenderingSettingsSection.vue
+++ b/src/components/settings/general/RenderingSettingsSection.vue
@@ -6,7 +6,9 @@ import { useI18n } from '@open-pencil/vue'
import { appRuntimeConfig } from '@/app/runtime/config'
import { appPreferences, updateCanvasRenderingMode } from '@/app/settings/preferences/store'
import SettingsGroup from '@/components/settings/layout/SettingsGroup.vue'
-import SettingsSectionHeader from '@/components/settings/layout/SettingsSectionHeader.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'
import AppSwitch from '@/components/ui/toggle/AppSwitch.vue'
const { rendering } = useI18n()
@@ -22,32 +24,31 @@ function setTiledRendering(enabled: boolean): void {
</script>
<template>
- <SettingsSectionHeader>
- {{ rendering.settingsTitle }}
+ <SettingsSection>
+ <template #title>{{ rendering.settingsTitle }}</template>
<template #description>{{ rendering.settingsDescription }}</template>
- </SettingsSectionHeader>
- <SettingsGroup>
- <label class="flex items-center justify-between gap-4 px-3 py-2.5">
- <span>
- <span class="block text-xs text-surface">{{ rendering.progressiveTiled }}</span>
- <span class="block text-[10px] text-muted">{{
- rendering.progressiveTiledDescription
- }}</span>
- </span>
- <AppSwitch
- :model-value="tiledRendering"
- :label="rendering.progressiveTiled"
- data-test-id="settings-progressive-tiled-rendering"
- @update:model-value="setTiledRendering"
- />
- </label>
- </SettingsGroup>
+ <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">
+ {{ rendering.progressiveTiled }}
+ <AppBadge :ui="{ base: 'bg-hover text-surface' }">{{ rendering.experimental }}</AppBadge>
+ </span>
+ <span class="block text-[10px] text-muted">{{
+ rendering.progressiveTiledDescription
+ }}</span>
+ </span>
+ <AppSwitch
+ :model-value="tiledRendering"
+ :label="rendering.progressiveTiled"
+ data-test-id="settings-progressive-tiled-rendering"
+ @update:model-value="setTiledRendering"
+ />
+ </label>
+ </SettingsGroup>
- <p v-if="hasURLOverride" class="text-[10px] text-muted">
- {{ rendering.urlOverride }}
- </p>
- <p v-else-if="changed" class="text-[10px] text-muted">
- {{ rendering.reloadRequired }}
- </p>
+ <AppAlert v-if="hasURLOverride" :heading="rendering.urlOverride" />
+ <AppAlert v-else-if="changed" :heading="rendering.reloadRequired" />
+ </SettingsSection>
</template>
diff --git a/src/components/settings/layout/SettingsSection.stories.ts b/src/components/settings/layout/SettingsSection.stories.ts
new file mode 100644
index 000000000..a4b94fd9c
--- /dev/null
+++ b/src/components/settings/layout/SettingsSection.stories.ts
@@ -0,0 +1,42 @@
+import type { Meta, StoryObj } from '@storybook/vue3-vite'
+
+import AppSwitch from '@/components/ui/toggle/AppSwitch.vue'
+
+import SettingsGroup from './SettingsGroup.vue'
+import SettingsRow from './SettingsRow.vue'
+import SettingsSection from './SettingsSection.vue'
+
+interface Args {
+ heading: string
+ description?: string
+}
+
+const meta = {
+ title: 'Settings/Layout/Section',
+ component: SettingsSection,
+ args: { heading: 'Recovery' },
+ render: (args) => ({
+ components: { SettingsSection, SettingsGroup, SettingsRow, AppSwitch },
+ setup: () => ({ args }),
+ template: `
+ <div class="max-w-xl">
+ <SettingsSection>
+ <template #title>{{ args.heading }}</template>
+ <template v-if="args.description" #description>{{ args.description }}</template>
+ <SettingsGroup>
+ <SettingsRow label="Preserve unsaved work" description="Keep local recovery copies of your documents.">
+ <AppSwitch :model-value="true" label="Preserve unsaved work" />
+ </SettingsRow>
+ </SettingsGroup>
+ </SettingsSection>
+ </div>`
+ })
+} satisfies Meta<Args>
+
+export default meta
+type Story = StoryObj<typeof meta>
+
+export const Default: Story = {}
+export const WithDescription: Story = {
+ args: { description: 'Restore your documents after an unexpected shutdown.' }
+}
diff --git a/src/components/settings/layout/SettingsSection.vue b/src/components/settings/layout/SettingsSection.vue
new file mode 100644
index 000000000..13ce28e5d
--- /dev/null
+++ b/src/components/settings/layout/SettingsSection.vue
@@ -0,0 +1,17 @@
+<script setup lang="ts">
+import { useId } from 'vue'
+
+import SettingsSectionHeader from './SettingsSectionHeader.vue'
+
+const headingId = useId()
+</script>
+
+<template>
+ <section class="flex flex-col gap-3" :aria-labelledby="headingId">
+ <SettingsSectionHeader>
+ <span :id="headingId"><slot name="title" /></span>
+ <template v-if="$slots.description" #description><slot name="description" /></template>
+ </SettingsSectionHeader>
+ <slot />
+ </section>
+</template>
diff --git a/tests/e2e/settings/general.spec.ts b/tests/e2e/settings/general.spec.ts
index 33d01bf9d..72cfbe8d2 100644
--- a/tests/e2e/settings/general.spec.ts
+++ b/tests/e2e/settings/general.spec.ts
@@ -69,7 +69,7 @@ test('progressive tiled rendering preference persists and URL overrides take pre
await canvas.waitForInit()
await page.getByTestId('app-settings-trigger').click()
- const tiled = page.getByRole('switch', { name: 'Progressive tiled canvas rendering' })
+ const tiled = page.getByRole('switch', { name: 'Progressive rendering' })
await expect(tiled).not.toBeChecked()
await tiled.click()
await expect(page.getByText('Reload OpenPencil to apply this change.')).toBeVisible()
diff --git a/tests/e2e/settings/tabs.spec.ts-snapshots/settings-tabs-general-openpencil-darwin.png b/tests/e2e/settings/tabs.spec.ts-snapshots/settings-tabs-general-openpencil-darwin.png
index a3f877d4b..90de81735 100644
Binary files a/tests/e2e/settings/tabs.spec.ts-snapshots/settings-tabs-general-openpencil-darwin.png and b/tests/e2e/settings/tabs.spec.ts-snapshots/settings-tabs-general-openpencil-darwin.png differ
diff --git a/tools/i18n/mixed-script-baseline.txt b/tools/i18n/mixed-script-baseline.txt
index 09c19c04d..534d111cb 100644
--- a/tools/i18n/mixed-script-baseline.txt
+++ b/tools/i18n/mixed-script-baseline.txt
@@ -237,7 +237,5 @@ zh-cn:updates.upToDate
ja:ai.copyACPLog
zh-cn:ai.copyACPLog
-ja:credentials.settingsTitle
ja:credentials.rememberDevice
-zh-cn:credentials.settingsTitle
zh-cn:credentials.rememberDevice
diff --git a/tools/i18n/translation-baseline.txt b/tools/i18n/translation-baseline.txt
index 24828ce7f..129828532 100644
--- a/tools/i18n/translation-baseline.txt
+++ b/tools/i18n/translation-baseline.txt
@@ -71,6 +71,7 @@ es:panels.localLibraries
es:panels.radialGradient
es:panels.textCaseOriginal
es:panels.variables
+es:rendering.experimental
es:settings.general
es:storage.bucket
es:storage.providerAmazonS3