From c25517a58f244ad787e43d7a979cf2acee0911cd Mon Sep 17 00:00:00 2001 From: "shakespeare.diy" Date: Tue, 11 Nov 2025 14:06:43 -0600 Subject: [PATCH] Remove debug logging and restore production settings - Removed all console.log debug statements - Changed MESSAGE_THRESHOLD back to 5 (from 2 for testing) - Cleaned up code for production Push reminder features are now fully functional: - Warning icon appears in header when there's unpushed work - Popup appears after 5 messages if conditions are met - 5-minute cooldown between reminders - User can disable in Settings > Preferences --- src/hooks/usePushReminder.ts | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/src/hooks/usePushReminder.ts b/src/hooks/usePushReminder.ts index 30307405..8b62fb43 100644 --- a/src/hooks/usePushReminder.ts +++ b/src/hooks/usePushReminder.ts @@ -21,7 +21,7 @@ const DEFAULT_STATE: PushReminderState = { }; /** Number of messages before showing push reminder */ -const MESSAGE_THRESHOLD = 2; // Lowered to 2 for easier testing +const MESSAGE_THRESHOLD = 5; /** Minimum time in ms between showing reminders (5 minutes) */ const MIN_REMINDER_INTERVAL = 5 * 60 * 1000; @@ -49,14 +49,12 @@ export function usePushReminder(projectId: string | null) { // Check if should show reminder const shouldShowReminder = useCallback(() => { if (!state.enabled || !projectId || !gitStatus?.isGitRepo) { - console.log('[PushReminder] Should NOT show - enabled:', state.enabled, 'projectId:', projectId, 'isGitRepo:', gitStatus?.isGitRepo); return false; } // Don't show if user recently interacted with push reminder const timeSinceLastInteraction = Date.now() - state.lastInteraction; if (timeSinceLastInteraction < MIN_REMINDER_INTERVAL) { - console.log('[PushReminder] Should NOT show - too soon since last interaction:', Math.round(timeSinceLastInteraction / 1000), 'seconds'); return false; } @@ -69,37 +67,18 @@ export function usePushReminder(projectId: string | null) { gitStatus.remotes.length === 0; const enoughMessages = state.messagesSinceLastPush >= MESSAGE_THRESHOLD; - console.log('[PushReminder] Check:', { - hasUnpushedWork, - enoughMessages, - messageCount: state.messagesSinceLastPush, - threshold: MESSAGE_THRESHOLD, - hasUncommittedChanges: gitStatus.hasUncommittedChanges, - ahead: gitStatus.ahead, - remotesCount: gitStatus.remotes.length, - }); - - const shouldShow = hasUnpushedWork && enoughMessages; - console.log('[PushReminder] Should show reminder:', shouldShow); - - return shouldShow; + return hasUnpushedWork && enoughMessages; }, [state, projectId, gitStatus]); // Increment message counter const incrementMessages = useCallback(() => { - if (!state.enabled || !projectId) { - console.log('[PushReminder] Not incrementing - enabled:', state.enabled, 'projectId:', projectId); - return; - } - - const newCount = state.messagesSinceLastPush + 1; - console.log('[PushReminder] Incrementing message counter to:', newCount); + if (!state.enabled || !projectId) return; setState((prev) => ({ ...prev, messagesSinceLastPush: prev.messagesSinceLastPush + 1, })); - }, [state.enabled, projectId, setState, state.messagesSinceLastPush]); + }, [state.enabled, projectId, setState]); // Reset counter (called after push or dismiss) const resetReminder = useCallback(() => {