tasks: support custom recurrence intervals (every N days/weeks, monthly) #57

Open
opened 2026-05-17 19:44:18 +00:00 by padreug · 0 comments
Owner

Problem

tasks module currently only supports two recurrence patterns:

  • daily
  • weekly (with a fixed weekday)

Real chore lists need richer cadences. From the paca/duck/puppy chore brief:

  • "every ~3 days scoop manure"
  • "every 2 wks to 1 month — change out whole bedding"
  • "every 1 to 2 days clean water and food containers"

There's no way to express "every N days" or "every N weeks" or "monthly" today, so users have to either log it manually each time or pick the closest fixed cadence.

Scope

Extend the recurrence model and its publish/sync paths to support:

  • every-n-days with n: integer (e.g. every 3 days)
  • every-n-weeks with n: integer and day_of_week: string (e.g. every 2 weeks on Monday)
  • monthly with day_of_month: 1..31 | "last"
  • Keep daily and weekly working as shorthands for every-n-days{n=1} and every-n-weeks{n=1} (or just translate them at the boundary — TBD by client preference)

Webapp surface (src/modules/tasks)

  • RecurrencePattern interface in TaskService.ts (currently { frequency: 'daily' | 'weekly', dayOfWeek?, endDate? }) extends with interval: number and dayOfMonth?: number | "last".
  • doesRecurringEventOccurOnDate in TaskService.ts learns the new patterns.
  • Whatever creates 31922 task events (see #56 — currently no publish path) emits the new tag conventions.

Lnbits side (aiolabs/tasks)

  • Mirror the model change in models.Recurrence and the publisher's ["recurrence", ...] tag emission.
  • See aiolabs/tasks#2 for the server-side change.

Tag convention (proposed)

Stay close to iCalendar-ish RRULE semantics without inventing too much:

  • ["recurrence", "every-n-days"] + ["recurrence-interval", "<n>"]
  • ["recurrence", "every-n-weeks"] + ["recurrence-interval", "<n>"] + ["recurrence-day", "<weekday>"]
  • ["recurrence", "monthly"] + ["recurrence-day-of-month", "<1..31|last>"]
  • ["recurrence-end", "<YYYY-MM-DD>"] stays as-is.

Open question: do we just lift RRULE itself instead and accept a single ["rrule", "FREQ=WEEKLY;INTERVAL=2;BYDAY=MO"] tag? Cleaner long-term, more parsing work short-term.

  • aiolabs/tasks#2 — server-side mirror of this change.
  • #56 — webapp doesn't publish 31922 yet; whenever that lands, it must emit the new recurrence tags AND ["event-type", "task"].
  • #55 — cross-cutting teams concept (teams + recurrence often interact: e.g. "weekly on Monday for the animal-chores team").

Labelling note

There's no app:tasks label on this repo yet (only app:activities, app:chat, app:marketplace, app:wallet, app:webapp). Filing with app:webapp + enhancement for now. Worth creating app:tasks so this module's issues are discoverable like the other standalones.

## Problem `tasks` module currently only supports two recurrence patterns: - `daily` - `weekly` (with a fixed weekday) Real chore lists need richer cadences. From the paca/duck/puppy chore brief: - "every ~3 days scoop manure" - "every 2 wks to 1 month — change out whole bedding" - "every 1 to 2 days clean water and food containers" There's no way to express "every N days" or "every N weeks" or "monthly" today, so users have to either log it manually each time or pick the closest fixed cadence. ## Scope Extend the recurrence model and its publish/sync paths to support: - `every-n-days` with `n: integer` (e.g. every 3 days) - `every-n-weeks` with `n: integer` and `day_of_week: string` (e.g. every 2 weeks on Monday) - `monthly` with `day_of_month: 1..31 | "last"` - Keep `daily` and `weekly` working as shorthands for `every-n-days{n=1}` and `every-n-weeks{n=1}` (or just translate them at the boundary — TBD by client preference) ### Webapp surface (`src/modules/tasks`) - `RecurrencePattern` interface in `TaskService.ts` (currently `{ frequency: 'daily' | 'weekly', dayOfWeek?, endDate? }`) extends with `interval: number` and `dayOfMonth?: number | "last"`. - `doesRecurringEventOccurOnDate` in `TaskService.ts` learns the new patterns. - Whatever creates 31922 task events (see #56 — currently no publish path) emits the new tag conventions. ### Lnbits side (aiolabs/tasks) - Mirror the model change in `models.Recurrence` and the publisher's `["recurrence", ...]` tag emission. - See [aiolabs/tasks#2](https://git.atitlan.io/aiolabs/tasks/issues/2) for the server-side change. ## Tag convention (proposed) Stay close to iCalendar-ish RRULE semantics without inventing too much: - `["recurrence", "every-n-days"]` + `["recurrence-interval", "<n>"]` - `["recurrence", "every-n-weeks"]` + `["recurrence-interval", "<n>"]` + `["recurrence-day", "<weekday>"]` - `["recurrence", "monthly"]` + `["recurrence-day-of-month", "<1..31|last>"]` - `["recurrence-end", "<YYYY-MM-DD>"]` stays as-is. Open question: do we just lift RRULE itself instead and accept a single `["rrule", "FREQ=WEEKLY;INTERVAL=2;BYDAY=MO"]` tag? Cleaner long-term, more parsing work short-term. ## Related - aiolabs/tasks#2 — server-side mirror of this change. - #56 — webapp doesn't publish 31922 yet; whenever that lands, it must emit the new recurrence tags AND `["event-type", "task"]`. - #55 — cross-cutting teams concept (teams + recurrence often interact: e.g. "weekly on Monday for the animal-chores team"). ## Labelling note There's no `app:tasks` label on this repo yet (only `app:activities`, `app:chat`, `app:marketplace`, `app:wallet`, `app:webapp`). Filing with `app:webapp` + `enhancement` for now. Worth creating `app:tasks` so this module's issues are discoverable like the other standalones.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aiolabs/webapp#57
No description provided.