fix(ui): 设置面板打开时拉取清单 + Superpowers 进开关行

- SettingsPanel: onMounted 改 watch(open)——抽屉打开才 load(此前抽屉未开时
  load 早已跑完,清单为空,四开关行也不渲染,「暂无插件」误导)
- visibleCaps 扩为四项(memory/web_search/humanize/superpowers)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
jerry
2026-09-02 22:31:51 +08:00
co-authored by Claude Fable 5
parent 60a81083c7
commit 5cb15b0fac
+15 -8
View File
@@ -1,8 +1,8 @@
<script setup>
// SettingsPanel.vue —— 能力设置面板(S4)
// 三项开关(多轮记忆/联网搜索/答案润色)+ 已装插件清单 + web_search gated_by 提示。
// 复用 Drawer 形态(360px),由 AppShell 挂载。
import { onMounted, ref } from 'vue';
// 四个能力行(多轮记忆/联网搜索/答案润色/Superpowers)+ 已装插件清单。
// 复用 Drawer 形态(360px),由 AppShell 挂载;抽屉打开时拉取清单。
import { ref, watch } from 'vue';
import { useSettingsStore } from '../../stores/settings.js';
import { useSessionsStore } from '../../stores/sessions.js';
import { T } from '../../i18n/labels.js';
@@ -17,12 +17,19 @@ const sessions = useSessionsStore();
const toggling = ref(null);
const toggleError = ref('');
const visibleCaps = () =>
settings.manifest.filter((c) => c.name === 'memory' || c.name === 'web_search' || c.name === 'humanize');
// 抽屉打开时才拉取(组件随 AppShell 常驻挂载,onMounted 时抽屉未开)
watch(
() => props.open,
(open) => {
if (open) load();
}
);
onMounted(() => {
if (props.open) load();
});
// 四项能力全部可见(superpowers 为 env 总闸控制,行内展示 gated 提示)
const visibleCaps = () =>
settings.manifest.filter(
(c) => ['memory', 'web_search', 'humanize', 'superpowers'].includes(c.name)
);
async function load() {
toggleError.value = '';