Skip to content

feat: 定期タスクの自動作成機能 (T-0110) - #97

Merged
atman-33 merged 2 commits into
mainfrom
feature/T-0110-recurring-tasks
Jul 31, 2026
Merged

feat: 定期タスクの自動作成機能 (T-0110)#97
atman-33 merged 2 commits into
mainfrom
feature/T-0110-recurring-tasks

Conversation

@atman-33

@atman-33 atman-33 commented Jul 30, 2026

Copy link
Copy Markdown
Owner

概要

指定したスケジュールでタスクを自動作成する「定期タスク」機能を追加した(T-0110)。
Tasks タブ → Recurring ボタンでルール(タスクの雛形 + スケジュール)を登録すると、
発生時刻を過ぎた時点でアプリがタスクを生成する。

仕様

  • スケジュール種別: daily(開始日から N 日毎)/ weekly(曜日選択)/ monthly(日指定・
    短い月は月末クランプ)+ 時刻(HH:MM
  • 生成タスクにはルールの title / status / assignee / project / priority / model / body
    を反映。due は発生日 + due offset(未設定なら空)
  • 判定はローカル壁時計。起動時と 5 分毎に評価するため、9:00 のルールに対し 10:00 に
    PC を起動しても当日分が生成される
  • 取りこぼしは直近 1 回分のみ生成(1 週間閉じていても 7 件にならない)
  • Skip while the last one is still open: 同じルールの未完了タスクが残っている間は
    生成をスキップ(スロットは消化するので後で溜まらない)
  • 生成タスクは recurring/<rule-id> タグを持つ。これがアプリ自身のタスク識別手段で、
    Task の frontmatter スキーマは変更していない
  • Run now: ルールを保存してから、発生済みのものを即時生成

設計判断

  • 暦計算はフロントエンド(src/lib/recurring.ts)に置いた。Rust 側にタイムゾーン情報が
    なく(tasks.rs::today() は UTC 計算)、どちらの設計でもアプリ起動中しか発火しないため。
    バックエンドはルールの永続化のみ担当。
  • ルール定義は ~/.workhub/config.jsonsettings.recurring)。vault の Markdown 化は
    パーサ新設が必要な上、発火状態が config 側に残り真実が二重化するため見送り。
  • cron 式は採用せず、daily / weekly / monthly に限定。
  • UI は Settings ではなく Tasks 配下に置いた。ルールはアプリの設定値ではなくタスクの
    中身(コンテンツ)であり、生成されたタスクを見る場所と同じ画面にある方が自然なため。
    ダイアログが自前で config の読み書きを持ち、settings.recurring のみ差し替える。

検証

  • cargo fmt --check / cargo clippy -- -D warnings / cargo test --release(191 passed)
  • npm run test(143 passed、うち recurring.test.ts 19 件は新規)/ npm run build
  • 未実施: 実機 UI の手動確認

バージョンを 0.67.0 に更新し、CHANGELOG と Help タブ(Recurring tasks の節)を追記した。

🤖 Generated with Claude Code

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>
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a1e3e71e-a0ff-4911-b37a-2c933a901f3f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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>
@atman-33
atman-33 merged commit 56f4b77 into main Jul 31, 2026
2 checks passed
@atman-33
atman-33 deleted the feature/T-0110-recurring-tasks branch July 31, 2026 00:31
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