Skip to content

Architecture and data flow

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

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

src/lib/pipeline.ts performs:

  1. settings load
  2. bookmark lookup
  3. structure snapshot load
  4. exclusion filtering
  5. preferred root derivation from the current bookmark path
  6. page snapshot extraction
  7. provider classification
  8. move or queue handling
  • moved
  • queued
  • skipped
  • failed
MessagePurpose
dashboard:getload dashboard state
settings:updatesave settings
bookmark:runprocess one bookmark manually
bookmark:deletedelete one bookmark
queue:acceptapply a queued decision
queue:dismissdismiss a queue item
queue:rerunrerun one queue item
popup:current-tabinspect the active tab
options:openopen the options page
content:extractread page data from the content script

src/lib/storage.ts manages:

  • bookmark-sorter-settings
  • bookmark-sorter-review-queue
  • bookmark-sorter-event-log
  • bookmark-sorter-dashboard-revision

Recent events are stored as structured EventLogEntry objects, including optional AI request and response payloads.