feat(scheduledTask): 新增自定义 Cron 调度类型及表单 UX 优化#1519
Closed
swuzjb wants to merge 3 commits into
Closed
Conversation
…ude multi-agent support - Add custom Cron schedule type with visual builder and raw expression modes - Add cron quick-pick examples (every day, weekdays, hourly, every 15 min) - Add live cron expression preview with human-readable description - Add optional timezone field for cron schedules - Show next run relative time in task list (e.g. 'in 5 min') - Add prompt template quick-picks when prompt field is empty - Add character counter for prompt field - Improve form layout: scrollable body with fixed footer - Navigate to task detail after creating a new task - Fix double hover: CSS selector in tab buttons - Fix content area flex layout for create/edit views - Add all required i18n keys for zh and en
Merge origin/main into feat/scheduled-task-cron, resolving conflicts in: - ScheduledTasksView.tsx: combine cron navigation logic with onDirtyChange - TaskForm.tsx: keep cron features (CronBuilder, WEEKDAY_KEYS, previewCron) and integrate onDirtyChange; remove redundant inline toOpenClawModelRef - i18n.ts: retain plan translation keys and add unsaved-changes i18n entries from main
Merge origin/main into feat/scheduled-task-cron, resolving 13 conflict regions across 4 files: - TaskForm.tsx: adopt main's filterAccountId param, channelOptions dep, dirty-state tracking, and conversationOptionMatchesValue matcher - TaskList.tsx: keep formatNextRunRelative import from feature branch - i18n.ts: keep cron i18n keys from feature branch, adopt main's embedding provider, sqlite backup, and email channel keys - scheduledTask.ts: adopt main's filterAccountId parameter
Collaborator
btc69m979y-dotcom
added a commit
that referenced
this pull request
May 8, 2026
…dule feat(scheduledTask): add cron schedule type and UX improvements from #1519
pull Bot
pushed a commit
to soitun/LobsterAI
that referenced
this pull request
May 9, 2026
…etease-youdao#1519 Co-Authored-By: swuzjb <412008196@QQ.com>
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.
背景
本 PR 源自
feat/scheduled-task-cron-and-agent分支,提取其中的 Cron 调度 与 表单 UX 优化 部分,移除多 Agent 支持相关变更,形成独立可合并的功能分支。本次修改内容
1. 新增自定义 Cron 调度类型
在定时任务的调度方式下拉框中新增「自定义(Cron)」选项,支持通过标准 5 段 Cron 表达式(
分 时 日 月 周)配置任意复杂的执行周期。可视化构建器(Builder 模式)
*/5、*/15)作为选项原始表达式模式(Raw 模式)
格式:分 时 日 月 周,共 5 段)实时预览
快捷预设
时区字段(可选)
Asia/Shanghai),留空则使用系统默认时区高级调度兼容
2. 任务列表:展示下次执行相对时间
在任务列表的调度列下方,对已启用且有下次执行时间的任务,以灰色小字显示相对时间(如「5 分钟后」/「2 小时后」/「3 天后」),方便快速感知。
formatNextRunRelative()工具函数(utils.ts),支持中英文自适应nextRunAtMs有值时展示3. 表单 UX 优化
Prompt 区域
N 字符 / N characters)表单布局
overflow-y-auto),底部操作按钮固定在视图底部,解决长表单内容被截断的问题ScheduledTasksView中创建/编辑视图的容器布局,改为flex flex-col overflow-hidden以正确撑满高度样式统一
dark:border-claude-darkBorder体系迁移到设计 token(border-border、bg-surface、text-foreground等)w-9 h-9调整为w-8 h-8,激活色从bg-claude-text改为bg-primary创建后自动跳转
onSaved回调签名更新为(newTaskId?: string) => void,scheduledTaskService.createTask()返回类型改为Promise<string | null>Tab 按钮 CSS 修复
hover:hover:text-foreground重复hover:的冗余写法4. 类型系统更新(
utils.ts)PlanType联合类型新增'cron'值PlanInfo接口新增cronExpr?: string和cronTz?: string可选字段scheduleToPlanInfo()对复杂 Cron 表达式(不匹配内置快捷模式的)返回planType: 'cron'并携带原始表达式,而非回退为'advanced'5. 国际化(i18n)
同时为中文(
zh)和英文(en)新增以下翻译键:scheduledTasksFormScheduleModeCronCustomscheduledTasksFormCronModeBuilderscheduledTasksFormCronModeRawscheduledTasksFormCronField_minute/hour/dom/month/dowscheduledTasksFormCronInputHintscheduledTasksFormCronPreviewscheduledTasksFormCronPreviewInvalidscheduledTasksFormCronQuickTitlescheduledTasksFormCronQuick*scheduledTasksFormCronTimezonescheduledTasksFormAdvancedEditAsCronscheduledTasksFormPromptTemplate*scheduledTasksFormPayloadTextAgentHintscheduledTasksFormCharCount与原分支的差异
相较于
feat/scheduled-task-cron-and-agent,本 PR 移除了以下多 Agent 相关变更:TaskForm中的 Agent 选择下拉框(renderAgentRow()、agentId表单字段)TaskList中的 Agent 列(useAgentNameHook、额外表格列)TaskDetail中的 Agent 名称展示openclawChannelSessionSync.ts中根据 session key 提取 agentId 的逻辑scheduledTasksFormAgent、scheduledTasksFormAgentDefault、scheduledTasksDetailAgent)测试建议