Architecture and data flow
Runtime components
Section titled “Runtime components”Background
Section titled “Background”src/background/index.ts is the coordinator:
- initializes settings on install
- reacts to bookmark creation events
- also reacts to bookmark removal, changes, and moves to keep the dashboard fresh
- handles runtime messages
- accepts review items and triggers reruns
- removes accepted or dismissed queue items instead of keeping them around
Content script
Section titled “Content script”src/content/index.ts extracts page title, meta description, excerpt, and optional full text from an open tab.
If no matching open tab can be queried, the pipeline falls back to fetching the bookmark URL.
- popup for quick status and reruns
- options page for the full dashboard
- dashboard widgets and modals for settings, root filters, delete actions, queue handling, and paginated event logs with AI details
Pipeline flow
Section titled “Pipeline flow”src/lib/pipeline.ts performs:
- settings load
- bookmark lookup
- structure snapshot load
- exclusion filtering
- preferred root derivation from the current bookmark path
- page snapshot extraction
- provider classification
- move or queue handling
Outcomes
Section titled “Outcomes”movedqueuedskippedfailed
Runtime messages
Section titled “Runtime messages”| Message | Purpose |
|---|---|
dashboard:get | load dashboard state |
settings:update | save settings |
bookmark:run | process one bookmark manually |
bookmark:delete | delete one bookmark |
queue:accept | apply a queued decision |
queue:dismiss | dismiss a queue item |
queue:rerun | rerun one queue item |
popup:current-tab | inspect the active tab |
options:open | open the options page |
content:extract | read page data from the content script |
Storage
Section titled “Storage”src/lib/storage.ts manages:
bookmark-sorter-settingsbookmark-sorter-review-queuebookmark-sorter-event-logbookmark-sorter-dashboard-revision
Recent events are stored as structured EventLogEntry objects, including optional AI request and response payloads.