Skip to content

Conversation

@zulumonkeymetallic
Copy link

Summary

  • wire up background Bob sync metadata handling and idempotent reminder integration
  • refresh Firebase sync orchestration, logging, and UI affordances
  • document rollout steps and capture outstanding follow-ups

Testing

  • not run (not applicable)

… Google config, add Auth window, implement FirebaseSyncService with idempotency, main-actor fixes for Reminders access, and logging. Update project to include new sources.
…issues.sh to open issues via gh when enabled.
Copilot AI review requested due to automatic review settings September 30, 2025 22:20
Copy link

Copilot AI left a 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 implements comprehensive Bob sync metadata handling and Firebase integration for the Reminders MenuBar app. It transforms the application from a standalone reminders manager into a bidirectional sync tool that connects Apple Reminders with Firebase/Firestore, enabling cloud-based collaboration and cross-platform task management.

  • Adds complete Firebase authentication and sync infrastructure with Google Sign-In support
  • Implements background sync scheduling and manual sync controls with comprehensive UI feedback
  • Introduces theme-to-calendar mapping system for automated reminder organization

Reviewed Changes

Copilot reviewed 37 out of 40 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
tools/swiftlint/LICENSE Adds MIT license for SwiftLint tooling
scripts/create_issues.sh Automated script for creating GitHub issues tracking sync enhancements
reminders-menubar/reminders_menubar.entitlements Adds Firebase-required entitlements for network, reminders, and keychain access
reminders-menubar/Views/Windows/ThemeCalendarMappingView.swift New UI for mapping Bob themes to Reminders calendars
reminders-menubar/Views/Windows/KeyboardShortcutView.swift Updates keyboard shortcut configuration for Bob sync
reminders-menubar/Views/Windows/FirebaseAuthView.swift Complete Firebase authentication interface with Google Sign-In
reminders-menubar/Views/SettingsBarView/SettingsBarSyncIndicator.swift Sync status indicator with last sync timestamp
reminders-menubar/Views/SettingsBarView/SettingsBarGearMenu.swift Adds Bob sync menu with background sync controls
reminders-menubar/Views/ContentView.swift Integrates sync feedback toast notifications
reminders-menubar/Services/* Core sync services including Firebase integration, logging, and background scheduling
reminders-menubar/Constants.swift Updates bundle IDs and adds native Reminders integration toggle

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +6 to +9
if ! command -v gh >/dev/null 2>&1; then
echo "Error: GitHub CLI (gh) is required. Install from https://cli.github.com/" >&2
exit 1
fi
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider adding a check for required environment variables or configuration before attempting to create issues. The script assumes GitHub CLI is authenticated and has proper repository access permissions.

Copilot uses AI. Check for mistakes.
}
}
.labelsHidden()
Button("Add/Update") { addMapping() }.disabled((newTheme.trimmingCharacters(in: .whitespaces).isEmpty) || selectedListId == nil)
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Extract the validation logic into a computed property or function for better readability and reusability. The inline condition is complex and repeated logic appears elsewhere.

Copilot uses AI. Check for mistakes.
Comment on lines +112 to +116
private func loadAvailableThemes(force: Bool) async {
#if canImport(FirebaseFirestore)
if !FirebaseManager.shared.isConfigured {
FirebaseManager.shared.configureIfNeeded()
}
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The function is excessively long (100+ lines) and handles multiple responsibilities including network requests, error handling, caching, and UI updates. Consider breaking this into smaller, focused functions.

Copilot uses AI. Check for mistakes.
Comment on lines +20 to +21
// swiftlint:disable cyclomatic_complexity function_body_length type_body_length file_length
actor FirebaseSyncService {
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The SwiftLint disable comment indicates this service has grown too large and complex. Consider breaking this into smaller, focused services (e.g., TaskSyncService, ReminderImportService, ConflictResolutionService) to improve maintainability and testability.

Copilot uses AI. Check for mistakes.
// - Updates fields both directions (title, due, completion)
// - Clears mappings for tasks whose reminders are gone
// - Best-effort delete: if task has deleted flag, remove reminder
func syncNow(targetCalendar preferredCalendar: EKCalendar?) async -> (created: Int, updated: Int, errors: [String]) {
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] This function is extremely long (650+ lines) and handles numerous responsibilities including task fetching, conflict resolution, duplicate detection, and batch operations. This violates the single responsibility principle and makes testing and debugging difficult.

Copilot uses AI. Check for mistakes.
Comment on lines +27 to +29
private func rotateIfNeeded(_ url: URL) {
// Simple size-based rotation at ~1 MiB
let limit: UInt64 = 1 * 1024 * 1024
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The rotation logic doesn't handle potential race conditions when multiple sync operations run concurrently. Consider adding file locking or atomic operations to prevent corruption during log rotation.

Copilot uses AI. Check for mistakes.
Comment on lines +26 to +34
scheduler.schedule { completion in
Task {
// Preflight
if FirebaseManager.shared.db != nil, await RemindersService.shared.hasFullRemindersAccess() {
_ = await FirebaseSyncService.shared.syncNow(targetCalendar: nil)
}
completion(.finished)
}
}
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Background sync errors are silently ignored. Consider logging failures and potentially adjusting the retry schedule based on error types to improve reliability.

Copilot uses AI. Check for mistakes.
Comment on lines +13 to +14
static let mainBundleId = "com.jc1.tech.bob"
static let launcherBundleId = "com.jc1.tech.bob.launcher"
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The bundle ID change suggests this is a fork or rebrand, but the hardcoded values should be configurable through build settings or Info.plist to support different deployment environments.

Suggested change
static let mainBundleId = "com.jc1.tech.bob"
static let launcherBundleId = "com.jc1.tech.bob.launcher"
static var mainBundleId: String {
return Bundle.main.bundleIdentifier ?? "-"
}
static var launcherBundleId: String {
// Reads "LauncherBundleIdentifier" from Info.plist
return Bundle.main.infoDictionary?["LauncherBundleIdentifier"] as? String ?? "-"
}

Copilot uses AI. Check for mistakes.
GCC_WARN_UNUSED_VARIABLE = YES;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MACOSX_DEPLOYMENT_TARGET = 15.0;
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The deployment target was raised from 11.0 to 15.0, which significantly reduces device compatibility. This may be unnecessarily restrictive since many Firebase and sync features could work on earlier macOS versions.

Suggested change
MACOSX_DEPLOYMENT_TARGET = 15.0;
MACOSX_DEPLOYMENT_TARGET = 11.0;

Copilot uses AI. Check for mistakes.
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