Skip to content

[Fix] Show Calendar recurrences from their start date - #133

Open
ZainnQureshii wants to merge 1 commit into
facebookresearch:mainfrom
ZainnQureshii:fix/calendar-recurrence-start
Open

ZainnQureshii wants to merge 1 commit into
facebookresearch:mainfrom
ZainnQureshii:fix/calendar-recurrence-start

Conversation

@ZainnQureshii

Copy link
Copy Markdown

Summary

Save a Weekly event dated February 12, 2030 through Add Event. In February on main, the Calendar grid shows only the 12th. Agenda shows the 5th, 12th, 19th, and 26th. Both views show Weekly occurrences in January and show Monthly and Yearly occurrences before their start dates. The grid skipped recurrence expansion for the entire start month. Agenda began expanding from the requested range start. See src/open_apps/apps/calendar_app/main.py:751 and src/open_apps/apps/calendar_app/main.py:843 on main.

The grid and Agenda now show the Weekly event on February 12, 19, and 26. Weekly, Monthly, and Yearly occurrences begin on or after the stored start date. The sidebar mini-month uses the same dates as the grid, and RSS event selection uses the same date bound as Agenda. Event detail links still open the stored series. See src/open_apps/apps/calendar_app/main.py:752, src/open_apps/apps/calendar_app/main.py:807, src/open_apps/apps/calendar_app/main.py:847, src/open_apps/apps/calendar_app/main.py:983, src/open_apps/apps/calendar_app/main.py:682, and src/open_apps/apps/calendar_app/main.py:1279.

UI questions read stored events from /calendar_all. On main the February count answer is one, which matches the old February grid. With the grid fix alone, that answer was still one even though three chips appeared. Day questions could offer a second visible occurrence as a wrong choice. _events_in_month now emits an entry for each visible Weekly date, so the count answer is three in February and four in March. The appearance template asks once per title, and the day template offers exactly one date on which that title appears. The three templates share the same occurrence list. /calendar_all continues to return the stored series. See tests/ui_questions/question_generation/templates.py:119 and tests/ui_questions/question_generation/templates.py:566 on main, and tests/ui_questions/question_generation/templates.py:115, tests/ui_questions/question_generation/templates.py:502, tests/ui_questions/question_generation/templates.py:524, tests/ui_questions/question_generation/templates.py:574, and src/open_apps/apps/calendar_app/main.py:1465 in this change.

Testing

The Calendar tests submit Add Event and assert the actual dates in the rendered grid and Agenda. The question test checks the count, appearance, and day choices for the same Weekly event in February and March. See tests/test_calendar_layouts.py:222 and tests/test_questions.py:209.

  • Red on main with the regression tests. Exit 1 with 13 expected failures and 16 passing controls.

    uv run --active --no-sync -m pytest -p no:cacheprovider tests/test_calendar_layouts.py tests/test_questions.py -k 'recurring_event_dates or calendar_questions_respect_recurrence_start or calendar_questions_use_weekly_occurrences' --tb=short
  • Red on the earlier grid fix with the new question test. Exit 1 with both count assertions failing.

    uv run --active --no-sync -m pytest -p no:cacheprovider tests/test_questions.py -k calendar_questions_use_weekly_occurrences --tb=short
  • Final Calendar and question-generation suites. Exit 0 with 243 passing tests.

    uv run --active --no-sync -m pytest -p no:cacheprovider tests/test_calendar_layouts.py tests/test_calendar_variations.py tests/test_calendar_i18n.py tests/test_questions.py --tb=short
  • Ruff 0.12.7 from uv.lock. Whole-file lint and format checks each exited 1 on pristine main and on the patch, with the same 28 diagnostics and identical formatter edits. All eight changed ranges passed formatting.

    uv run --active --no-sync ruff check --output-format json src/open_apps/apps/calendar_app/main.py tests/test_calendar_layouts.py tests/test_questions.py tests/ui_questions/question_generation/templates.py
    uv run --active --no-sync ruff format --check src/open_apps/apps/calendar_app/main.py tests/test_calendar_layouts.py tests/test_questions.py tests/ui_questions/question_generation/templates.py

AI disclosure

OpenAI Codex investigated the defect, prepared the fix and regression tests, and drafted this description. Claude Code coordinated the work. GitHub Copilot identified the Weekly question mismatch in the preceding revision.

Prepared with AI assistance (Codex and Claude Code) and reviewed with GitHub Copilot.

🤖 Generated with Claude Code

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 25, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant