Skip to content

feat(knowledge): select_all batch ops by filter (supersedes #2590) - #2685

Open
LiangYuHai wants to merge 3 commits into
Tencent:mainfrom
LiangYuHai:feat/batch-select-all-by-filter
Open

feat(knowledge): select_all batch ops by filter (supersedes #2590)#2685
LiangYuHai wants to merge 3 commits into
Tencent:mainfrom
LiangYuHai:feat/batch-select-all-by-filter

Conversation

@LiangYuHai

@LiangYuHai LiangYuHai commented Aug 13, 2026

Copy link
Copy Markdown

按在 #2590 的反馈,不再用前端翻页拉取全量 ID,改为批量请求携带 select_all + 列表筛选 filter + exclude_ids,由后端解析目标集合。

  • 批量删除 / 重建 / 移文件夹 / 打标签 / 停止解析 支持 select_all
  • 新增 POST /knowledge/batch-cancel-parse,批量栏增加「停止解析」(上游原先仅有单条 cancel)
  • 手动勾选(显式 ID)仍受 maxBatch=200 限制,前端继续按 200 分片
  • 全选后取消勾选个别文档通过 exclude_ids 排除;单行「移动到目录」不会误用全选语义
  • 筛选与当前目录结构对齐(folder_path / folder_recursive
    这是对 feat(frontend): select all documents across pages #2590(前端循环分页全选)的替代方案;显式多选的 200 分片逻辑与 fix(frontend): chunk batch delete/reparse to respect backend id limit #2588 互补。

Type of Change

  • 🐛 Bug fix
  • [√] ✨ New feature
  • 💥 Breaking change
  • 📚 Documentation update
  • 🎨 Refactor
  • ⚡ Performance improvement
  • [√] 🧪 Test
  • 🔧 Configuration / Build / CI

Related Issue

Supersedes #2590
Related #2588

Testing

  • 目录内全选后批量删除/重建/移动/打标签/停止解析,仅作用于当前目录范围
  • 全选后取消勾选若干行,确认被排除
  • 手动勾选 >200 条时,删除/重建仍按 200 分片成功
  • 全选状态下用单行菜单「移动到目录」,只移动当前这一条
  • 切换目录/筛选会清空选择
  • go test ./internal/handler/ -run 'TestResolveBatch|TestChunkString'
  • go test ./internal/application/repository/ -run 'TestListKnowledgeIDsByFilter'

Checklist

  • [√] git diff --check origin/main...HEAD passes
  • [√] Changed source files are formatted
  • [√] Targeted tests for the changed packages/components pass
  • Diff-scoped lint passes where applicable (for Go: golangci-lint run --new-from-rev=origin/main ./...)
  • Full-repository checks were run, or any unrelated/environment-dependent failures are documented above
  • [√] Self-reviewed the code
  • [√] Added/updated tests covering the change
  • Updated related documentation (README, docs/, Swagger annotations, etc.)
  • [√] Breaking changes are clearly called out in the description above

Allow batch delete/reparse/move/tag/cancel-parse to accept select_all with
list filters and exclude_ids so the server resolves the ID set instead of
requiring the client to page through all matches. Explicit ID mode keeps
the existing 200-per-request limit.
Replace cross-page ID pagination with an all_matching selection mode that
snapshots list filters and sends select_all to the backend. Explicit multi-
select still chunks by 200. Add batch-bar stop-parse wired to the new
batch-cancel-parse API, and keep per-row move/delete scoped to one item.
CI Check formatting failed on field alignment and comment indent.
@LiangYuHai
LiangYuHai force-pushed the feat/batch-select-all-by-filter branch from 35ccdb4 to ad7e08e Compare August 14, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant