Open
Conversation
…MLCanvasElement Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Polling-based Node.js worker that processes EPUB-to-XTC conversion jobs from SQLite. Uses CREngine WASM + node-canvas with the same rendering pipeline as the browser client. Adds tsx dependency for running TypeScript directly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ion and polling Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add 30-minute polling timeout to prevent infinite loops - Reset stuck 'processing' jobs on worker startup - Remove dead saveToLibrary callback - Fix Dockerfile to copy full node_modules (pnpm symlinks) - Add SQLite busy_timeout for concurrent access Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…on is server-side
…s bar, reduce toast noise
…shift, improve toast messages
- Move all job submission, polling, and tracking into ConversionProvider - DevicePreview and LibraryTab consume context directly via useConversion() - Remove activeJobs prop threading through Sidebar - Rename button to 'Convert', use refresh icon - Add 'Convert' option in library dropdown menu - Hide XTC badge when book is converting - Outline style for 'Send to device' toast action button
- GET /api/convert returns all active jobs with book titles - ConversionProvider fetches active jobs on mount and starts polling - Extracted shared startPolling helper to avoid duplication - Removed sessionStorage-based resume (server is source of truth) - Fixed completion toast to find the correct book by ID instead of list order
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
POST /api/convert/allendpoint for batch conversionArchitecture
src/worker/convert.ts) — standalone Node.js process that polls SQLite for pending jobs, loads CREngine WASM + node-canvas, renders pages, and saves XTC filesconversion_jobsSQLite table, shared between Next.js and the worker via WAL modePOST /api/convert(submit),GET /api/convert(list active),GET /api/convert/[jobId](poll),POST /api/convert/all(batch)Key changes
src/worker/convert.ts— standalone conversion workersrc/contexts/conversion-context.tsx— React context for job trackingsrc/lib/xtc-assembler.ts— extracted XTC binary assembly (shared by client + worker)src/lib/image-processing.ts— refactored to accept raw pixel data (no DOM dependency)src/lib/conversion-jobs.ts— job CRUD operationssrc/app/api/convert/— job submission, status polling, batch conversion endpointssrc/components/converter/— inline progress on Convert button, library badges, Convert allDockerfile— Cairo deps, worker process alongside Next.jspackage.json— addedcanvas,tsx,npm-run-all2;pnpm devstarts both processesTest plan
curl -X POST /api/convert/allworks from server side🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com