Add calibre-search extension#27295
Conversation
- Apply Prettier formatting to all source files - Add ESLint flat config and remove unused import for store validation - Add store screenshots and fix author handle for Raycast Store submission - Add README with commands, configuration, and installation instructions - Exclude CLAUDE.md from version control - Add "Add to Calibre Library" command and fix open-in-Calibre navigation - Initial release: Calibre Library Raycast extension
|
Congratulations on your new Raycast extension! 🚀 We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days. Once the PR is approved and merged, the extension will be available on our Store. |
Greptile SummaryThis PR adds a new
Confidence Score: 4/5Safe to merge after addressing the synchronous scan and unbounded thumbnail spawning in the Add command; the Search command is clean. The core logic — SQL query, row mapping, calibredb invocation, EPUB cover extraction — is correct and well-tested. The two concerns in add-to-library.tsx (blocking useMemo scan and spawning a process per ebook on mount) are performance/UX issues rather than correctness failures, but they can make the Add command feel frozen or unresponsive on first load with a populated Downloads folder. extensions/calibre-search/src/add-to-library.tsx — the synchronous directory scan inside useMemo and the unbounded concurrent thumbnail process spawning both warrant a second look before merging. Important Files Changed
Prompt To Fix All With AIFix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
extensions/calibre-search/src/add-to-library.tsx:237-246
**Unbounded concurrent thumbnail processes on load**
`useEffect` calls `loadThumbnail` for every ebook simultaneously. Each uncached EPUB spawns a `unzip` process, and each uncached PDF/other spawns a `qlmanage` process. On a first load of a Downloads folder that contains 50+ ebooks, this creates a burst of 50+ concurrent child processes at once, which can spike CPU and memory noticeably. Consider processing thumbnails lazily (only for the currently-visible items) or batching them through a small concurrency pool.
### Issue 2 of 2
extensions/calibre-search/src/add-to-library.tsx:221-226
**Synchronous blocking I/O inside `useMemo`**
`useMemo` runs synchronously during React's render phase. `scanDirectories` calls `readdirSync` and `statSync` on every file in each configured directory — also synchronously. For a Downloads folder with hundreds of mixed files, this blocks the React render thread until all `stat` calls complete, causing a noticeable freeze on mount. Moving the scan into a `useEffect` + `useState` pair (or using `useAsync` from `@raycast/utils`) keeps the UI responsive while the scan runs.
Reviews (3): Last reviewed commit: "Fix author name truncation and align ext..." | Re-trigger Greptile |
- Update build artifacts - Address Raycast store review feedback
|
Addressed all Greptile feedback: replaced spawnSync with async execFileAsync, added error handler on qlmanage, removed manual Preferences interface, fixed eslint.config.js, Title Case on preference titles, and {PR_MERGE_DATE} in CHANGELOG. |
|
This pull request has been automatically marked as stale because it did not have any recent activity. It will be closed if no further activity occurs in the next 7 days to keep our backlog clean 😊 |
|
All feedback from the Greptile review has been addressed in commit 4580d07:
Would appreciate a re-review when time allows. Thanks! |
0xdhrv
left a comment
There was a problem hiding this comment.
Hey @BrunoMiguelMonteiro 👋
I have added a comment for you to address.
I'm looking forward to testing this extension again 🔥
Feel free to contact me here or at Slack if you have any questions.
I converted this PR into a draft until it's ready for the review, please press the button Ready for review when it's ready and we'll have a look 😊
| @@ -0,0 +1,89 @@ | |||
| { | |||
| "$schema": "https://www.raycast.com/schemas/extension.json", | |||
| "name": "calibre-search", | |||
There was a problem hiding this comment.
suggestion: better to match with title
There was a problem hiding this comment.
Hi @0xdhrv
I have corrected the name. Thanks for pointing that out! ;)
GROUP_CONCAT(DISTINCT x, separator) is invalid SQLite syntax. Drop DISTINCT (redundant given Calibre's normalised schema) and use ' & ' as separator so "Last, First" author names (e.g. "Tolkien, J.R.R.") are no longer truncated to just the surname when split. Also renames extension slug from calibre-search to calibre-library to match the display title, per store review feedback. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Description
Screencast
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder