Repository navigation
Add GitHub notification bell with background polling and popover - #45
Conversation
Introduce controllers, models, and services for fetching and caching GitHub notifications, wire a MenuBarExtra and in-app bell into the main window, and add tests plus a status bar icon asset.
Refresh remote presentation earlier during repository load and resolve preferred remote without querying all remotes.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (17)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthroughThe app now fetches and caches GitHub notifications, tracks notification read state, and displays notifications in a popover. It also adds notification access to the menu bar and app views, and adjusts remote presentation timing and selection. ChangesGitHub Notifications
Remote Presentation
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
actor User
participant NotificationPopover
participant GitHubNotificationController
participant Cache
participant GitHubNotificationService
User->>NotificationPopover: Open notification
NotificationPopover->>GitHubNotificationController: Open notification
GitHubNotificationController->>Cache: Persist local viewed state
GitHubNotificationController->>GitHubNotificationService: Update thread as read
GitHubNotificationService-->>GitHubNotificationController: Return update result
Merge Risk: ⚪ Minimal · up to The identified remote shortcut behavior is unchanged, and notification refresh respects the intended polling interval. No identified issue blocks merging after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 2.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 43 functions across 16 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
Add GitHub notification bell with background polling
Summary
Adds a GitHub notification bell to the toolbar with background polling of the GitHub notifications inbox, a popover to view notifications per account, and a small-icon asset.
Changes
macgit/App/GitHubNotificationController.swiftmanages per-account notification caches, errors, busy state, and a selected-account filter persisted inUserDefaults. It subscribes toGitProviderAccountControlleraccounts, reconciles persisted caches, and runs a polling loop (60s interval), refreshing all accounts as needed.GitHubNotification,GitHubNotificationCache,GitHubNotificationDisplayRow,GitHubNotificationError,GitHubNotificationFetch.macgit/Services/GitHubNotificationService.swift(behind theGitHubNotificationProvidingprotocol), fetched with a GitHub API token from the token vault.GitHubNotificationBell,GitHubNotificationPopover,GitHubNotificationRefreshButton,GitHubNotificationRowundermacgit/Views/Common/.macgitApp.swift,MainWindowView.swift,ContentView.swift, andWelcomeDashboardContent.swiftupdated to surface the bell in the toolbar/window.small-iconimageset.macgitTests/GitHubNotificationTests.swift.Notable behavior
start(provider:); it only runs while the task is not cancelled and skips when the provider is loading.X-Poll-Intervalis stored separately asnextFetchAt.pendingReads; a later update to the same notification is treated as new unread.SSH credentials alone cannot fetch the inbox).Review notes / uncertainty
next.nextFetchAt = ...; the remainder ofGitHubNotificationController.swift(roughly the last ~40 lines) and all other new/changed files are not visible here, so their contents and any behavior in them are uncertain.Summary by CodeRabbit