feat: 定期タスクの自動作成機能 (T-0110) - #97
Merged
Merged
Conversation
Recurring work had to be typed onto the board by hand. Settings > Recurring now holds rules — a task template plus a daily/weekly/monthly schedule — that the app stamps out when they come due. The schedule is local wall-clock time, so evaluation lives in the frontend (src/lib/recurring.ts) rather than beside the vault-tidy scheduler in Rust, which has no time zone. The backend only persists the rules. Two invariants keep duplicates out: only the latest missed occurrence is ever created (a week offline yields one task, not seven), and an occurrence is consumed by recording it in last_generated whether the task was created or skipped. skip_if_open suppresses a new task while an earlier one from the same rule is still open; generated tasks are identified by a recurring/<rule-id> tag, so the Task frontmatter schema is unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. 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:
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 |
The rules are task content — titles, bodies, assignees — not an app preference, and the settings dialog was the wrong home for them: it made the tab bar a five-way split, gave the rule editor a narrow scroll area, and forced "Reset to defaults" to special-case them so a reset of the command templates would not delete a user's rules. A Recurring button on the Tasks toolbar (with the active-rule count) now opens a dedicated dialog that owns its own load/save round trip, writing only settings.recurring back so a concurrent settings save is left intact. Run now saves before generating, which removes the old draft-vs-disk trap where a run silently used the rules from before the edits on screen. Storage and the generation logic are unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.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.
概要
指定したスケジュールでタスクを自動作成する「定期タスク」機能を追加した(T-0110)。
Tasks タブ → Recurring ボタンでルール(タスクの雛形 + スケジュール)を登録すると、
発生時刻を過ぎた時点でアプリがタスクを生成する。
仕様
短い月は月末クランプ)+ 時刻(
HH:MM)を反映。
dueは発生日 + due offset(未設定なら空)PC を起動しても当日分が生成される
生成をスキップ(スロットは消化するので後で溜まらない)
recurring/<rule-id>タグを持つ。これがアプリ自身のタスク識別手段で、Task の frontmatter スキーマは変更していない
設計判断
src/lib/recurring.ts)に置いた。Rust 側にタイムゾーン情報がなく(
tasks.rs::today()は UTC 計算)、どちらの設計でもアプリ起動中しか発火しないため。バックエンドはルールの永続化のみ担当。
~/.workhub/config.json(settings.recurring)。vault の Markdown 化はパーサ新設が必要な上、発火状態が config 側に残り真実が二重化するため見送り。
中身(コンテンツ)であり、生成されたタスクを見る場所と同じ画面にある方が自然なため。
ダイアログが自前で config の読み書きを持ち、
settings.recurringのみ差し替える。検証
cargo fmt --check/cargo clippy -- -D warnings/cargo test --release(191 passed)npm run test(143 passed、うちrecurring.test.ts19 件は新規)/npm run buildバージョンを 0.67.0 に更新し、CHANGELOG と Help タブ(Recurring tasks の節)を追記した。
🤖 Generated with Claude Code