Skip to content

fix(electron): resolve preload bridge, sqlite native binding, and mount ingest modal - #55

Merged
dkritarth merged 1 commit into
masterfrom
fix/electron-boot-sqlite-ingest
Sep 12, 2026
Merged

fix(electron): resolve preload bridge, sqlite native binding, and mount ingest modal#55
dkritarth merged 1 commit into
masterfrom
fix/electron-boot-sqlite-ingest

Conversation

@dkritarth

Copy link
Copy Markdown
Owner

User outcome

Users can launch the Electron app in development (npm run dev) or production build, initialize and query the local SQLite database without crashes, and click "Create" in the sidebar to open the paper ingest modal and import research papers.

Acceptance criteria

  • Electron main process successfully locates the compiled preload bridge (preload.mjs / index.js).
  • Preload script sets up context-isolated window.vellum bridge and renderer can communicate over IPC without errors.
  • better-sqlite3 native addon loads without ABI or Node-API version errors on both Electron and Node test environments.
  • Sidebar "Create" item triggers the IngestModal, allowing users to enter a DOI/URL/arXiv identifier and ingest papers directly into the active workspace.
  • Ingested papers automatically open in new tabs in the workspace.

Automated verification

Ran the complete test suite:

npm test
Test Files  25 passed (25)
     Tests  153 passed (153)

Ran production build:

npm run build
✓ built in 4.00s

Live Electron verification

Launched Electron in headless display environment with Playwright and verified:

  • Window loads and renders UI cleanly
  • Renderer invokes window.vellum.listPapers() over IPC bridge
  • SQLite responds with [] papers table query without any segfault or IPC failure
  • Verified IPC roundtrip and process exit code 0

Visual and console evidence

  • Console logs during live run:
Launching Electron...
calling listPapers via evaluate...
listPapers result: []
  • Vitest 153/153 tests passing across all suites including Reader, AskPanel, IngestModal, and Library.

Limitations and follow-ups

  • Follow-up PRs will integrate Collections, Chats, and Trash views in the Library.
  • Multi-platform packaging for Windows and macOS can bundle their respective native bindings.

Independent review

All changes respect the strict storage split (SQLite for state, filesystem for paper bytes) and maintain context isolation in Electron.

Closes #51
Related: #52, #53

…and mount IngestModal

- electron/main.ts: resolve preload whether building to .mjs or .js
- electron.vite.config.ts: output CommonJS index.cjs for main and externalize dependencies cleanly
- core/store/db.ts: resolve Electron-specific native addon when running in Electron runtime, maintaining compatibility with Node test runtime
- src/app/App.tsx: mount IngestModal on Sidebar 'Create' action and auto-open paper upon ingest
- tests: full vitest suite passing (153/153) and verified with Playwright live Electron harness

Closes #51
Closes #52
Closes #53
@dkritarth
dkritarth merged commit f3eea77 into master Sep 12, 2026
1 check passed
@dkritarth
dkritarth deleted the fix/electron-boot-sqlite-ingest branch September 12, 2026 15:08
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.

[S0-AUDIT] Electron dev boot cannot load preload bridge

1 participant