Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Nov 23, 2025

feat: unified calendar schema and Apple Calendar integration

Summary

This PR implements a unified calendar event schema that supports Google Calendar, Apple Calendar, and Outlook, and integrates the Apple Calendar plugin with TinyTick-based periodic syncing.

Key Changes:

  1. Expanded calendar/event schemas in schema-external.ts to include provider-specific fields:

    • Events: tracking_id, provider, participants, is_recurring, recurrence_rule, all_day, timezone, status, visibility, organizer_name, organizer_email, provider_url
    • Calendars: tracking_id, provider, selected, source, color, timezone
  2. Apple Calendar plugin integration with macOS platform guards in lib.rs

  3. TinyTick-based periodic sync in task-manager.tsx:

    • Calendar sync every 10 minutes
    • Event sync every 5 minutes
    • Replaces the previous Rust worker-based approach
  4. Wired Apple Calendar plugin dependencies:

    • Added @hypr/plugin-apple-calendar as workspace dependency (JS)
    • Added tauri-plugin-apple-calendar as macOS-only Rust dependency
  5. Platform detection using @tauri-apps/plugin-os with async isMacOS() helper and module-level caching

Updates Since Last Revision

Fixed CI Failures:

  • Added tauri-plugin-apple-calendar to desktop app's Cargo.toml as a macOS-only dependency (fixes Rust compilation error)
  • Replaced user-agent based platform detection with proper Tauri OS plugin API (@tauri-apps/plugin-os)
  • Made isMacOS() async with module-level caching for efficiency
  • All CI checks now passing (macOS, Ubuntu 22.04, Ubuntu 24.04, fmt)

Review & Testing Checklist for Human

  • [CRITICAL] Test on macOS: Verify that calendar and event syncing actually works on macOS. The periodic tasks should run every 10/5 minutes and populate the database with calendar data.
  • [CRITICAL] Verify schema compatibility: Check that the new schema fields match what the Apple Calendar plugin actually returns in plugins/apple-calendar/src/sync.rs. There may be field name mismatches (e.g., name vs title).
  • [CRITICAL] Verify async platform detection: Confirm that the @tauri-apps/plugin-os based isMacOS() check correctly identifies macOS and prevents sync tasks from running on Linux/Windows. Test that the async await doesn't cause timing issues with TinyTick task execution.
  • Test on Linux: Ensure the app still builds and runs on Linux without the Apple Calendar plugin (should be excluded by platform guards in Cargo.toml).
  • Check database migrations: Verify if any database migrations are needed for the new schema fields, or if the optional fields handle missing data gracefully.

Test Plan

  1. Build and run the app on macOS
  2. Grant calendar access when prompted
  3. Wait for the first sync cycle (up to 10 minutes) or trigger manually
  4. Verify that calendars and events appear in the database with the new fields populated
  5. Check that the app still builds on Linux without errors
  6. Verify that sync tasks don't run on non-macOS platforms (check console logs)

Notes

  • Platform detection now uses @tauri-apps/plugin-os (the official Tauri v2 plugin) instead of user-agent parsing
  • The isMacOS() function is async with module-level caching to minimize overhead (tasks only run every 5-10 minutes)
  • All new schema fields are optional to maintain backward compatibility
  • Dynamic imports are used for the Apple Calendar plugin to avoid import errors on non-macOS platforms
  • TypeScript compilation and all CI checks pass (macOS, Linux, fmt)
  • The Rust plugin dependency is macOS-only via [target.'cfg(target_os = "macos")'.dependencies]

Session: https://app.devin.ai/sessions/efa6da15cbba48d9800627dad471c449
Requested by: yujonglee (@yujonglee)

- Design unified calendar event schema supporting Google, Apple, and Outlook
- Add tracking_id, provider, participants, recurrence fields to events schema
- Add provider, selected, source, color, timezone fields to calendars schema
- Integrate Apple Calendar plugin with macOS platform guards
- Implement TinyTick-based periodic sync (calendars: 10min, events: 5min)
- Replace Rust worker-based sync with frontend TinyTick scheduling

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 23, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch devin/1763897993-unified-calendar-schema

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

@netlify
Copy link

netlify bot commented Nov 23, 2025

Deploy Preview for hyprnote ready!

Name Link
🔨 Latest commit 8680634
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/692302bb8c094100082ecf2b
😎 Deploy Preview https://deploy-preview-1816--hyprnote.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

devin-ai-integration bot and others added 3 commits November 23, 2025 11:57
- Add @hypr/plugin-apple-calendar workspace dependency to desktop app
- Replace non-existent @tauri-apps/plugin-os with user-agent based platform check
- Fix TypeScript errors: add Channel import and progress parameter type
- Use isMacOS() helper function for platform detection instead of async API

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
- Add tauri-plugin-apple-calendar to desktop app's Cargo.toml under target-specific dependencies
- This fixes the macOS CI build failure where the plugin was referenced but not declared
- Uses workspace = true to reference the plugin from workspace dependencies
- Platform guard ensures it only compiles on macOS builds

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
- Replace user-agent based platform detection with @tauri-apps/plugin-os
- Add @tauri-apps/plugin-os to desktop app dependencies
- Make isMacOS() async with module-level caching for efficiency
- Update calendar sync tasks to await async platform check
- Addresses CodeRabbit review feedback for more reliable OS detection

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@yujonglee yujonglee force-pushed the main branch 4 times, most recently from cd99174 to cb527d5 Compare November 29, 2025 13:01
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