fix(plugins): 插件中心 - 修复协议分类筛选重复展示

Refs #428
This commit is contained in:
ddCat
2026-09-07 22:35:45 +08:00
parent bdfccf51d1
commit 8a70ab27c4
3 changed files with 19 additions and 2 deletions

View File

@@ -48,6 +48,11 @@ description: 当前项目已实现功能的手工验证清单与未确认边界
- [ ] 复验画布、创作、短剧真实路由中的模型切换、保存后重开、默认档位与比例组合、明暗主题和键盘交互;管理员真实保存由用户确认后执行。 - [ ] 复验画布、创作、短剧真实路由中的模型切换、保存后重开、默认档位与比例组合、明暗主题和键盘交互;管理员真实保存由用户确认后执行。
- [ ] 用真实模型确认新增尺寸是否受上游支持、实际输出与计费档位是否一致;本次未修改已保存模型配置或执行收费生成。 - [ ] 用真实模型确认新增尺寸是否受上游支持、实际输出与计费档位是否一致;本次未修改已保存模型配置或执行收费生成。
## Issue #428 插件协议分类
- 分类筛选同时限制展示分区,避免音视频协议在音频筛选结果中重复展示;全部分类仍展示各自支持的能力分区。
- [ ] 人工复验 AutoDL 在音频、视频和全部分类中的展示,以及搜索、状态筛选和详情入口。
## 画布多图分组与展开动画 ## 画布多图分组与展开动画
- 新生成的多图组默认收起;复制图片或替换节点生成多图时,结果也保留分组归属,可展开、收起和设置主图。 - 新生成的多图组默认收起;复制图片或替换节点生成多图时,结果也保留分组归属,可展开、收起和设置主图。

View File

@@ -159,8 +159,8 @@ export default function PluginsPage() {
() => [ () => [
...protocolSectionMeta.map((section) => ({ ...section, plugins: filteredPlugins.filter((plugin) => pluginMatchesCategory(plugin.manifest, section.key)) })), ...protocolSectionMeta.map((section) => ({ ...section, plugins: filteredPlugins.filter((plugin) => pluginMatchesCategory(plugin.manifest, section.key)) })),
{ key: "other", label: "应用插件", description: "画布、素材与工作流扩展", icon: PlugZap, plugins: filteredPlugins.filter((plugin) => pluginMatchesCategory(plugin.manifest, "other")) }, { key: "other", label: "应用插件", description: "画布、素材与工作流扩展", icon: PlugZap, plugins: filteredPlugins.filter((plugin) => pluginMatchesCategory(plugin.manifest, "other")) },
], ].filter((section) => categoryFilter === "all" || section.key === categoryFilter),
[filteredPlugins], [categoryFilter, filteredPlugins],
); );
const selectCategory = (key: string) => { const selectCategory = (key: string) => {

View File

@@ -0,0 +1,12 @@
import { readFileSync } from "node:fs";
import { describe, expect, test } from "bun:test";
const source = readFileSync(new URL("../src/pages/plugins/index.tsx", import.meta.url), "utf8");
describe("plugin category sections (#428)", () => {
test("limits rendered sections to the selected category, not just matching plugins", () => {
const sections = source.slice(source.indexOf("const pluginSections ="), source.indexOf("const selectCategory ="));
expect(sections).toContain('categoryFilter === "all" || section.key === categoryFilter');
expect(sections).toContain("[categoryFilter, filteredPlugins]");
});
});