优化: 设置域体验完善

- 校验失败红框定位字段,保存反馈改持久化成功后
- 数值越界钳制,双提示队列化不再重叠
- 搜索防抖跳分类,托盘气泡文案进多语言
This commit is contained in:
lxy
2026-10-03 17:57:43 +08:00
parent f67e65633b
commit 8396849d04
19 changed files with 329 additions and 93 deletions
+20 -3
View File
@@ -44,7 +44,7 @@
<input
type="checkbox"
:checked="anthropicCache"
@change="anthropicCache = ($event.target as HTMLInputElement).checked"
@change="onAnthropicCacheChange(($event.target as HTMLInputElement).checked)"
/>
<span class="toggle-slider"></span>
</label>
@@ -57,8 +57,11 @@
:ai-providers="aiProviders"
/>
<!-- 性能:global/per-conv concurrency/max-iterations/max-retries -->
<PerformanceSection v-else-if="activeCategory === 'performance'" />
<!-- 性能:global/per-conv concurrency/max-iterations/max-retries(@toast 接走查 P3-14 越界修正提示) -->
<PerformanceSection
v-else-if="activeCategory === 'performance'"
@toast="showToast"
/>
<!-- 安全:allowed_dirs -->
<AllowedDirsPanel
@@ -153,6 +156,20 @@ onBeforeRouteLeave(async () => {
// 值落库为 JSON 布尔,后端 "true"/"1" 判定兼容)
const anthropicCache = appSettings.useSetting<boolean>('df-ai-anthropic-cache', false)
// 走查 P3-11:原开关切换零反馈,用户无从得知是否生效。改为 set 完成后 toast 反馈成败。
// 注:appSettings.set 当前落库失败仅 console 内吞(降级内存态),catch 是 store 上抛错误后
// 的失败通道,今日实际不触发(登记项见批次报告),成功反馈先补齐。
async function onAnthropicCacheChange(checked: boolean) {
anthropicCache.value = checked
try {
await appSettings.set('df-ai-anthropic-cache', checked)
showToast(ti18n('settings.toastAnthropicCacheSaved'), 'success')
} catch (e) {
console.error('保存 Prompt 缓存开关失败:', e)
showToast(ti18n('settings.toastAnthropicCacheFail'), 'error')
}
}
// 窄屏响应式:监听窗口宽度,nav 折叠为横向 tab(避免依赖仅 CSS 的 :has,
// 并让 SettingsNav 按横向模式渲染 list)
const isNarrowScreen = ref(false)