Overview
Estudo Organizado includes an intelligent notification system that helps you stay on track with spaced repetitions and weekly study goals. The system respects silent hours and avoids notification spam through smart deduplication.Notification Permissions
Permission States
The notification system handles three permission states:Browser Support
| Browser | Support | Notes |
|---|---|---|
| Chrome | β Full | Requires HTTPS or localhost |
| Firefox | β Full | Requires HTTPS or localhost |
| Safari | β Full | iOS 16.4+ for web apps |
| Edge | β Full | Chromium-based |
Notifications require user permission and HTTPS (or localhost for development). The app will fallback to in-app toast messages if notifications are unavailable.
Permission Request
Permission is automatically requested when the app initializes:Silent Hours (Modo Silencioso)
Prevent notifications during sleep hours:Configuration
How It Works
Silent hours support overnight ranges. For example, 22-8 means notifications are blocked from 10 PM to 8 AM.
Notification Types
Revision Reminders
Alerts for pending spaced repetition reviews:- One or more subjects have pending reviews
- Current time is outside silent hours
- Notification hasnβt been shown today
Weekly Goal Alerts
Predictive notifications based on study pace:- π’ Verde (Green): On track (β₯90% projected completion)
- π‘ Amarelo (Yellow): At risk (70-89% projected)
- π΄ Vermelho (Red): High risk (less than 70% projected)
Example Notification Messages
Example Notification Messages
Based on your study pace, the system generates contextual suggestions:Green Status:
- βExcelente! VocΓͺ estΓ‘ no caminho certo para atingir sua meta.β
- βAtenΓ§Γ£o! VocΓͺ precisa estudar 2h30min por dia nos prΓ³ximos 4 dias para atingir sua meta.β
- βAlerta! Mesmo estudando 4h por dia, sua meta estΓ‘ difΓcil. Considere ajustar suas expectativas.β
Spam Prevention
The system prevents duplicate notifications:- Each notification has a unique
tagKey - Keys are combined with current date
- Same notification only shows once per day
- Set resets on page reload
Notification Delivery
Native Notifications
When permission is granted:- Title: Bold header text
- Body: Detailed message (supports emoji)
- Icon: App favicon from root directory
- Tag: Prevents duplicate notifications
- Interaction: Auto-dismisses (configurable)
Fallback: In-App Toasts
If native notifications are unavailable:- Display in bottom-right corner
- Show for 8 seconds (vs 3.5s for normal toasts)
- Include bell emoji (π) prefix
- Use info styling (blue background)
Notification Engine
Startup Behavior
- Immediate: On app initialization (after 5s delay)
- Recurring: Every 4 hours while app is open
- Skipped: During silent hours
Manual Trigger
Notifications are checked when:The 4-hour interval ensures notifications stay current without excessive battery drain. Checks are skipped entirely during silent hours.
Implementation Example
Complete Flow
Configuration Reference
State Variables
Module Exports
Best Practices
For Users
- Grant permission for best experience
- Configure silent hours to match your sleep schedule
- Set realistic goals to avoid excessive alerts
- Keep app open for recurring checks (or use PWA)
For Developers
- Always check
isSilentHour()before firing notifications - Use unique
tagKeyvalues for each notification type - Provide meaningful fallback messages for toasts
- Test across different browsers and permission states
PWA Support
When installed as a Progressive Web App:- Notifications work even when browser is closed (on supported platforms)
- Icon displays from
favicon.icoor PWA manifest - Background sync can trigger notifications (if implemented)
- Service worker enables offline notification queueing
For full PWA notification support, ensure your manifest.json includes notification permission and the service worker is properly registered.
Troubleshooting
Notifications Not Appearing
- Check permission: Look for browser notification settings
- Verify HTTPS: Notifications require secure context
- Test silent hours: Ensure current time is outside configured range
- Check console: Look for Notification API errors
- Try fallback: In-app toasts should always work
Duplicate Notifications
If youβre seeing duplicates:- Check
lastNotifiedKeysis working (should reset on reload) - Verify unique
tagKeyvalues - Ensure date formatting is consistent
Missing Notifications
If notifications never fire:- Verify
state.confighas required fields - Check
getPendingRevisoes()returns data - Ensure 4-hour interval hasnβt been cleared
- Test with
checkTriggers()manually in console
Related Documentation
- Application Settings - Configure goals and revision frequencies
- Theme Customization - Visual appearance doesnβt affect notifications
- Spaced Repetition - How revision reminders are calculated