feat: 支持从此处运行、单独运行与单次运行任务#229
Open
overflow65537 wants to merge 1 commit into
Open
Conversation
新增任务右键菜单与三态复选框,允许从指定任务启动、仅运行单个任务,以及通过右键设置单次运行标记;左键复选框仅在启用与禁用间切换。 Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
There was a problem hiding this comment.
Hey - 我在这里给了一些高层面的反馈:
- 在
toggleTaskEnabled中,当某个任务runOnce=true时,你目前会把它重置为enabled:false/runOnce:false。这意味着对一个“只运行一次”的任务左键单击时,并不会真正把它切换到启用状态;可以考虑在清除runOnce时将enabled设置为true,这样复选框就会像描述中的那样,充当一个简单的启用/禁用切换。 - 条件
isInstanceRunning || isIncompatible在多个处理函数中被重复使用(复选框点击/上下文菜单、run-from-here/run-single、上下文菜单项);可以考虑抽取一个小的辅助函数或布尔变量来集中这段逻辑,从而降低未来出现不一致行为的风险。 TaskList使用t.enabled || t.runOnce来计算hasEnabledTasks,而Toolbar使用isTaskSelectedForRun;为了避免之后出现行为偏差,你可以在TaskList中也复用isTaskSelectedForRun,这样运行选择的语义就可以集中在一个地方。
给 AI 代理的提示
Please address the comments from this code review:
## Overall Comments
- In toggleTaskEnabled, when a task has runOnce=true you currently reset it to enabled:false/runOnce:false, which means a left-click on a ‘run once’ task does not actually toggle it to enabled; consider setting enabled to true when clearing runOnce so the checkbox behaves as a simple enabled/disabled toggle as described.
- The condition `isInstanceRunning || isIncompatible` is duplicated in several handlers (checkbox click/context menu, run-from-here/run-single, context menu items); consider extracting a small helper or boolean to centralize this logic and reduce the risk of future inconsistencies.
- TaskList uses `t.enabled || t.runOnce` to compute `hasEnabledTasks` while Toolbar uses `isTaskSelectedForRun`; to avoid divergence over time you could reuse `isTaskSelectedForRun` in TaskList as well, keeping the run-selection semantics in one place.帮我变得更有用!请在每条评论上点击 👍 或 👎,我会利用这些反馈来改进你的代码审查体验。
Original comment in English
Hey - I've left some high level feedback:
- In toggleTaskEnabled, when a task has runOnce=true you currently reset it to enabled:false/runOnce:false, which means a left-click on a ‘run once’ task does not actually toggle it to enabled; consider setting enabled to true when clearing runOnce so the checkbox behaves as a simple enabled/disabled toggle as described.
- The condition
isInstanceRunning || isIncompatibleis duplicated in several handlers (checkbox click/context menu, run-from-here/run-single, context menu items); consider extracting a small helper or boolean to centralize this logic and reduce the risk of future inconsistencies. - TaskList uses
t.enabled || t.runOnceto computehasEnabledTaskswhile Toolbar usesisTaskSelectedForRun; to avoid divergence over time you could reuseisTaskSelectedForRunin TaskList as well, keeping the run-selection semantics in one place.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In toggleTaskEnabled, when a task has runOnce=true you currently reset it to enabled:false/runOnce:false, which means a left-click on a ‘run once’ task does not actually toggle it to enabled; consider setting enabled to true when clearing runOnce so the checkbox behaves as a simple enabled/disabled toggle as described.
- The condition `isInstanceRunning || isIncompatible` is duplicated in several handlers (checkbox click/context menu, run-from-here/run-single, context menu items); consider extracting a small helper or boolean to centralize this logic and reduce the risk of future inconsistencies.
- TaskList uses `t.enabled || t.runOnce` to compute `hasEnabledTasks` while Toolbar uses `isTaskSelectedForRun`; to avoid divergence over time you could reuse `isTaskSelectedForRun` in TaskList as well, keeping the run-selection semantics in one place.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
新增任务右键菜单与三态复选框,允许从指定任务启动、仅运行单个任务,以及通过右键设置单次运行标记;左键复选框仅在启用与禁用间切换。
Summary by Sourcery
添加三态任务选择(tri-state)与“仅运行一次”语义以及新的运行模式,以改进任务执行控制。
新特性:
增强:
Original summary in English
Summary by Sourcery
Add tri-state task selection with run-once semantics and new run modes to improve task execution control.
New Features:
Enhancements: