Repository navigation
Conversation
This reverts commit 94c1b8a.
Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
There was a problem hiding this comment.
Pull request overview
Adds an in-modal task progress list to the Home toolbar “Offline Download” flow so users can see ongoing task status immediately after submitting tasks (addresses #410).
Changes:
- Extend the offline download modal to optionally show a periodically refreshed task list.
- Add a small tasks fetch/store module and a
TaskProgressUI component to render task state/progress. - Extend
ModalInputwithonSubmitWithValueto allow submit handlers to clear/reset the input value after success.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/pages/home/toolbar/OfflineDownload.tsx | Shows task list in the modal and polls backend for task updates |
| src/pages/home/offlinedownload/task.ts | Implements task fetching + merged list state (old/new endpoints) |
| src/pages/home/offlinedownload/TaskProgress.tsx | Renders individual task progress cards with parsed metadata/links |
| src/components/ModalInput.tsx | Adds onSubmitWithValue callback to expose setValue to submit handlers |
| src/lang/en/tasks.json | Adds i18n strings for the offline download task list UI |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
pikachuren
left a comment
There was a problem hiding this comment.
结论:需修改后再合并
离线下载任务进度列表面板:轮询用 isFetching 防并发叠加、关闭时 clearTimeout + onCleanup 清理、createEffect 依赖 showTasks() 使轮询随弹窗启停,生命周期处理正确;合并两个 endpoint 用 taskMap 去重并按 start_time 降序,思路合理。但有一处健壮性问题:
一、单端点失败导致整表不可见且无反馈(中等)
store/task.ts 用 Promise.all 同时请求 /task/offline_download/undone 和 /task/offline_download_transfer/undone,getTasksFromResp 对任一非 200 抛错,外层 catch 只 console.error。transfer 接口若异常(功能未启用/超时),整个任务列表静默失败,setTasks 不执行,用户看到陈旧/空列表且无提示。建议改为独立容错(各自 try/catch)或用 Promise.allSettled。
二、轮询失败被吞掉(中等)
轮询的 fetchOfflineDownloadTasks(false) 同样被 catch 吞掉,后端间歇性失败时任务列表一直显示旧数据,无 loading/error 状态,用户无法区分「正常无任务」与「拉取失败」。建议区分网络错误并显示占位提示。
三、提交成功后弹窗不再自动关闭(低,行为变更)
原 onSubmit 成功时 onClose(),新 handleSubmit 成功只清空输入框不关弹窗(为了看进度,属预期),需确认这是有意的 UX 变更。
合并建议:将 Promise.all 改为独立容错并对拉取失败给出用户可见提示,确认「提交后不关弹窗」为预期行为后合并。
Description / 描述
为工具栏的离线下载页面添加了任务列表,使得添加完离线下载任务后可以看到任务状态。
Motivation and Context / 背景
方便添加完离线下载任务后看到任务状态,不用打开后台。


Closes #410
How Has This Been Tested? / 测试
添加离线下载任务列表
Checklist / 检查清单
我已阅读 CONTRIBUTING 文档。
go fmtor prettier.我已使用
go fmt或 prettier 格式化提交的代码。我已为此 PR 添加了适当的标签(如无权限或需要的标签不存在,请在描述中说明,管理员将后续处理)。
我已在适当情况下使用"Request review"功能请求相关代码作者进行审查。
我已相应更新了相关仓库(若适用)。