Add temporary pause controls#765
Open
akramj13 wants to merge 5 commits into
Open
Conversation
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add temporary pause controls so users can quiet Cotabby for a bounded period without changing their normal global setting or adding a permanent per-app rule.
This branch adds durable pause state, menu-bar pause actions and status, and pipeline gating so Cotabby does not generate, show, or accept suggestions while paused.
Validation
Linked issues
Fixes #8
Risk / rollout notes
Greptile Summary
This PR adds a temporary pause feature to Cotabby, allowing users to silence suggestions for bounded durations (15 min, 30 min, 1 hr, until tomorrow, or indefinitely) without changing their permanent global-enable setting. The implementation introduces durable
SuggestionPauseStatepersisted viaUserDefaults, aSuggestionSettingsModel-owned timer for auto-expiry, and full pipeline gating (input, visual context capture, acceptance, indicator) via theSuggestionSettingsSnapshot.SuggestionPauseModels.swift):SuggestionPauseDurationencapsulates all calendar math (including DST-safe "until tomorrow" viaCalendar.startOfDay), andSuggestionPauseStateis a codable enum that is persisted across launches with expiry filtering on load.pauseStateis a@Publishedproperty integrated into the Combine snapshot publisher alongside$isGloballyEnabled; aTimeronRunLoop.main(.common)auto-callsclearPause()on expiry;toggleGloballyEnabled()is updated to callenableCotabby()(which clears both mechanisms) instead of just flipping the global flag.isTemporarilyPausedtoSuggestionAvailabilityEvaluator; the menu bar replaces the global toggle with a pause sub-menu and a single recovery action.Confidence Score: 5/5
The change is safe to merge. All six pipeline gate sites are updated consistently, persistence round-trips correctly, and the timer auto-expiry is wired to RunLoop.main(.common) so it fires through menu tracking and other UI modes.
The new pause state is well-isolated from the existing global-enable flag, the Combine publisher integration is correct, expired pauses are filtered on load and cleaned from UserDefaults, and the acceptance gate prevents Tab from accepting a stale pre-pause suggestion. Test coverage is thorough: calendar math, expiry boundary, store round-trips, coordinator gating, and snapshot publisher emissions are all exercised. No functional defects were identified in the changed paths.
No files require special attention.
Important Files Changed
Reviews (2): Last reviewed commit: "fix: preserve pause state on encode fail..." | Re-trigger Greptile