Run the simple test to verify notifications work:
cd /Users/abrichr/oa/src/openadapt-tray
.venv/bin/python test_notification_simple.pyThis will:
- Show backend detection info
- Send 3 test notifications (basic, critical, callback)
- Take ~5 seconds to complete
Expected Output:
Testing OpenAdapt Notification System
============================================================
Backend: desktop-notifier
Notifier available: True
1. Sending basic notification...
Result: True
2. Sending critical notification...
Result: True
3. Sending notification with callback...
Result: True
============================================================
Summary:
Basic notification: PASS
Critical notification: PASS
Callback notification: PASS
All tests completed. Check Notification Center to see notifications!
What to verify:
- Check macOS Notification Center (top-right corner)
- You should see 3 notifications from "Python" or "OpenAdapt"
- Notifications should appear native (not terminal-based)
Run the interactive test to verify click callbacks:
.venv/bin/python test_notification.pyThis script will send notifications and wait for you to click them. Follow the on-screen instructions.
See all notification features in action:
.venv/bin/python examples/notification_examples.pyThis demonstrates 10 different notification patterns including callbacks, buttons, reply fields, etc.
-
Implementation:
src/openadapt_tray/notifications.py- Complete rewrite with desktop-notifier
-
Documentation:
NOTIFICATIONS.md- Comprehensive guideIMPLEMENTATION_SUMMARY.md- This implementation detailsREADME.md- Updated with new features
-
Examples:
examples/notification_examples.py- 10 usage examplestest_notification_simple.py- Quick testtest_notification.py- Interactive test
# See what changed
git status
# Review the main implementation
less src/openadapt_tray/notifications.py
# Read the documentation
less NOTIFICATIONS.md
# See the implementation summary
less IMPLEMENTATION_SUMMARY.mdcd /Users/abrichr/oa/src/openadapt-tray
# Add all changes except test files in root
git add src/ pyproject.toml README.md NOTIFICATIONS.md examples/ IMPLEMENTATION_SUMMARY.md uv.lock
# Commit with the prepared message
git commit -F COMMIT_MESSAGE.txt
# Clean up temporary files
rm COMMIT_MESSAGE.txt NEXT_STEPS.md
git add test_notification*.py # If you want to include test scripts# Review changes
git diff src/openadapt_tray/notifications.py
git diff src/openadapt_tray/app.py
# Stage files
git add src/openadapt_tray/notifications.py
git add src/openadapt_tray/app.py
git add pyproject.toml README.md
git add NOTIFICATIONS.md IMPLEMENTATION_SUMMARY.md
git add examples/
git add uv.lock
# Commit with your own message
git commit -m "feat: implement desktop-notifier notification system
[Your custom message]
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>"Essential files (must include):
src/openadapt_tray/notifications.py- Main implementationsrc/openadapt_tray/app.py- Cleanup integrationpyproject.toml- Dependency addeduv.lock- Dependency lock fileREADME.md- Updated docs
Documentation (highly recommended):
NOTIFICATIONS.md- User guideIMPLEMENTATION_SUMMARY.md- Implementation detailsexamples/notification_examples.py- Usage examplesexamples/README.md- Examples documentation
Test scripts (optional):
test_notification_simple.py- Quick testtest_notification.py- Interactive test
Temporary files (exclude from commit):
COMMIT_MESSAGE.txt- Remove after committingNEXT_STEPS.md- This file, remove after reading
cd /Users/abrichr/oa/src/openadapt-tray
.venv/bin/python -m openadapt_trayThe app will show notifications when:
- Recording starts
- Recording stops
- Training starts/completes
- Errors occur
- Captures are deleted
Trigger these by:
- Using the menu to start/stop recording
- Deleting a capture from the menu
- Testing various menu actions
Check that:
- Notifications appear in Notification Center
- They look native (not terminal/script-like)
- Clicking them doesn't cause errors
- Multiple notifications work correctly
-
Check backend:
.venv/bin/python -c "from openadapt_tray.notifications import NotificationManager; nm = NotificationManager(); print(f'Backend: {nm._backend}')"Should output:
Backend: desktop-notifier -
Check Python signing (macOS):
codesign -dv $(which python3)If unsigned, notifications may not appear. Use official python.org installer.
-
Check Notification Center settings:
- System Preferences → Notifications
- Find "Python" or "Terminal"
- Ensure notifications are enabled
If you see ImportError: No module named 'desktop_notifier':
cd /Users/abrichr/oa/src/openadapt-tray
uv sync
# or
.venv/bin/pip install desktop-notifierThis is expected in the quick test - callbacks only work when user actually clicks the notification. Try:
.venv/bin/python test_notification.py
# Then click the notification when promptedAll documentation is available:
- User Guide:
NOTIFICATIONS.md- How to use notifications - Implementation:
IMPLEMENTATION_SUMMARY.md- Technical details - Examples:
examples/notification_examples.py- Code examples - API Reference:
NOTIFICATIONS.md(API Reference section)
Read the docs:
# User guide
less NOTIFICATIONS.md
# Implementation details
less IMPLEMENTATION_SUMMARY.md
# Examples
python examples/notification_examples.pyAfter testing, consider:
-
Works great?
- Create PR with the commit
- Share testing results
-
Found issues?
- Document the issue
- Check NOTIFICATIONS.md troubleshooting section
- Check platform-specific notes
-
Want enhancements?
- See "Future Enhancements" in IMPLEMENTATION_SUMMARY.md
- Suggest additional features
# Test notifications
.venv/bin/python test_notification_simple.py
# Run examples
.venv/bin/python examples/notification_examples.py
# Run tray app
.venv/bin/python -m openadapt_tray
# Check backend
.venv/bin/python -c "from openadapt_tray.notifications import NotificationManager; print(NotificationManager()._backend)"
# Commit changes
git add src/ pyproject.toml README.md NOTIFICATIONS.md examples/ uv.lock
git commit -F COMMIT_MESSAGE.txt
# View documentation
less NOTIFICATIONS.mdYou now have:
- ✅ Modern notification system with desktop-notifier
- ✅ Backward compatible API
- ✅ Rich features (callbacks, urgency, buttons)
- ✅ Comprehensive documentation
- ✅ Working examples and tests
- ✅ Ready to commit
Next: Test → Commit → Integrate → Share!