-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add Apple Calendar and Notes export integration for action items #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This commit merges the Apple Calendar/Notes export features with the changes from PR BasedHardware#2719. Key changes: - Added export dropdown to ActionItemTileWidget with Calendar, Notes, and Reminders options - Implemented AppleCalendarService for EventKit Calendar integration on iOS - Implemented AppleNotesService for Apple Notes export on iOS - Added ActionItemIntegration enum for managing export destinations - Extended SharedPreferences to store user's chosen export destination - Updated AppDelegate.swift to handle new native method channels The implementation allows users to export action items directly to: - Apple Reminders (existing) - Apple Calendar (new) - Apple Notes (new) Users can select their preferred export destination via a dropdown menu that remembers their choice across sessions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds Apple Calendar and Notes export functionality for action items, merging with changes from PR BasedHardware#2719. The implementation provides users with multiple export destinations (Reminders, Notes, Calendar) through a configurable dropdown interface.
- Adds Apple Calendar integration for creating calendar events from action items
- Adds Apple Notes integration for sharing action items to the Notes app via native share sheet
- Implements persistent user preferences for export destination selection
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
app/lib/services/apple_notes_service.dart |
Dart service wrapper for Apple Notes integration using platform channels |
app/lib/services/apple_calendar_service.dart |
Dart service wrapper for Apple Calendar integration using EventKit |
app/lib/pages/action_items/widgets/action_item_tile_widget.dart |
Converts to StatefulWidget and adds export dropdown UI with multi-destination support |
app/lib/models/action_item_integration.dart |
Enum defining available export destinations with display names and icons |
app/lib/backend/preferences_export_extension.dart |
SharedPreferences extension for persisting export destination choice |
app/ios/Runner/AppleNotesService.swift |
Native iOS implementation for Notes app integration via UIActivityViewController |
app/ios/Runner/AppleCalendarService.swift |
Native iOS implementation for Calendar integration using EventKit framework |
app/ios/Runner/AppDelegate.swift |
Registers method channels for new Notes and Calendar services |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
app/lib/pages/action_items/widgets/action_item_tile_widget.dart
Outdated
Show resolved
Hide resolved
- Use ISO8601 date formatting instead of manual string splitting - Add proper error logging with debugPrint instead of catching with underscore - Replace force unwrapping with guard statements in Swift code - Make calendar event duration configurable (default 60 minutes) - Fix export state persistence by lifting state management to parent widget - Ensure export tracking is consistent across all integrations
| if let controller = UIApplication.shared.keyWindow?.rootViewController { | ||
| controller.present(activityViewController, animated: true) | ||
| } else { | ||
| result(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 'reminders': <String>{}, | ||
| 'notes': <String>{}, | ||
| 'calendar': <String>{}, | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Export Status Inconsistency and State Loss
The _exportedItems getter in ActionItemTileWidgetState has two issues: when widget.exportedItems is null, it creates a new map on each access, losing local state changes. When widget.exportedItems is provided, it allows direct modification of parent state. This results in inconsistent export status and lost tracking.
|
✅ All code review feedback has been addressed:
The code is now ready for final review and merge. |
closes BasedHardware#3241 before: https://github.com/user-attachments/assets/d00d815c-8419-4c1b-96fb-ec20365fba44 logs: ``` flutter: ----------------FIREBASE CRASHLYTICS---------------- flutter: Bad state: No element flutter: #0 ListBase.firstWhere (dart:collection/list.dart:132:5) #1 SharedPreferencesUtil.disableApp (package:omi/backend/preferences.dart:255:22) #2 _AppDetailPageState._toggleApp (package:omi/pages/apps/app_detail/app_detail.dart:1129:13) #3 _AppDetailPageState.build.<anonymous closure> (package:omi/pages/apps/app_detail/app_detail.dart:576:48) #4 _AnimatedLoadingButtonState._handleOnPressed (package:omi/widgets/animated_loading_button.dart:38:27) #5 _InkResponseState.handleTap (package:flutter/src/material/ink_well.dart:1204:21) #6 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:345:24) #7 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:758:11) #8 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:383:5) #9 BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:353:7) #10 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:173:27) #11 ``` after: https://github.com/user-attachments/assets/26ea5c91-e73a-44f4-ba76-4b804876c5df <img width="1032" height="257" alt="Screenshot 2025-10-18 at 11 15 52 PM" src="https://github.com/user-attachments/assets/44e4e46b-b654-4599-84ee-8ee0920b1cd3" />
Summary
This PR merges the Apple Calendar/Notes export features with the changes introduced in PR BasedHardware#2719 (Separate action items fetching from convos).
Features Added
Implementation Details
New Files
app/ios/Runner/AppleCalendarService.swift- EventKit integration for Calendarapp/ios/Runner/AppleNotesService.swift- Apple Notes export functionalityapp/lib/models/action_item_integration.dart- Enum for export destinationsapp/lib/backend/preferences_export_extension.dart- SharedPreferences extensionapp/lib/services/apple_calendar_service.dart- Dart service for Calendarapp/lib/services/apple_notes_service.dart- Dart service for NotesModified Files
app/ios/Runner/AppDelegate.swift- Added method channels for new servicesapp/lib/pages/action_items/widgets/action_item_tile_widget.dart- Added export dropdown UIExport Options
Users can now export action items to:
Testing
To test this feature:
flutter pub getto ensure dependencies are updatedCompatibility