feat: Add edge alert notifications to Synth Overlay extension#25
Merged
e35ventura merged 10 commits intoentrius:mainfrom Mar 9, 2026
Merged
Conversation
Closes entrius#17 Add browser notifications when edge on a watched Polymarket market exceeds a user-defined threshold. Users can monitor multiple markets and get notified without watching the side panel. Components: - alerts.js: SynthAlerts module (watchlist CRUD, threshold validation, cooldown management, shared storage schema) - background.js: alarm-based polling engine (chrome.alarms every 60s), notification dispatch with 5-min cooldown, suppression when user is on the market page, click-to-navigate handler - sidepanel UI: toggle, threshold input, watchlist with add/remove - manifest.json: notifications, storage, alarms permissions Edge cases handled: - Duplicate notification suppression (same notifId still showing) - Cooldown per market to prevent spam (5 min, persisted in storage) - Suppressed when user is already viewing that market - Watchlist capacity limit (20 markets) - Threshold validation and clamping (0.1-50 pp) - Service worker restart resilience (state in chrome.storage.local) - Graceful handling of API errors and unreachable server
…fresh - Add icon128.png and iconUrl property to chrome.notifications.create (required on Linux, was causing 'missing type, iconUrl, title, message' error) - Register icon in manifest.json - Set requireInteraction: true so notification stays until clicked - Call updateWatchBtnState() after currentSlug is set in refresh() (fixes '+ Watch this market' button staying disabled after data loads) - Add logging to notification click handler for debugging
Trigger instant poll when user switches to a non-Polymarket tab, so notifications fire within seconds of leaving the market page instead of waiting for the next 60s alarm cycle. Also poll immediately on any watchlist or settings change.
…nded icons - Generate branded icon set (16, 48, 128) with 'S' lettermark - Register all icon sizes in manifest + default_icon in action - Bump version to 1.3.0 - Add badge count on extension icon showing watched market count - Add notification history panel (last 10 alerts, viewable in side panel) - History live-updates when background fires a notification - Add auto-dismiss toggle (controls requireInteraction per user preference) - Add 12 new tests: history CRUD, auto-dismiss logic, badge count - Total: 132 tests passing (50 alert + 82 existing)
chrome.tabs.get doesn't expose url for chrome:// pages even with tabs permission. Previously the condition short-circuited and pollWatchlist was never called. Now treat missing url as non-Polymarket and poll immediately.
Contributor
Author
|
@e35ventura can you please review the PR and let me know your feedback? |
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add edge alert notifications to the Synth Overlay extension. Users can watch markets and get browser notifications when the edge crosses their threshold — turning the overlay from a passive viewer into an active opportunity scanner.
Closes #17
Demo Video
📹 Demo video
Key Changes
extension/alerts.js(new)SynthAlertsmodule — watchlist CRUD, threshold validation, cooldown management, notification history, auto-dismiss setting, sharedchrome.storage.localschemaextension/background.jschrome.alarms(60s), immediate poll on tab switch, notification dispatch with 5-min cooldown, suppression logic, click-to-navigate handler, badge count, notification history persistenceextension/sidepanel.jsrenderWatchlist,updateWatchBtnState,renderHistory,initAlertsUI, auto-dismiss toggle, live history updates viachrome.storage.onChangedextension/sidepanel.htmlextension/sidepanel.cssextension/manifest.jsonnotifications,storage,alarmspermissions; version 1.3.0; registered all icon sizes withdefault_iconextension/icon{16,48,128}.png(new)tests/test_alerts.py(new)README.mdRelated Issues
Closes #17
How It Works
chrome.alarmschrome.storage.local— survives service worker restartsEdge Cases Handled
iconUrlrequired forchrome.notifications.createon all platformsType of Change
Testing
python3 -m pytest tools/synth-overlay/tests/ -v # 132 passed (82 existing + 50 new)Checklist