Skip to content

feat(resource-list): paginate app, dataset, and skill lists - #7622

Open
FinleyGe wants to merge 34 commits into
labring:mainfrom
FinleyGe:perf/resource-pagination
Open

feat(resource-list): paginate app, dataset, and skill lists#7622
FinleyGe wants to merge 34 commits into
labring:mainfrom
FinleyGe:perf/resource-pagination

Conversation

@FinleyGe

@FinleyGe FinleyGe commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

变更说明

  • 保留 App、Dataset、Skill V1 列表接口及全量兼容 wrapper。
  • 新增 /core/app/listV2/core/dataset/listV2/core/ai/skill/listV2 分页接口。
  • Dashboard 的 App、Dataset、Skill 列表接入 V2 分页和虚拟网格。
  • Workflow App、MCP、快捷应用、收藏应用、Dataset 选择、Skill 选择接入分页和虚拟滚动。
  • Dataset 全选/取消全选支持跨分页候选集。
  • SelectOneResourceMoveModal 和 ChatHeader 保持旧数组树协议。
  • 删除无引用的 Dataset store。

兼容策略

V1 保持数组响应协议,getAllAppsgetAllDatasetsgetAllSkillList 继续使用 V1。V2 返回 { list, total },只用于分页场景。

验证

  • 资源列表 API 测试:10/10
  • pnpm --dir projects/app typecheck
  • 受影响文件 ESLint
  • Prettier
  • git diff --check

完整四包并发测试中出现非稳定失败;失败的 App copy 用例已单独复跑通过。

设计文档:.agents/design/core/resource-list-pagination-frontend.md

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown

Admin Preview Image Ready!

ghcr.io/labring/fastgpt-pr:admin_63c44476561ef67b52dc77b659931ab95c0dea12

🕒 Time: 2026-09-04 17:29:26 (UTC+8)

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown

Build and publish successful - Preview fastgpt Image:

ghcr.io/labring/fastgpt-pr:fastgpt_e62b10854b2030fda4fe726ba9290dc44bb766f6

🕒 Time: 2026-09-04 16:59:11 (UTC+8)

@FinleyGe
FinleyGe force-pushed the perf/resource-pagination branch from c52e47d to 460c4c4 Compare September 1, 2026 07:43
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 33.36% 3340 / 10010
🔵 Statements 33.26% 3526 / 10601
🔵 Functions 27.88% 667 / 2392
🔵 Branches 27.93% 1662 / 5949
File CoverageNo changed files found.
Generated in workflow #2973 for commit 63c4447 by the Vitest Coverage Report Action

@FinleyGe
FinleyGe force-pushed the perf/resource-pagination branch from 8c83dd7 to 8bef898 Compare September 2, 2026 03:46

@c121914yu c121914yu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

整体方向正确:V2 在 ACL 过滤后分页、保留 V1 数组协议,CI 也已全部通过。但当前还有几处建议合并前处理的问题:

  1. Tool、Skill、Dataset Dashboard 的滚动容器与分页监听不一致。 useScrollPagination 监听内层 ScrollData,但 dashboard/tool/index.tsx:95dashboard/skill/index.tsx:86dataset/list/index.tsx:106 仍由外层容器滚动,List 的 flex 父项也没有 minH={0}。实际滚动可能不会触发下一页,只能停留在首批数据。建议统一采用 Agent 页已有的 overflowY="hidden" + minH={0} 布局。

  2. App 配置的 Dataset 选择器仍然全量加载和全量渲染。 components/core/app/DatasetSelectModal.tsx:69-95 每次目录或搜索变化都调用 getAllDatasets,并在 :308 直接 map 全部数据。这与设计文档中普通展示使用 V2、仅全选操作读取完整候选集的方案不一致,也是本 PR 要解决的大数据量场景。建议列表展示继续走 useDatasetSelect,只在全选/取消全选动作中请求完整候选。

  3. 标注 Dataset 选择器取消了不可用向量模型保护。 SelectMarkCollection.tsx:71-87 现在所有非文件夹 Dataset 都可以点击,即使 vectorModel?.isActive !== true。旧实现会禁用并阻止选择,当前可能把用户带入无效 Dataset 的 Collection 请求,需要恢复该判断。

  4. App 列表读取了完整 workflow modules。 api/core/app/list.ts:132-138listV2.ts:103-110 将原来的 modules.flowNodeType 投影扩大成了完整 modules,但最终响应只是计算 hasInteractiveNode 后丢弃 modules。尤其 V1 仍是全量接口,这会让 MongoDB 向服务端传输整套工作流节点和 inputs,和本 PR 的性能目标相冲突。建议恢复窄投影,或用 aggregation 直接计算标记。

  5. resourcePermissionRepo.ts:202-245rolePerMap 入参被同名局部变量遮蔽,调用方传入值实际无效;新增测试因为 app 类型被硬编码到 AppRolePerMap 而无法发现这一点。建议使用入参,或删除入参并明确按资源类型内部推导。

  6. api/core/dataset/list.ts:145 删除了 GetDatasetListResponseSchema.parse。旧数据中的 nullish 字段会以违反 OpenAPI 类型的形式从 V1 返回。若目的是兼容旧数据,建议先像 V2 一样归一化,再保留响应契约校验。

现有测试尚未覆盖真实滚动容器、Dataset 跨页选择、不可用模型选择,以及 V2 非 owner 的成员/用户组/组织 ACL 与 total 一致性。建议补充这些关键路径后再合并。

@FinleyGe
FinleyGe force-pushed the perf/resource-pagination branch from eb3b607 to 8a49ea8 Compare September 4, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants