Skip to content

Conversation

@zulumonkeymetallic
Copy link

Refactor: Native Firebase Auth, In-App Logs, Sync instrumentation

This PR removes the browser-based auth flow and consolidates the app on native Firebase (Google) sign-in. It also introduces an in-app Logs window and comprehensive logging across CRUD and sync flows, plus a few macOS 14+/15 API updates and fixes.

Highlights

  • Native Firebase Google sign-in (no browser flow)
  • New Logs window with live filters, copy/clear, and Cmd+L shortcut
  • Instrumented CRUD and BOB sync for troubleshooting
  • Firebase initialization hardened and less noisy
  • macOS 14+ API updates to remove deprecation warnings

Changes

Auth

  • Replace browser flow with native Google sign-in:
    • reminders-menubar/Views/SettingsBarView/SettingsBarGearMenu.swift: “Sign In” uses GoogleSignInService.shared.signIn()
    • reminders-menubar/Views/ContentView.swift: prominent “Sign In” CTA when not signed in
  • Remove browser deep-link code:
    • Deleted reminders-menubar/Views/Windows/WebSignInView.swift
    • Deleted reminders-menubar/Services/BobWebLinkService.swift
    • Deleted reminders-menubar/Services/DeepLinkAuthService.swift
    • reminders-menubar/Info.plist: removed custom bobreminders URL scheme; left only Google reversed client ID
    • reminders-menubar/AppDelegate.swift: drop deep link auth handling; keep GoogleSignIn handler only
  • Logging for auth events:
    • reminders-menubar/Services/GoogleSignInService.swift: logs success (uid) and sign-out

Logs (new)

  • reminders-menubar/Services/LogService.swift: lightweight logger with categories (App/Auth/Sync/CRUD/Network)
  • reminders-menubar/Views/Windows/LogsView.swift: window to view logs, filter by category, copy all, and clear
  • “Open Logs…” in UI:
    • Gear menu: adds entry
    • reminders-menubar/AppCommands.swift: View → “Open Logs…” with Cmd+L

Sync + CRUD instrumentation

  • reminders-menubar/Services/BobSyncService.swift: logs start/finish, counts, network errors, reportCompletion
  • reminders-menubar/Services/BobFirestoreSyncService.swift: logs start, imports, acks, finish and errors
  • reminders-menubar/Services/RemindersService.swift: logs save/create/remove with safe optional handling
  • Edit menus log detail:
    • Priority/list/due date changes and completion toggles (including auto-complete children)

Firebase init + noise reduction

  • reminders-menubar/Services/FirebaseManager.swift:
    • Configure with FirebaseOptions.defaultOptions() or bundled plist
    • Early return if missing to avoid I-COR000003 chatter
    • Set logger level to .error in Debug
  • reminders-menubar/AppDelegate.swift: log app launch version

macOS 14/15 deprecations and fixes

  • Authorization status: hasReminderWriteAccess() w/ .fullAccess/.writeOnly
    • Used in AppDelegate.swift and RemindersData.swift
  • Menu style: replace deprecated BorderlessButtonMenuStyle(showsMenuIndicator:) with .menuStyle(.borderlessButton) + .menuIndicator(.hidden)
  • .onChange updated to two-parameter closure where needed
  • Login item API: SMAppService instead of deprecated SMLoginItemSetEnabled

Misc

  • Localization bundle lookup fixed to avoid NSBundle spam when path is empty
  • Notes codec added and used by sync

Testing

  • Clean build on macOS 15 target
  • Sign-in flows:
    • Use “Sign In” menu or main CTA to invoke native Google auth
    • Verify Firebase user appears; log shows success
  • Logs window (Cmd+L): confirm logs appear for CRUD actions and sync
  • Sync from BOB: (if configured) verify items import and mapping logs

Follow-ups

  • If you want full two‑way sync (title/due/list back to BOB), I can add a small local change tracker + POST updates to API once endpoints are ready.

- Add BobSyncService (HTTP push/pull) and BobFirestoreSyncService (native Firestore)
- Add FirebaseManager with safe configure + auth state publishing
- Add GoogleSignInService and URL handling; Info.plist URL scheme
- Add Bob Sync settings window and WebSignInView (with native sign-in)
- Hook completion reporting + Firestore-preferred sync, fallback to HTTP
- Show signed-in status in gear menu and main popover; auto-sync on sign-in
- Expose EKEventStore, add BOB prefs (base URL, UID, secret)
- Project: link FirebaseCore/Auth/Firestore, GoogleSignIn, KeyboardShortcuts; remove unused FirebaseAI/Database
…dd in-app Logs; instrument CRUD/sync; macOS 14+ API updates; Firebase init hardening; View menu Logs command; fix deprecations and optional logging.
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