Skip to content

新增“开关自动化”行动#81

Open
ywydog wants to merge 25 commits into
Programmer-MrWang:mainfrom
ywydog:main
Open

新增“开关自动化”行动#81
ywydog wants to merge 25 commits into
Programmer-MrWang:mainfrom
ywydog:main

Conversation

@ywydog
Copy link
Copy Markdown

@ywydog ywydog commented May 28, 2026

增加开关自动化的行动,以增加可玩性

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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];
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Honor the revert opt-out

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 👍 / 👎.

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.

1 participant