Skip to content

Add raycast-melange extension - #27734

Closed
seanwessmith wants to merge 3 commits into
raycast:mainfrom
seanwessmith:ext/raycast-melange
Closed

seanwessmith wants to merge 3 commits into
raycast:mainfrom
seanwessmith:ext/raycast-melange

Conversation

@seanwessmith

@seanwessmith seanwessmith commented May 8, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds Raycast Melange, a Raycast extension command for searching Anna's Archive for English EPUB results. The command ranks likely good matches, opens the slow-download page by default, and supports Anna's official member fast-download API when a secret key is configured in Raycast preferences.

Screenshot

A Raycast Window Capture screenshot is included in extensions/raycast-melange/metadata/search-epubs-1.png.

Checklist

@raycastbot raycastbot added new extension Label for PRs with new extensions platform: macOS labels May 8, 2026
@raycastbot

Copy link
Copy Markdown
Collaborator

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.

@seanwessmith
seanwessmith marked this pull request as ready for review May 8, 2026 16:58
@greptile-apps

greptile-apps Bot commented May 8, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a new raycast-melange extension for searching Anna's Archive for English EPUB files, with optional fast-download API support via a stored secret key. Most issues from earlier review rounds (missing metadata screenshot, unused @raycast/utils dependency, manual Preferences interface, Prettier config, ESLint config) have been addressed in this revision.

  • Scraping (annas.ts) uses cheerio, a 15 s AbortController timeout, and three-domain failover; the download path (download.ts) adds its own 120 s timeout that was previously missing.
  • Ranking is split across two layers (annas.ts scoreResult and fuzzy.ts getDownloadQuality), both penalizing non-fiction — authors should be aware that non-fiction search results will be systematically ranked lower.

Confidence Score: 5/5

Safe to merge; the extension is a new addition that does not touch existing extensions and all hard-blockers from prior review rounds have been fixed.

The changed code is well-structured and isolated to a new extension directory. Both fetch paths now carry abort/timeout guards, preference types use the auto-generated Preferences type, and previously flagged configuration files now match Raycast conventions. The only remaining note is a conservative double-filter on language that can reduce result count but cannot produce wrong results.

No files require special attention; the one open observation is in src/annas.ts around the client-side English language filter.

Important Files Changed

Filename Overview
extensions/raycast-melange/src/annas.ts Core scraping and API logic; well-structured with timeout guards, failover across domains, and proper error normalization. One concern: client-side isEnglishLanguage filter may drop books whose HTML omits a language tag even though the API was already called with lang=en.
extensions/raycast-melange/src/search-epubs.tsx Main command; uses auto-generated Preferences type correctly, debounces search, and implements a module-level promise cache with eviction. Pagination infrastructure present but effectively disabled by MAX_RESULT_PAGES = 1 — intentional.
extensions/raycast-melange/src/download.ts EPUB download logic; now includes a 120-second AbortController timeout, safe expandHome, and collision-avoidance via nextAvailablePath.
extensions/raycast-melange/src/fuzzy.ts Client-side re-ranking via fuzzy/token/Levenshtein scoring; logic is sound and handles undefined author fields safely.
extensions/raycast-melange/package.json Correct $schema, valid categories, proper preference types (password/directory), and previously-unused @raycast/utils has been removed. All declared dependencies are imported.
extensions/raycast-melange/eslint.config.mjs Now correctly uses defineConfig from eslint/config and extends @raycast/eslint-config — matches Raycast convention.
extensions/raycast-melange/.prettierrc Contains the required printWidth: 120 and singleQuote: false — matches Raycast standard.
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
extensions/raycast-melange/src/annas.ts:149-151
**Double language filter may silently drop English results**

The search request already sends `lang=en` to Anna's Archive, so the server should only return English records. This client-side `isEnglishLanguage` guard additionally requires the scraped HTML to expose a `[en]` language tag in the exact format matched by `/\[en\]/i`. When a record's metadata row doesn't render a parseable language tag (e.g., the site uses a different format, or the element is absent), `language` stays `undefined`, `isEnglishLanguage` returns `false`, and that book is silently removed from results — even though the server already confirmed it as English. Removing or relaxing this secondary filter would avoid false negatives without introducing non-English results.

Reviews (3): Last reviewed commit: "Add EPUB download timeout" | Re-trigger Greptile

Comment thread extensions/raycast-melange/.prettierrc Resolved
Comment thread extensions/raycast-melange/package.json Resolved
@0xdhrv 0xdhrv self-assigned this May 27, 2026

@0xdhrv 0xdhrv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution 

We already have an extension in the Store that deals with this. Could we consider enhancing the existing extension below instead of creating another one?

If there are unique features or workflows you’re aiming to add, we’d love to hear them and see if they can be integrated into this to avoid duplication and improve discoverability.

This would help avoid duplication and keep related functionality consolidated in one place.
As mentioned in our extension guidelines here

@0xdhrv
0xdhrv marked this pull request as draft May 27, 2026 11:30
@j3lte

j3lte commented May 27, 2026

Copy link
Copy Markdown
Contributor

Looking at this extension the thing that could be integrated in the existing extension would be the 'Dowload EPUB' functionality. My extension searches for everything, not just epubs. It opens the page instead of providing a way of directly downloading an epub

@seanwessmith

seanwessmith commented May 27, 2026 •

Copy link
Copy Markdown
Contributor Author

That makes sense. I’ll make a new PR enhancing the existing Anna’s Archive extension:

  • EPUB direct-download action for results where ext === "epub"
  • optional member secret-key preference for Anna’s fast-download API
  • optional download directory preference
  • slow-download page action
  • clean .epub filename handling

@seanwessmith

Copy link
Copy Markdown
Contributor Author

I opened the integration PR here: #28374

That PR enhances the existing Anna's Archive extension with the EPUB slow-download and optional fast-download actions while keeping the broader all-format search intact.

@0xdhrv

0xdhrv commented Jun 3, 2026

Copy link
Copy Markdown
Member

I opened the integration PR here: #28374

That PR enhances the existing Anna's Archive extension with the EPUB slow-download and optional fast-download actions while keeping the broader all-format search intact.

Thanks a lot!

@raycastbot

Copy link
Copy Markdown
Collaborator

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 😊

@raycastbot raycastbot added the status: stalled Stalled due inactivity label Jun 28, 2026
@raycastbot

Copy link
Copy Markdown
Collaborator

This pull request has been automatically closed due to inactivity.

Feel free to comment in the thread when you're ready to continue working on it 🙂

You can also catch us in Slack if you want to discuss this.

@raycastbot raycastbot closed this Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new extension Label for PRs with new extensions platform: macOS status: stalled Stalled due inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants