Skip to content

feat(tasks): add copy queue controls and task visibility - #629

Open
fryeggs wants to merge 2 commits into
OpenListTeam:mainfrom
fryeggs:codex/fryeggs-task-controls
Open

feat(tasks): add copy queue controls and task visibility#629
fryeggs wants to merge 2 commits into
OpenListTeam:mainfrom
fryeggs:codex/fryeggs-task-controls

Conversation

@fryeggs

@fryeggs fryeggs commented Aug 11, 2026

Copy link
Copy Markdown

Summary / 摘要

This PR improves the task page for large copy queues and adds an administrator-only pause/resume control for queued copy work. Running and waiting counts are visible, running tasks can be isolated, unfinished tasks refresh frequently, completed tasks refresh and sort by completion time, and non-English locales fall back to English for newly added keys.

本 PR 面向大型复制队列改进任务页面,并为管理员增加排队复制任务的暂停/恢复控制。页面显示运行中/等待中数量,可只查看运行任务;未完成任务高频刷新,已完成任务按完成时间刷新和排序;非英语语言缺少新键时自动回退到英语。

登录页的主操作现在位于左侧:登录 使用主按钮样式,清除 位于右侧并使用次要样式,降低误操作风险。

  • This PR has breaking changes.
  • This PR changes public API, config, storage format, or migration behavior.
  • This PR requires corresponding changes in related repositories. The backend persistence companion PR is linked below.

Related repository PRs / 关联仓库 PR:

Testing / 测试

  • pnpm exec prettier --check src/app/i18n.ts src/lang/en/tasks.json src/pages/manage/tasks/Copy.tsx src/pages/manage/tasks/Task.tsx src/pages/manage/tasks/Tasks.tsx
  • pnpm build
  • Login action order and button emphasis were verified in src/pages/login/index.tsx.
  • The built production asset contains the copy queue control and was checked in the deployed OpenList runtime.
  • Manual browser test in this clean upstream worktree: not run because the live deployment was intentionally kept paused at zero workers during validation.

Checklist / 检查清单

  • I have read CONTRIBUTING.
  • I confirm this contribution follows the repository license, contribution policy, and code of conduct.
  • I have formatted the changed code with prettier.
  • I have requested review from relevant maintainers or code owners where applicable.

AI Disclosure / AI 使用声明

  • This PR includes AI-assisted content.

Tools used / 使用工具:

  • Codex

Usage scope / 使用范围:

  • Code generation / 代码生成

  • Refactoring / 重构

  • Tests / 测试

  • Translation / 翻译 fallback keys

  • Review assistance / 审查辅助

  • I have reviewed and validated all AI-assisted content included in this PR.

  • I have ensured that this AI-assisted commit includes Co-Authored-By attribution.

  • I can reproduce the checked behavior from the committed source and test commands without relying on hidden runtime state.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
Co-Authored-By: OpenAI Codex <noreply@openai.com>

@pikachuren pikachuren 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.

🙏 感谢 @fryeggs 提交!
🤖 AI 自动审核声明:本评审报告由 AI 自动生成,当前使用 DeepSeek-V4-Pro 模型进行分析。
⚠️ AI 分析结果仅供参考,可能存在误判或遗漏。如您发现任何问题或有不同意见,欢迎随时提出讨论和纠正。
⚠️ 重要提醒:即使 AI 评审认为代码质量良好且建议合并,最终是否合并仍需由项目维护者进行人工判定。项目维护者会综合考虑代码质量、项目规划、技术方向、团队资源等多方面因素做出是否合并的决策。

📖 概要:feat(tasks): add copy queue controls and task visibility · 关联后端 OpenList#2914 · 为大型复制队列增加管理员暂停/恢复控制与任务可见性改进
核心改动:新增 CopyQueueControl(管理员暂停/恢复排队复制)、运行/等待计数与"只看运行中"过滤、done 任务按完成时间排序并 10s 自动刷新、登录页主按钮左移、非英语缺键回退英语。

📋 评分:功能 ⭐⭐⭐⭐ | 最小改动 ⭐⭐⭐ | 前向兼容 ⭐⭐⭐⭐ | 方案 ⭐⭐⭐

关键问题(按重要性):

  • ⚠️ Tasks.tsx:58 新增 const TaskState 重复硬编码状态值,但 Task.tsx 已有 enum TaskStateEnum(0-9)且未导出 → 建议导出并复用,避免两处魔法数字漂移
  • 💡 Copy.tsx:69 refresh() 在组件函数体内直接调用副作用 → 建议改用 onMount(refresh),避免未来 StrictMode/HMR 下重复请求
  • 💡 Copy.tsx worker 上限 <= 32 硬编码,与后端 copy_task_threads_num 约束耦合 → 建议确认后端上限一致,或抽常量注明来源
  • 💡 Copy.tsx toggleQueue 按钮仅设 loading 未设 disabled,快速连点可能并发提交 → 建议补 disabled={saveSettingLoading()}

📂 文件分析(仅问题文件):

  • Tasks.tsx⚠️ L58 状态枚举重复定义 → 复用 TaskStateEnum;✅ props.done === "done" 修复 truthy bug 正确
  • Copy.tsx⚠️ 组件体直接调用 refresh();💡 worker 上限硬编码、toggle 缺并发保护
  • Task.tsx:✅ 明确区分 done/undone 分支,修复逻辑正确

🎯 结论:🔄 Request Changes — 建议复用现有 TaskStateEnum 消除状态值重复定义后再合并,其余为可选优化

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.

2 participants