Skip to content

Add a Chrome extension for capturing research into Inbox - #16

Merged
ThePyProgrammer merged 8 commits into
mainfrom
feat/chrome-inbox-extension
Nov 29, 2026
Merged

ThePyProgrammer merged 8 commits into
mainfrom
feat/chrome-inbox-extension

Conversation

@ThePyProgrammer

Copy link
Copy Markdown
Owner

Summary

Add an unpacked Manifest V3 Chrome extension that saves research found while browsing directly to Inbox in a selected ResearchOS library. A DOI, paper page, website, or GitHub repository can be captured without opening Quick Add in the app. Imports reuse the existing backend pipeline, metadata lookup, and duplicate handling.

The popup reuses the ResearchOS color palette and theme provider, including light, dark, and system modes. Import results appear in the popup; persistent global ✓ and = toolbar badges have been removed because they did not describe the current page.

Screenshots

Actual extension UI captured in Chromium against a local demo backend. Identifiers and library names are test fixtures; no private library data is included.

Light mode Dark mode
ResearchOS extension in light mode ResearchOS extension in dark mode

Changes

  • Capture and detection: Prefill from the current tab, explicit scholarly metadata, or selected identifier. Accept pasted DOIs, arXiv IDs, and HTTP/HTTPS URLs. Recognize DOI/arXiv, OpenReview, Zenodo, PDF, and GitHub links, with manual Paper, Website, and GitHub overrides.
  • Destination and imports: Choose a library and create new items with Inbox status through the existing paper, website, and GitHub import endpoints. Metadata fetching and supported paper PDF downloads remain backend responsibilities. Duplicate results link to the existing item and keep its reading status.
  • Background saves: Keep normal imports running after the popup closes. Persist results and five recent captures locally, show the latest three, prevent concurrent saves, and never automatically replay a write when its outcome is uncertain.
  • Connections and permissions: Configure backend and app URLs for local or hosted instances. Request access to the configured server at connection time. Use activeTab, scripting, and storage without permanently reading all browsing activity or putting database credentials into the extension.
  • App styling and controls: Share the app palette and theme provider; persist the extension's theme independently. Include a toolbar icon, Alt+Shift+S shortcut, result links, connection settings, and library refresh.
  • Library correctness: Scope website/repository URL duplicate lookups to the selected library. Migration 038 replaces global GitHub URL uniqueness with library-specific uniqueness and preserves duplicate protection for legacy rows without a library. Update the fresh-install schema too.
  • Build, tests, and CI: Add npm run build:extension, a dedicated Chromium integration test, unit/UI tests, disposable PostgreSQL checks, and CI steps for the extension build and browser flow.
  • Documentation: Add setup, capabilities, permissions, failure recovery, screenshots, and a list of potential future additions in the extension README.

What is supported now

Task Behavior
Save a paper or DOI Detect or paste a supported identifier/link; import through the paper endpoint.
Save a website Import its URL and metadata as a website item.
Save a GitHub repository Normalize a repository/subpage URL and import repository metadata.
Choose a library New items go to that library's Inbox.
Revisit a duplicate Open the existing item without changing its reading status.
Switch appearance Light, dark, and system preferences use the app's color tokens.
Close the popup mid-import The background worker normally completes the import and stores its result.

This release depends on a running ResearchOS backend. It does not implement full-page snapshots, local PDF file upload, offline synchronization, multiple saved server profiles, or login/token integration for protected deployments. Paper/PDF capture has the same resolution and download limits as the existing import pipeline. Requests time out after 25 seconds; an interrupted save can have an uncertain outcome, so users are told to check Inbox before retrying. The extension is loaded unpacked; store publication is outside this PR.

Potential future additions

These are documented ideas, not implemented features or delivery commitments:

  1. Right-click capture for a page, link, or selected DOI.
  2. Collection selection, tags, and capture notes during import.
  3. Batch capture from selected tabs, bookmarks, or pasted identifier lists, with per-item results.
  4. Local/already-open PDF attachment uploads through the app's PDF workflow.
  5. An offline queue backed by idempotency or reconciliation before retrying writes.
  6. Full-page snapshots, article text, highlights, and provenance.
  7. Authenticated deployments and multiple workspace/server profiles.
  8. More publisher-specific metadata adapters and fixtures.
  9. Library-aware saved status for the current page, using a read-only lookup rather than the last import's global status.
  10. Backend import jobs and progress polling for slow metadata/PDF work.
  11. Verified Firefox and Edge packages.
  12. Versioned release archives and Chrome Web Store distribution.

The README records the implementation considerations for each idea.

Setup and database change

  1. Existing databases: run backend/migrations/038_library_scoped_github_urls.sql in Supabase and restart the backend. Fresh schema.sql installations already contain the corrected indexes. This PR does not apply migrations to a live database.
  2. From frontend, run npm ci and npm run build:extension.
  3. Open chrome://extensions, enable Developer mode, and load frontend/extension/dist unpacked.
  4. Connect to the backend and app (defaults http://localhost:8000 and http://localhost:5173), allow the server permission, and choose a library.

No existing API endpoint or request/response shape is replaced. The database change allows the same GitHub repository to be imported independently into multiple libraries while retaining duplicate prevention within each library.

Type of change

  • New feature
  • Bug fix
  • Documentation
  • Tests and CI

Testing

  • All 446 frontend unit/UI tests passed with TZ=UTC. The existing dashboard chart test assumes UTC; it fails under the local America/New_York timezone and passes in UTC.
  • All 41 extension unit/UI tests passed after removing persistent badges.
  • All 16 targeted backend tests passed: import library scope, service behaviors, and paper routes. The full backend suite was not run for this work.
  • Existing citation SQL checks passed in disposable PostgreSQL.
  • Migration 038 checks passed: cross-library imports, same-library rejection, legacy unscoped rows, and safe replay.
  • The regular frontend and the Chrome extension production builds passed.
  • The unpacked Chromium extension test passed again for this PR preparation: connection, actual script injection, all three import types, library selection, duplicates, and theme persistence. It also produced the screenshots above.
  • The full existing app E2E smoke suite was not run locally for this work; CI retains it and adds the dedicated extension test.

The browser test uses a disposable mock API and grants only its loopback host in a disposable manifest copy. It does not contact the user's database or automate Chrome's native optional-permission dialog; the shipped manifest keeps server access optional, and the popup permission request is covered by unit tests. Light and dark screenshots were visually inspected.

Review notes

  • Commits separate the backend fix, source detection, background imports, popup/build, browser tests, CI, original documentation, and this capabilities/screenshots update.
  • No new npm dependencies, environment variables, or API models are introduced.
  • Database access remains in backend services; the extension never talks directly to Supabase.

Pass the destination library through URL duplicate lookups and replace the global GitHub URL index with per-library uniqueness. Preserve duplicate protection for legacy unscoped rows and cover migration replay and import routing.
Recognize DOI, arXiv, OpenReview, Zenodo, PDF, website, and GitHub sources. Read explicit scholarly metadata or selected identifiers from the active tab, validate URLs, and construct existing ResearchOS import requests. Cover detection and restricted-page fallbacks.
Connect to a user-selected backend, validate destination libraries, and save through existing import endpoints. Persist results and recent captures, reject concurrent writes, and recover interrupted saves without replaying them. Keep import feedback in the popup and clear legacy toolbar badges.
Package a Manifest V3 extension with optional server permissions and a keyboard shortcut. Reuse the ResearchOS palette and theme provider for light, dark, and system modes. Add connection settings, editable capture input, type overrides, library selection, and result feedback with popup interaction tests.
Load a disposable extension copy against a local mock API. Exercise connection setup, script injection, all three import types, destination libraries, duplicate feedback, and theme persistence. Add a dedicated Playwright configuration and build-before-test scripts.
Run disposable PostgreSQL checks for migration 038, build the Chrome package alongside the frontend, and exercise the unpacked extension with the existing Playwright CI browser.
Document unpacked installation, backend connection, migration 038, type overrides, keyboard shortcuts, and theme preferences. Explain permissions, uncertain saves, popup-only result feedback, and local validation commands.
Show actual light and dark popup screenshots using demo data. Document the current feature boundaries and twelve potential additions with implementation considerations. Disable screenshot animations in the Chromium flow so theme previews capture final colors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant