Skip to content

feat(mobile): a routine calendar on Home (MOCA-191) - #2235

Merged
milind-soni merged 3 commits into
mainfrom
feat/moca-191-mobile-routine-calendar
Oct 3, 2026
Merged

milind-soni merged 3 commits into
mainfrom
feat/moca-191-mobile-routine-calendar

Conversation

@aivsomkar

@aivsomkar aivsomkar commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes MOCA-191

Problem

The desktop has a calendar of routine runs. The phones only had a list of routines in Settings, so there was no way to see what ran on a given day, how it went, or what is coming.

Change

Home has a calendar button beside Settings. It opens a week strip, the way Calendar does on iPhone, over the chosen day's runs in time order.

  • Rules, shared with the desktop: RoutineCalendar (iOS CompanionCore, Android core) is a port of the desktop's projectedRoutineItems.
    • Past and active runs come from their receipts. Finished history is trimmed to 12 per routine; active runs are always kept.
    • Upcoming runs are projected from each enabled routine's schedule: daily at its time on its weekdays (never before the routine was created), and one-time at its moment.
    • Interval and newer schedule kinds (cron) show only the scheduler's persisted next run.
    • A receipt replaces its projection. Weeks start on Monday, like the desktop's.
  • Taps: a past run opens the thread its results went to. A run still to come opens the routine in the existing editor, which is now shared with Threads & Routines. "+" makes a new routine, and a sideways swipe turns the week.
  • Android: RoutineCalendarScreen and Destination.Calendar, which survives the saved navigation stack. The run-status icon and tint are now shared with Threads & Routines. New strings carry Simplified and Traditional Chinese.
A day with a failed run Today, nothing scheduled

Merge note

This PR and the MOCA-155 PR (#2234) both add strings to ios/App/Localizable.xcstrings. Whichever merges second needs that catalog re-merged.

Test plan

  • iOS: swift test passes, 861 tests, including the new RoutineCalendar tests.
  • iOS: on the iPhone 17 Pro simulator, against a local harness with daily, one-time and interval routines plus past receipts:
    • the week strip marks the days that have runs;
    • a past failed run shows its status;
    • tapping a past run opened its results thread;
    • tapping an upcoming run opened the editor.
  • Android: :core:test (766 tests) and :app:testDebugUnitTest (1129 tests) pass, including the updated NavigationTest. The app compiles.
  • Android: open the calendar on a device or emulator (not run)

Platforms

Platform Applies? Status
macOS no n/a: the desktop already has the calendar (RoutineCalendarPage); this ports its rules
Windows no n/a: no desktop, server or electron change
iOS yes in this PR, tested on the iPhone 17 Pro simulator
Android yes in this PR; unit-tested, NOT run on an emulator
Companion no n/a: reads the routines and runs the phones already load

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added a routine calendar on Android and iOS for browsing scheduled runs by week and day.
    • View run status and routine details, jump to today, change weeks, and create or edit routines from the calendar.
    • Open a run’s notification chat when available. Days show scheduled-item counts, and empty days display an informative message.
  • Localization
    • Added calendar interface translations, including Brazilian Portuguese and Simplified and Traditional Chinese.

aivsomkar and others added 3 commits October 3, 2026 19:06
The desktop has a calendar of routine runs; the phone only had a list in
Settings. Home now has a calendar button beside Settings that opens a
week strip, the way Calendar does it on iPhone, over the chosen day's
runs in time order: what ran and how it went, and what is coming.

RoutineCalendar (CompanionCore) is a port of the desktop's
projectedRoutineItems: receipts for past and active runs (finished
history trimmed to 12 per routine, active runs always kept), and
projections from each enabled routine's schedule — daily at its time on
its weekdays (not before it was created), one-time at its moment, and
interval or newer kinds (cron) at the scheduler's persisted next run
only. A receipt replaces its projection. Weeks start on Monday, like the
desktop's.

Tapping a past run opens the thread its results went to; tapping one
still to come opens its routine in the existing editor, which is now
shared with the Threads & Routines screen. "+" makes a new routine; a
sideways swipe turns the week.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port of the iOS calendar. Home has a calendar button beside Settings
that opens a week strip over the chosen day's runs in time order, from
the same rules as the desktop's calendar.

RoutineCalendar (core) is the java.time port of RoutineCalendar.swift /
projectedRoutineItems: receipts for past and active runs (finished
history trimmed to 12 per routine), daily projections on their weekdays
at their time (not before the routine existed), one-time at its moment,
and interval or newer kinds at the scheduler's next run only; a receipt
replaces its projection. Weeks start on Monday.

Tapping a past run opens its results thread through the notification
resolver; one still to come opens the routine editor. "+" makes a new
routine, a sideways swipe turns the week. Destination.Calendar survives
the saved navigation stack. New strings carry Simplified and Traditional
Chinese; the run-status icon and tint are now shared with Threads &
Routines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openmausbot-docs Ready Ready Preview Oct 3, 2026 3:35pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4a8f2d5c-dd57-47c0-8be7-42054b0ffbea
📥 Commits

Reviewing files that changed from the base of the PR and between 17cc1f9 and a38120a.

⛔ Files ignored due to path filters (2)
  • docs/screenshots/moca-191-calendar-day-ios.jpg is excluded by !**/*.jpg
  • docs/screenshots/moca-191-calendar-today-ios.jpg is excluded by !**/*.jpg
📒 Files selected for processing (17)
  • android/app/src/main/kotlin/com/openmausbot/companion/ui/Navigation.kt
  • android/app/src/main/kotlin/com/openmausbot/companion/ui/RootScreen.kt
  • android/app/src/main/kotlin/com/openmausbot/companion/ui/RosterScreen.kt
  • android/app/src/main/kotlin/com/openmausbot/companion/ui/RoutineCalendarScreen.kt
  • android/app/src/main/kotlin/com/openmausbot/companion/ui/TasksRoutinesScreen.kt
  • android/app/src/main/res/values-b+zh+Hans/strings.xml
  • android/app/src/main/res/values-b+zh+Hant/strings.xml
  • android/app/src/main/res/values/strings.xml
  • android/app/src/test/kotlin/com/openmausbot/companion/ui/NavigationTest.kt
  • android/core/src/main/kotlin/com/openmausbot/companion/core/RoutineCalendar.kt
  • android/core/src/test/kotlin/com/openmausbot/companion/core/RoutineCalendarTest.kt
  • ios/App/ChatListView.swift
  • ios/App/Localizable.xcstrings
  • ios/App/RoutineCalendarView.swift
  • ios/App/TasksRoutinesView.swift
  • ios/Sources/CompanionCore/RoutineCalendar.swift
  • ios/Tests/CompanionCoreTests/RoutineCalendarTests.swift

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

Routine calendar calculations and browsing interfaces are added for Android and iOS. The calendars display scheduled routines and run history, with controls for browsing days and weeks.

Changes

Routine Calendar

Layer / File(s) Summary
Calendar items and schedule projection
android/core/.../RoutineCalendar.kt, android/core/.../RoutineCalendarTest.kt, ios/Sources/CompanionCore/RoutineCalendar.swift, ios/Tests/CompanionCoreTests/RoutineCalendarTests.swift
Both core implementations calculate Monday-first weeks and day items from run receipts and routine schedules. Tests cover schedule projections, receipt handling, history limits, and item ordering.
Android calendar navigation
android/app/.../ui/Navigation.kt, android/app/.../ui/RosterScreen.kt, android/app/.../ui/RootScreen.kt, android/app/src/test/.../NavigationTest.kt
Android adds a serializable calendar destination, a roster-header entry point, and a screen route. The navigation test covers saving and restoring the new destination.
Android calendar screen and labels
android/app/.../ui/RoutineCalendarScreen.kt, android/app/.../ui/TasksRoutinesScreen.kt, android/app/src/main/res/values*/strings.xml
The screen supports day and week browsing, routine editing, chat opening, and calendar item display. Status helpers and English and Chinese calendar strings are added.
iOS calendar presentation and labels
ios/App/ChatListView.swift, ios/App/RoutineCalendarView.swift, ios/App/TasksRoutinesView.swift, ios/App/Localizable.xcstrings
The chat-list header opens a calendar sheet. The calendar view supports day and week browsing, routine editing, chat opening, and item display. Status helpers and Brazilian Portuguese strings are updated.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant RoutineCalendarView
  participant RoutineCalendar
  User->>RoutineCalendarView: Select a day
  RoutineCalendarView->>RoutineCalendar: Calculate items for the selected day
  RoutineCalendar-->>RoutineCalendarView: Return calendar items
  RoutineCalendarView-->>User: Display the selected day's items
Loading

Suggested reviewers: milind-soni

Merge Risk: ⚪ Minimal · up to a3812

This change adds a routine calendar on Android and iOS Home screens. No merge-blocking issue was found. The author reports passing unit tests on both platforms, though the Android screen has not been opened on a real device or emulator.

Security Architecture Review

Security architecture risk: 🔵 Low · up to a3812

The calendar reuses existing access and editing permissions rather than granting new authority. Remaining uncertainty concerns interrupted loading and actions during a change of connected computer.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected authority paths remain within the mobile app's existing paired-computer access: reading routines, resolving receipt destinations, and saving routine definitions. No additional privilege was established from these new callers; broader server-side authorization coverage remains unknown.

Trust Boundaries and Controls

  • observed — The iOS receipt resolver's no-client replay restriction and existing bot/room resolution behavior are unchanged in the inspected base comparison. The calendar adds a caller of that resolver, not a replacement for its controls.

Resilience and Maintainability Implications

  • observed — The shared iOS editor starts saving asynchronously, and Cancel dismisses without explicitly cancelling an in-flight save. The base-to-head editor difference only exposes the editor for reuse and changes status helpers, so this save/cancel behavior predates the calendar and is not retained as an introduced concern.

Hardening Proposals

  • proposed — Bind calendar snapshots and their actions to the originating connection and a reload generation, rejecting obsolete completions and clearing obsolete selections. This would make cross-connection ownership explicit; it is a hardening proposal, not a verified cross-connection vulnerability.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 50 functions across 13 files. (4 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the mobile routine calendar as the main change and includes the issue reference.
Description check ✅ Passed The description explains the problem, changes, and verification. It includes screenshots and clearly notes that Android device or emulator testing was not performed. It does not reproduce the template…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 22.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 50 functions across 13 files. (4 skipped: 4 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@milind-soni
milind-soni merged commit 35c3c59 into main Oct 3, 2026
26 of 28 checks passed

This branch was successfully deployed

1 active deployment
Preview — a38120ab Deployed Oct 3, 2026 by vercel[bot]
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.

2 participants