Removed unused `useNavigate` imports from:
- PushReminderDialog.tsx
- PushWarningButton.tsx
These were causing ESLint errors. The navigate hook was imported
but never used in either component.
ESLint should now pass without errors.
- 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
The issue was that DEFAULT_STATE set lastInteraction to Date.now(),
which meant the 5-minute cooldown started immediately on first load,
preventing reminders from ever showing.
Changes:
- Set initial lastInteraction to 0 instead of Date.now()
- Don't reset lastInteraction when switching projects (keep cooldown)
- This allows reminders to show immediately after threshold is met
Users may need to clear localStorage key 'push-reminder-state' to
reset if they already have the old state saved.
- Reduced MESSAGE_THRESHOLD from 5 to 2 for easier testing
- Added console.log statements to track:
- Message counter increments
- shouldShowReminder checks and conditions
- Git status (uncommitted changes, commits ahead, remotes)
- Added useEffect to watch shouldShowReminder changes
- Fixed async state update issue by watching effect dependency
This will help debug why the reminder dialog may not be appearing.
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
Ensure grasp servers stay synchronized with Nostr state events during
the periodic fetch (every 60 seconds). This prevents a critical UX issue
where the Nostr remote appears up-to-date but grasp servers have stale
refs, making the repository uncloneable.
This can occur when a state event is successfully published to Nostr
relays but an error prevents the corresponding git refs from being
pushed to grasp servers. By validating and syncing during fetch, we
ensure at least one grasp server has the correct refs that match the
Nostr state, maintaining repository accessibility.
- Implement useGitFetch hook with 60-second polling
- Add toast notifications for remote changes detection
- Update GitDialog to show fetch status and manual refresh
- Add comprehensive tests for useGitFetch
- Update AGENTS.md documentation
- abstract simple time ago data function
Previously, git fetch for Nostr remotes was directly updating local refs
(refs/heads/*), which incorrectly merged remote changes into the working
tree. Now properly fetches into remote tracking refs (refs/remotes/origin/*)
following standard Git behavior, allowing users to inspect and merge changes
manually.
When no Nostr state event is found, now only fetches from the first priority
clone URL instead of trying all URLs. This prevents potential sync issues
where different servers might have divergent histories, which would create
non-fast-forward conflicts that would revert on the next fetch from the
primary server.
move abstract logic in git method extractRepositoryState to a
pure function parseRepositoryState with typed interface for
future reusability.
pass around parsed event instead of NostrEvent.