Add push reminder features to encourage users to push code

Implements two key features to prevent data loss:

1. Push Warning Button
   - Icon button in project header that appears when:
     - No remote is configured
     - There are commits ahead of remote
     - There are uncommitted changes
   - Click opens Git dialog for one-click push or remote configuration
   - Visual indicators with tooltips showing status

2. Periodic Push Reminder Dialog
   - Dismissible popup appears after 5 messages if there's unpushed work
   - Shows different content based on git status:
     - No remote: Prompts to configure remote
     - Commits ahead: Prompts to push
     - Uncommitted changes: Prompts to commit and push
   - Can be disabled with "Don't show again" checkbox
   - Setting in Preferences to re-enable reminders
   - Respects 5-minute cooldown between reminders

3. User Preferences
   - Added "Push reminders" toggle in Settings > Preferences
   - Enabled by default to encourage best practices
   - Stored in local storage for persistence

Technical implementation:
- Created usePushReminder hook for state management
- Tracks message count and last interaction timestamp
- Integrates with existing useGitStatus hook
- Added onMessageSent callback to ChatPane
- PushWarningButton component with icon/full variants
- PushReminderDialog with contextual messaging
- Translations added to English locale
This commit is contained in:
shakespeare.diy committed 2025-11-11 13:43:16 -06:00
1 parent e116f7e9ec
commit 5de01c6130
7 files changed
+506 -1

No files matched your search

+8 -1
View File
@@ -52,6 +52,7 @@ interface ChatPaneProps {
onNewChat: () => void;
onFirstInteraction?: () => void;
onLoadingChange?: (isLoading: boolean) => void;
onMessageSent?: () => void;
isLoading?: boolean;
isBuildLoading?: boolean;
consoleError?: ProjectPreviewConsoleError | null;
@@ -67,6 +68,7 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
onNewChat,
onFirstInteraction,
onLoadingChange,
onMessageSent,
isLoading: externalIsLoading,
isBuildLoading: externalIsBuildLoading,
consoleError,
@@ -478,7 +480,12 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
// Send as text parts if we have multiple parts, otherwise send as string for simplicity
const messageContent = contentParts.length === 1 ? contentParts[0].text : contentParts;
await sendMessage(messageContent, modelToUse);
}, [addRecentlyUsedModel, fs, isConfigured, isLoading, providerModel, sendMessage, tmpPath]);
// Notify parent that a message was sent (for push reminder tracking)
if (onMessageSent) {
onMessageSent();
}
}, [addRecentlyUsedModel, fs, isConfigured, isLoading, providerModel, sendMessage, tmpPath, onMessageSent]);
// Handle textarea focus - show onboarding if not configured
const handleTextareaFocus = useCallback(() => {