feat(desktop): 云端项目行展开时按需拉取任务 - #969
Merged
Merged
Conversation
侧栏云端项目组要么一排「暂无任务」,要么(上一版收成单行后)点不开——两者 同源:项目列表接口每项只捎带 ≤3 条**运行中**的任务(后端按 pending/processing 过滤,见 backend/biz/project/repo/project.go),历史任务一条不带。绝大多数项目 此刻没在跑任务,到侧栏就是空数组,而"空"并不等于这个项目没有任务。 - 有在跑任务的项目:仍默认展开,收起态照旧记 mc.collapsedGroups。 - 没有在跑任务的项目:默认收起(不再摊一排占位),点开才展;展开态单独记在 组件内,不持久化——否则每次启动都要替它们各拉一次任务。 - 展开即按 project_id 拉最近 20 条(不限状态),拉到就以它为准:项目下从此 能看到历史任务,这是以前侧栏看不到的。mc_tasks 的 IPC 早就带 project_id, 壳侧未改。缓存按项目 id 存在 App,去重且不重发;整体同步时清空,仍展开的 项目由侧栏的按需拉取补回。 - 拉取中「加载中…」、失败「任务加载失败:…」,确认为空才「暂无任务」。 悬停提示随之三态:展开查看任务 / N 个进行中 / N 个任务。 搜索期间全部临时展开,那时不触发拉取——一次搜索不该顺带打一串请求。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
侧栏云端项目组要么一排「暂无任务」,要么(上一版收成单行后)点不开——两者
同源:项目列表接口每项只捎带 ≤3 条运行中的任务(后端按 pending/processing 过滤,见 backend/biz/project/repo/project.go),历史任务一条不带。绝大多数项目 此刻没在跑任务,到侧栏就是空数组,而"空"并不等于这个项目没有任务。
搜索期间全部临时展开,那时不触发拉取——一次搜索不该顺带打一串请求。