From 8a70ab27c4b06ef585dee9ffc19ed07c4ae6a11b Mon Sep 17 00:00:00 2001 From: ddCat <2695092045@qq.com> Date: Mon, 7 Sep 2026 22:35:45 +0800 Subject: [PATCH] =?UTF-8?q?fix(plugins):=20=E6=8F=92=E4=BB=B6=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=20-=20=E4=BF=AE=E5=A4=8D=E5=8D=8F=E8=AE=AE=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E7=AD=9B=E9=80=89=E9=87=8D=E5=A4=8D=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs #428 --- docs/content/docs/progress/pending-test.mdx | 5 +++++ web/src/pages/plugins/index.tsx | 4 ++-- web/test/plugin-category-sections.test.ts | 12 ++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 web/test/plugin-category-sections.test.ts diff --git a/docs/content/docs/progress/pending-test.mdx b/docs/content/docs/progress/pending-test.mdx index da44587b5..795d303a8 100644 --- a/docs/content/docs/progress/pending-test.mdx +++ b/docs/content/docs/progress/pending-test.mdx @@ -48,6 +48,11 @@ description: 当前项目已实现功能的手工验证清单与未确认边界 - [ ] 复验画布、创作、短剧真实路由中的模型切换、保存后重开、默认档位与比例组合、明暗主题和键盘交互;管理员真实保存由用户确认后执行。 - [ ] 用真实模型确认新增尺寸是否受上游支持、实际输出与计费档位是否一致;本次未修改已保存模型配置或执行收费生成。 +## Issue #428 插件协议分类 + +- 分类筛选同时限制展示分区,避免音视频协议在音频筛选结果中重复展示;全部分类仍展示各自支持的能力分区。 +- [ ] 人工复验 AutoDL 在音频、视频和全部分类中的展示,以及搜索、状态筛选和详情入口。 + ## 画布多图分组与展开动画 - 新生成的多图组默认收起;复制图片或替换节点生成多图时,结果也保留分组归属,可展开、收起和设置主图。 diff --git a/web/src/pages/plugins/index.tsx b/web/src/pages/plugins/index.tsx index 1e3deb591..428cb7c96 100644 --- a/web/src/pages/plugins/index.tsx +++ b/web/src/pages/plugins/index.tsx @@ -159,8 +159,8 @@ export default function PluginsPage() { () => [ ...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")) }, - ], - [filteredPlugins], + ].filter((section) => categoryFilter === "all" || section.key === categoryFilter), + [categoryFilter, filteredPlugins], ); const selectCategory = (key: string) => { diff --git a/web/test/plugin-category-sections.test.ts b/web/test/plugin-category-sections.test.ts new file mode 100644 index 000000000..8c02419e5 --- /dev/null +++ b/web/test/plugin-category-sections.test.ts @@ -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]"); + }); +});