新增“开关自动化”行动#81
Conversation
Generate a release note with MD5 checksums for files.
可以选择当前方案的自动化,判断当前状态,可以启用,关闭 支持根据当前状态进行切换
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3423c55762
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // 1. 尝试通过索引查找 | ||
| if (Settings.TargetWorkflowIndex >= 0 && Settings.TargetWorkflowIndex < automationService.Workflows.Count) | ||
| { | ||
| targetWorkflow = automationService.Workflows[Settings.TargetWorkflowIndex]; |
There was a problem hiding this comment.
Validate saved index before using it
When the workflow list has been reordered or a new workflow is inserted before the saved target, this path accepts any in-range TargetWorkflowIndex and never checks it against TargetWorkflowName, so the action can toggle a different automation than the one the user selected. Falling back to the saved name when the indexed workflow's name does not match would avoid silently changing the wrong workflow.
Useful? React with 👍 / 👎.
| var actionSet = targetWorkflow.ActionSet; | ||
| var currentStatus = actionSet.IsEnabled; | ||
|
|
||
| if (IsRevertable) |
There was a problem hiding this comment.
If the user clears “触发器恢复时自动还原原状态”, Settings.RevertToOriginal is still ignored here: any revertable trigger records a snapshot and OnRevert will restore it anyway. In revertable trigger scenarios this makes the new checkbox ineffective and prevents users from keeping the toggled workflow state after the trigger ends.
Useful? React with 👍 / 👎.
增加开关自动化的行动,以增加可玩性