feat(onedragon): 断点续跑 and 链式执行一条龙 - #3311
Conversation
- 新增断点续跑功能:支持禁用/每日刷新/每次启动刷新/永不刷新四种模式 - 完成后操作新增启动一条龙选项,支持选择目标配置链式执行 - 修复 ComboBox 默认值与下拉项不匹配导致显示空白的问题 - 修复 DataTrigger 因 WPF 属性优先级无法切换可见性的问题
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Walkthrough新增一条龙断点续跑配置和执行状态管理。完成后操作支持启动指定的一条龙配置。页面新增相关选择控件和说明。 Changes一条龙执行流程
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant OneDragonFlowPage
participant OneDragonFlowViewModel
participant OneDragonFlowConfig
participant TaskExecution
OneDragonFlowPage->>OneDragonFlowViewModel: 设置完成动作与续跑模式
OneDragonFlowViewModel->>OneDragonFlowConfig: 保存配置状态
TaskExecution->>OneDragonFlowViewModel: 执行任务并更新断点
OneDragonFlowViewModel->>OneDragonFlowConfig: 保存或清除断点
OneDragonFlowViewModel->>TaskExecution: 完成后启动目标一条龙
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
影响可能较大,准备经过测试后提交 |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@BetterGenshinImpact/ViewModel/Pages/OneDragonFlowViewModel.cs`:
- Around line 578-584: 将 AutoResumeMode
的判断更新为显式处理“每次启动刷新”,使执行前不再清理标记;保留其他模式行为不变。调整 OneDragonFlowViewModel
的一次性启动初始化流程,仅在应用会话首次初始化时执行该模式的清理,并通过会话级保护避免页面重新导航重复触发。
- Around line 794-809: Replace the recursive OnOneKeyExecute call in the
CompletionAction restart branch with an outer iterative flow that advances to
the next configuration. Track visited configurations or otherwise detect
self-references and cycles, and ensure each iteration completes and releases the
previous execution state before starting the next one.
- Around line 751-758: 在 OneDragonFlowViewModel
的任务执行流程中记录整体成功状态,并在配置组异常被捕获后将其标记为失败或直接结束流程。更新“全部任务成功完成”分支,仅当所有任务均成功时才清理
SelectedConfig.NextTaskId 和 AutoResumeTimestamp 并调用 SaveConfig;任务失败时保留断点标记。
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0c683ec8-b63e-4b12-af8a-0f51a4530836
📒 Files selected for processing (3)
BetterGenshinImpact/Core/Config/OneDragonFlowConfig.csBetterGenshinImpact/View/Pages/OneDragonFlowPage.xamlBetterGenshinImpact/ViewModel/Pages/OneDragonFlowViewModel.cs
| // 全部任务成功完成,清除断点续跑标记 | ||
| if (SelectedConfig.AutoResumeMode != "禁用断点续跑") | ||
| { | ||
| _logger.LogInformation("断点续跑:全部任务完成,清除标记"); | ||
| SelectedConfig.NextTaskId = string.Empty; | ||
| SelectedConfig.AutoResumeTimestamp = null; | ||
| SaveConfig(); | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
仅在所有任务确实成功后清除断点。
配置组异常会在 Line 711-736 被捕获并继续执行,因此到达这里并不代表全部任务成功;当前代码会删除失败任务的恢复标记。请记录整体成功状态,或在任务失败后直接返回,仅在成功状态下清理。
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@BetterGenshinImpact/ViewModel/Pages/OneDragonFlowViewModel.cs` around lines
751 - 758, 在 OneDragonFlowViewModel
的任务执行流程中记录整体成功状态,并在配置组异常被捕获后将其标记为失败或直接结束流程。更新“全部任务成功完成”分支,仅当所有任务均成功时才清理
SelectedConfig.NextTaskId 和 AutoResumeTimestamp 并调用 SaveConfig;任务失败时保留断点标记。
- 改用外层迭代循环替代递归,避免 async 状态机堆积 - HandleAutoResumeClear 区分手动/自动标记(无时间戳的标记跳过清理) - 每次启动刷新模式执行前不再清理标记 - InitConfigList 添加会话级保护 _isInitialized,避免页面重导航重复清理 - 任务完成标记清理移至检查之后、完成操作之前 - AutoResumeMode 默认值修正为禁用断点续跑 - CompletionAction 默认值修正为无
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@BetterGenshinImpact/ViewModel/Pages/OneDragonFlowViewModel.cs`:
- Around line 818-833: Update RenameConfig to migrate every other
configuration’s RestartOneDragonName that references the renamed configuration,
replacing the old name with the new name and persisting the changes. Ensure
subsequent targetName lookup in the completion flow continues resolving the
renamed configuration without changing unrelated references.
- Around line 648-661: 延后清空 OneDragonFlowViewModel 中的
SelectedConfig.NextTaskId:不要在恢复任务尚未成功启动时消费断点,尤其避免启动取消路径将其持久化为空值。仅在恢复任务确认执行成功,或被新的自动任务标记替换后清除旧断点;同步检查相关启动取消处理逻辑,确保同一会话重试仍从
NextTaskId 指定任务开始。
- Around line 348-352: 调整启动清理逻辑,使其仅在 AutoResumeTimestamp 有值时清除 NextTaskId
和自动恢复时间戳,保留没有时间戳的手动断点;同时修改手动设置断点的命令,在写入新的 NextTaskId 时主动将 AutoResumeTimestamp 设为
null,并继续通过 WriteConfig 保存配置。
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: fe4bcba1-53b1-495e-9e1f-4d02562dd607
📒 Files selected for processing (1)
BetterGenshinImpact/ViewModel/Pages/OneDragonFlowViewModel.cs
|
这个先不合并了 |
那先转draft了 |
新增断点续跑功能:支持禁用/每日刷新/每次启动刷新/永不刷新四种模式(期望,断点后,当日启动/不关bgi的情况下,会从断点开始跑,否则从头开始)
完成后操作新增启动一条龙选项,支持选择目标配置链式执行/自循环执行
调整相关配置项位置
Summary by CodeRabbit