Skip to content

Add repeat_every (fixed-schedule) mode with guided multi-step flow alongside existing repeat_after (completion-coupled) mode#33

Draft
Copilot wants to merge 7 commits intomainfrom
copilot/feature-repeat-every-vs-after
Draft

Add repeat_every (fixed-schedule) mode with guided multi-step flow alongside existing repeat_after (completion-coupled) mode#33
Copilot wants to merge 7 commits intomainfrom
copilot/feature-repeat-every-vs-after

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 12, 2026

  • Answer RestoreSensorEntity question (answered inline — use Store in coordinator)
  • Move all schedule config fields (repeat_mode, repeat_every_type, repeat_weekday, repeat_weeks_interval, repeat_month_day, repeat_nth_occurrence) into TaskTrackerCoordinator.__init__
  • Move all calculation methods (calculate_due_date, _calculate_repeat_every_due_date, _weekday_number, _calc_next_weekday, _calc_next_day_of_month, _get_nth_weekday_of_month, _calc_next_weekday_of_month) from sensor.py to coordinator.py
  • Update coordinator.async_mark_as_done to call self._calculate_repeat_every_due_date() instead of reading self.due_date; remove self.due_date field
  • Update sensor.py: remove calculation methods, remove repeat_* constructor params, read schedule attrs from coordinator, call coordinator.calculate_due_date()
  • Update __init__.py to pass schedule options to coordinator constructor
  • Update unit tests: fix make_sensor, remove two stale tests about coordinator.due_date, redirect calculation-method tests to sensor.coordinator, use instance calls for static methods

Copilot AI linked an issue Apr 12, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add feature for repeat every vs repeat after functionality Add repeat_every (fixed-schedule) mode alongside existing repeat_after (completion-coupled) mode Apr 12, 2026
Copilot AI requested a review from gensyn April 12, 2026 17:24
@gensyn
Copy link
Copy Markdown
Owner

gensyn commented Apr 12, 2026

@copilot While this solution probably works, this is a very minimalistic approach and not very user friendly. I would prefer a solution that supports the following for repeat_every:

  • repeat every nth [monday ... sunday]
  • repeat on every nth day of the month
  • repeat every nth [monday ... sunday] of the month

With this functionality, repeat_after and repeat_every would need fundamentally different options and could not be entered into the existing config_flow. Is there a way to first ask what kind of functionality is needed and then present different options based on the selection?

Copilot AI and others added 2 commits April 12, 2026 20:21
- 3 repeat_every sub-types: every N weeks on weekday, every Nth day
  of month, every Nth weekday of month
- Multi-step config_flow and options_flow (name+mode → mode-specific
  steps → sub-type details for repeat_every)
- Calendar-based due date calculations in sensor.py
- validate_options handles both modes with clean defaults
- Migration 1.4→1.5 backfills new repeat_every fields
- MINOR_VERSION bumped to 5
- strings.json, en.json, de.json updated for all new steps/selectors
- Unit tests fully updated (168 pass)

Agent-Logs-Url: https://github.com/gensyn/task_tracker/sessions/6e72bf5f-d9b6-4f98-8c8a-ec5f7f62d5f7

Co-authored-by: gensyn <36128035+gensyn@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 12, 2026

@copilot While this solution probably works, this is a very minimalistic approach and not very user friendly. I would prefer a solution that supports the following for repeat_every:

  • repeat every ...

Done in commit 11373ab. The repeat_every mode now supports three calendar-based schedule types, presented via a guided multi-step flow:

Step 1 – name + repeat mode (repeat_after or repeat_every)

For repeat_after (step 2a):

  • Interval value + unit (day/week/month/year) — same as before

For repeat_every (step 2b → step 3):

  • Every N weeks on a weekday – pick weekday (Mon–Sun) + interval (e.g. every Wednesday, every other Monday)
  • Every Nth day of the month – pick day 1–31 (clamped to month length, e.g. day 31 → Feb 28/29)
  • Every Nth weekday of the month – pick weekday + occurrence (1st, 2nd, 3rd, 4th, last) — e.g. "2nd Monday" or "last Friday"

The coordinator async_mark_as_done already uses due_date (not today) for repeat_every, so the schedule stays anchored after each completion regardless of when the task was checked off.

Copilot AI changed the title Add repeat_every (fixed-schedule) mode alongside existing repeat_after (completion-coupled) mode Add repeat_every (fixed-schedule) mode with guided multi-step flow alongside existing repeat_after (completion-coupled) mode Apr 12, 2026
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.

Feature Suggestion: Repeat Every vs Repeat After

2 participants