Skip to content

Add scrycast extension - #26839

Merged
raycastbot merged 11 commits into
raycast:mainfrom
aayushpi:ext/scrycast
May 11, 2026
Merged

raycastbot merged 11 commits into
raycast:mainfrom
aayushpi:ext/scrycast

Conversation

@aayushpi

@aayushpi aayushpi commented Apr 1, 2026 •

Copy link
Copy Markdown
Contributor

Description

A lil extension to search for Magic: The Gathering cards on Scryfall and on a personal collection

Screen

Screen.Recording.2026-04-01.at.4.57.00.PM.mov

Checklist

- prep for publishing
- personal collection
- fix recent search
- Merge pull request raycast#2 from aayushpi/feat/search-history
- Add search history with save-on-card-open trigger
- Merge pull request raycast#1 from aayushpi/feat/search-debounce
- add debounce
- all prints
- saved cards
- more updates
- Update index.tsx
- nit
- init
@raycastbot raycastbot added the new extension Label for PRs with new extensions label Apr 1, 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.

@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 Apr 17, 2026
- Add Browse Decks command, DFC flip, PNG images, and cross-deck search
- Merge pull request raycast#3 from aayushpi/feature/browse-sets
- Add Browse by Set command with background cover fetching and set card views
- Fix all lint warnings: suppress EDHRec title case rule, fix Prettier
- Fix TS2322: cast searchTagTarget result to ReactNode for CI compatibility
- Fix Prettier formatting in card-views.tsx
- Fix CI TS2322: dedupe @types/react via npm overrides
@raycastbot raycastbot removed the status: stalled Stalled due inactivity label Apr 21, 2026
@aayushpi
aayushpi marked this pull request as ready for review April 21, 2026 08:58
@greptile-apps

greptile-apps Bot commented Apr 21, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR introduces the Scrycast extension, a full-featured Magic: The Gathering card browser built on top of the Scryfall API. It adds five commands: Scryfall card search, bookmarked cards, personal ManaBox collection import/browse, set browser with background cover-art loading, and a deck browser supporting Moxfield, Archidekt, and pasted deck lists.

  • All shared types and utilities are properly centralised in shared.tsx with no duplication across files; the module-level cover-fetcher.ts pattern correctly avoids stale React closures during background fetching.
  • The ManaBox CSV parser handles RFC 4180 quoting, foil counts, and set-count stats; the collection browse intentionally caps at 75 cards (noted in the UI) and search is bounded to Scryfall page 1 results.
  • package.json lists both "Fun" and "Other" categories; Other should be removed since Fun already covers the extension's purpose.

Confidence Score: 5/5

Safe to merge after removing the redundant Other category entry from package.json.

The extension is well-structured with centralised shared types, documented design trade-offs, and no logic bugs. The only finding is a minor category configuration issue that does not affect functionality.

extensions/scrycast/package.json — redundant Other category entry.

Important Files Changed

Filename Overview
extensions/scrycast/package.json Well-formed extension manifest with $schema, correct {PR_MERGE_DATE}-compatible structure, macOS-only platform, and correct Prettier config; minor issue with redundant Other category alongside Fun.
extensions/scrycast/src/shared.tsx Centralised types, helpers, and Scryfall Tagger CSRF-scrape logic. Types are cleanly defined, isFlippable/getCardImageUri handle DFC edge cases correctly, and the tagger flow is intentionally fragile with clear logging.
extensions/scrycast/src/browse-decks.tsx Large command handling Moxfield/Archidekt/text deck imports. URL parsing, card fetching, and deck backfill logic are solid; upsertDeck and the remove handlers read decks from closure rather than a functional updater.
extensions/scrycast/src/collection.ts RFC 4180-compliant CSV parser for ManaBox exports; correctly tracks total copies vs. unique entries, foil counts, and set count.
extensions/scrycast/src/my-collection.tsx Collection import/browse/search command. Intentionally limits browse to first 75 IDs with a clear subtitle note.
extensions/scrycast/src/cover-fetcher.ts Module-level background cover-art fetcher with rate-limit handling, cancel-and-retry on filter switch, and pause/resume support.
extensions/scrycast/src/set-cards-view.tsx Fetches all pages of a set in parallel after page 1, with per-page 429 retry, local cache for released sets, and cover-fetch pause/resume integration.
extensions/scrycast/src/search-view.tsx Main Scryfall search command with history, multi-select, sort order, DFC flip, and collection/bookmark indicators.
extensions/scrycast/src/card-views.tsx Reusable CardDetailView, CardTagsView, PrintsView, and CardActions components with clean shared-state access.
extensions/scrycast/src/saved-cards.tsx Bookmarked cards grid with collection membership indicators, bulk copy, and CardActions reuse.
extensions/scrycast/src/browse-sets.tsx Set grid with filter dropdown, background cover art loading, and persistedCardsRef pattern to avoid stale closures.
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/scrycast/package.json:55-58
**`"Other"` category is redundant alongside `"Fun"`**

The `Other` category is reserved for extensions that don't fit any predefined category. Since this extension already maps cleanly to `Fun`, including `Other` alongside it is a violation of the category guidelines. Remove `"Other"` and keep just `["Fun"]`.

Reviews (5): Last reviewed commit: "Update CHANGELOG.md, add platforms field..." | Re-trigger Greptile

Comment thread extensions/scrycast/CHANGELOG.md Resolved
Comment thread extensions/scrycast/src/collection.ts Resolved
Comment thread extensions/scrycast/src/search-view.tsx Resolved
@aayushpi

Copy link
Copy Markdown
Contributor Author

All of these changes have been made in new version

Greptile Summary

This PR adds a full-featured Magic: The Gathering extension (Scrycast) with Scryfall card search, bookmarks, ManaBox collection import, set browsing with cover-art prefetching, and deck management from Moxfield/Archidekt/plain-text lists. The implementation is well-structured overall, but there is one P1 defect in browse-decks.tsx where the URL validation error message references only Archidekt even though Moxfield URLs are also accepted, which will actively mislead users with Moxfield URLs.

  • browse-decks.tsx line 371: URL error message says "Enter a valid Archidekt URL" despite Moxfield being a supported source — fix to mention both.
  • search-view.tsx and my-collection.tsx re-declare Card, ImageUris, and several helpers that are already exported from shared.tsx; consolidating these would prevent future drift.

Confidence Score: 4/5

Safe to merge after fixing the Moxfield URL error message; all other findings are style/cleanup suggestions.

One P1 issue: the AddDeckForm error message references only Archidekt when the field also accepts Moxfield URLs, actively misleading users. Remaining findings (CHANGELOG title, dead export, duplicated types) are P2 and do not block correct behavior.

extensions/scrycast/src/browse-decks.tsx (P1 error message bug)

Important Files Changed

Filename Overview
extensions/scrycast/src/browse-decks.tsx Adds deck browsing with Moxfield/Archidekt/text import; contains a P1 bug where the URL validation error message only mentions Archidekt despite Moxfield also being supported.
extensions/scrycast/src/search-view.tsx Main search command with grid display, history, multi-select, and collection indicators; duplicates type definitions and helpers that are already exported from shared.tsx.
extensions/scrycast/src/my-collection.tsx ManaBox CSV import and collection grid; duplicates Card, ImageUris, and helper functions that already exist in shared.tsx.
extensions/scrycast/src/collection.ts CSV parsing logic; exports parseCollectionCSV which is unused (only parseCollectionCSVWithStats is consumed by my-collection.tsx).
extensions/scrycast/src/card-views.tsx Shared CardTagsView, PrintsView, and CardDetailView components; imports cleanly from shared.tsx.
extensions/scrycast/src/cover-fetcher.ts Module-level background cover-fetching loop with cancellation, rate-limit back-off, and pause/resume; well-structured.
extensions/scrycast/src/browse-sets.tsx Set-browsing grid with background cover fetching and persistence; integrates correctly with cover-fetcher module.
extensions/scrycast/src/saved-cards.tsx Bookmarked cards grid; correctly imports from shared.tsx, no issues found.
extensions/scrycast/CHANGELOG.md Uses [Unreleased] label instead of a descriptive title per Raycast changelog convention.
extensions/scrycast/package.json Well-formed package.json with $schema, correct categories (Fun, Other), and all dependencies used.
extensions/scrycast/.prettierrc Correct Raycast standard Prettier config (printWidth: 120, singleQuote: false).
Prompt To Fix All With AI

This is a comment left during a code review.
Path: extensions/scrycast/src/browse-decks.tsx
Line: 369-373

Comment:
**Incorrect error message for Moxfield URLs**

The error message only references Archidekt, but the form also accepts Moxfield URLs. A user who enters a valid Moxfield URL with a typo or unsupported path will see a confusing message.

```suggestion
        setUrlError("Enter a valid Moxfield or Archidekt URL (e.g. moxfield.com/decks/… or archidekt.com/decks/…)");

How can I resolve this? If you propose a fix, please make it concise.


This is a comment left during a code review.
Path: extensions/scrycast/CHANGELOG.md
Line: 1

Comment:
[Unreleased] is not the standard Raycast changelog title

Raycast changelog convention uses a descriptive title, not [Unreleased]. This entry represents the changes being shipped in this PR.

## [Added Collection & Deck Features] - {PR_MERGE_DATE}

Rule Used: What: Changelog entries must use {PR_MERGE_DATE}... (source)

How can I resolve this? If you propose a fix, please make it concise.


This is a comment left during a code review.
Path: extensions/scrycast/src/collection.ts
Line: 43-69

Comment:
parseCollectionCSV is exported but never imported

Only parseCollectionCSVWithStats is used in my-collection.tsx. This dead export adds confusion about which function callers should use. Consider removing it or marking it internal.

How can I resolve this? If you propose a fix, please make it concise.


This is a comment left during a code review.
Path: extensions/scrycast/src/search-view.tsx
Line: 12-67

Comment:
Duplicate type definitions already exported from shared.tsx

Card, ImageUris, CardFace, ScryfallSearchResponse, SortOrder, and helper functions (getCardImageUri, sortCards, copyCardImage, scryfallMultiUrl, getEdhrecUrl, FEEDBACK_URL, SAVED_CARDS_KEY) are all re-defined here, even though identical counterparts are exported from ./shared. The same duplication exists in my-collection.tsx. Using the shared exports would eliminate drift risk and reduce bundle size.

How can I resolve this? If you propose a fix, please make it concise.


Reviews (1): Last reviewed commit: ["Update scrycast extension"](https://github.com/raycast/extensions/commit/acd95b06f961d7769dffb627e6ffebcecca9e288) | [Re-trigger Greptile](https://app.greptile.com/api/retrigger?id=29102079)

@aayushpi
aayushpi marked this pull request as draft April 21, 2026 09:19
@aayushpi
aayushpi marked this pull request as ready for review April 21, 2026 09:19
@aayushpi

aayushpi commented Apr 21, 2026 •

Copy link
Copy Markdown
Contributor Author
  • uniqueCards stat is wrong in collection.ts: ids.length counts total rows (including duplicate entries per quantity), not distinct cards — the displayed stat will be inflated for collections with multiple copies.

This is intended behavior as unique prints are counted differently and should be expected behavior

@0xdhrv 0xdhrv self-assigned this Apr 22, 2026
"title": "Search Cards",
"subtitle": "Search cards on Scryfall",
"description": "Search cards on Scryfall",
"mode": "view"

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.

issue: missing metadata images

Could you add at least one screenshot of the extension and add them to a folder called metadata - you need to use our tool to get the right padding on the images

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi there! Thank you for the review. I have added screenshots to the folder!

@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.

Hey @aayushpi 👋

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 😊

@0xdhrv
0xdhrv marked this pull request as draft April 22, 2026 11:34
- added metadata
- P2: remove duplicate types and helpers, import from shared
@aayushpi

Copy link
Copy Markdown
Contributor Author

Hey @aayushpi 👋

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 😊

Thank you for the review! I have added screenshots to the folder!

@aayushpi
aayushpi requested a review from 0xdhrv April 22, 2026 17:01
@aayushpi
aayushpi marked this pull request as ready for review April 22, 2026 17:01

@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 @aayushpi 🔥

I missed this, can you please take a look at this?

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 ↗

@aayushpi

aayushpi commented Apr 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for your contribution @aayushpi 🔥

I missed this, can you please take a look at this?

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 ↗

Hi @0xdhrv , I considered this. This extension is similar on the face but this one is suited towards collection management and is architecturally quite different. Offering storage and looking up 1000s of cards would break the simplicity of the app.

Screenshot 2026-04-24 at 4 05 56 PM

This is more akin to how there are different services for Google Drive: this one has a more collection oriented nature of the app.

@aayushpi

Copy link
Copy Markdown
Contributor Author

@0xdhrv Hi Dhruv, any thoughts on this?

- Add *.pdf to .gitignore
- Fix Prettier formatting in search-view and set-cards-view
- Refactor: extract shared constants/helpers, add CardActions, fix DFC flip visibility
shortcut={{ modifiers: ["cmd"], key: "return" }}
/>
<Action.OpenInBrowser
title="Open in Edhrec" // eslint-disable-line @raycast/prefer-title-case

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Stale decks closure in backfill effect can drop newly-added decks

The async backfill captures decks from the effect's closure (bound at the time the effect fires). If the user adds or removes a deck while the network fetches are in-flight, the final setDecks(...) call spreads the stale snapshot and overwrites the updated list, silently losing any deck that was added in the meantime.

Use a functional update so setDecks always operates on the latest storage value:

Suggested change
title="Open in Edhrec" // eslint-disable-line @raycast/prefer-title-case
if (updated.length) {
setDecks((current) => (current ?? []).map((d) => updated.find((u) => u.id === d.id) ?? d));
}
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/scrycast/src/browse-decks.tsx
Line: 820

Comment:
**Stale `decks` closure in backfill effect can drop newly-added decks**

The async backfill captures `decks` from the effect's closure (bound at the time the effect fires). If the user adds or removes a deck while the network fetches are in-flight, the final `setDecks(...)` call spreads the stale snapshot and overwrites the updated list, silently losing any deck that was added in the meantime.

Use a functional update so `setDecks` always operates on the latest storage value:

```suggestion
      if (updated.length) {
        setDecks((current) => (current ?? []).map((d) => updated.find((u) => u.id === d.id) ?? d));
      }
```

How can I resolve this? If you propose a fix, please make it concise.

@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.

Looks good to me, approved ✅

@raycastbot
raycastbot merged commit 72f496b into raycast:main May 11, 2026
3 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

@raycastbot

Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

Such a great contribution deserves a reward, but unfortunately we couldn't find your Raycast account based on your GitHub username (@aayushpi).

Please link your GitHub account to your Raycast account to receive your credits and soon be able to exchange them for some swag.

@aayushpi
aayushpi deleted the ext/scrycast branch June 25, 2026 17:29
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants