Skip to content

Update lotus-mtg-companion extension#28404

Open
EggsLeggs wants to merge 2 commits into
raycast:mainfrom
EggsLeggs:ext/lotus-mtg-companion
Open

Update lotus-mtg-companion extension#28404
EggsLeggs wants to merge 2 commits into
raycast:mainfrom
EggsLeggs:ext/lotus-mtg-companion

Conversation

@EggsLeggs
Copy link
Copy Markdown

@EggsLeggs EggsLeggs commented May 29, 2026

Description

Screencast

Checklist

- Merge branch \'contributions/merge-1780018344281\'
- Pull contributions
- chore: format CardDetail and add changelog for DFC fix
- Merge pull request raycast#2 from EggsLeggs/fix-card-detail-undefined-error
- fix: handle double-faced cards in CardDetail to prevent TypeError crash
- text: minor language update
- misc: update package-lock
- naming: update package.json name
- Merge branch \'main\' of https://github.com/MadMaxMcKinney/raycast-mtg-companion
- misc: minor text command update
- Update README.md
- readme: update with new content
- feat: add View all cards in set Action
- feat: add set search and produced_mana detail
- icon: new design, new name
- feat: improve recent card filtering
- command: add randomCard
- feature: added recent cards and more card data
- init commit
- Initial commit
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: lotus-mtg-companion Issues related to the lotus-mtg-companion extension platform: macOS labels May 29, 2026
@raycastbot
Copy link
Copy Markdown
Collaborator

raycastbot commented May 29, 2026

Thank you for your first contribution! 🎉

🔔 @MadMaxMcKinney you might want to have a look.

You can use this guide to learn how to check out the Pull Request locally in order to test it.

📋 Quick checkout commands
BRANCH="ext/lotus-mtg-companion"
FORK_URL="https://github.com/EggsLeggs/raycast-extensions.git"
EXTENSION_NAME="lotus-mtg-companion"
REPO_NAME="raycast-extensions"

git clone -n --depth=1 --filter=tree:0 -b $BRANCH $FORK_URL
cd $REPO_NAME
git sparse-checkout set --no-cone "extensions/$EXTENSION_NAME"
git checkout
cd "extensions/$EXTENSION_NAME"
npm install && npm run dev

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days.

@EggsLeggs EggsLeggs marked this pull request as ready for review May 29, 2026 01:38
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 29, 2026

Greptile Summary

This PR fixes a crash in the Card Detail view when opening double-faced MTG cards (e.g., transform/modal cards) by gracefully falling back to card_faces data when top-level fields like oracle_text, mana_cost, artist, and image_uris are absent.

  • CardDetail.tsx: Adds oracleText/flavorText computed values that fall back to per-face data, renders per-face mana costs and artists when the parent card fields are missing, and guards card.keywords against undefined.
  • types/index.ts: Correctly marks image_uris, mana_cost, oracle_text, keywords, and artist as optional to match the actual Scryfall API shape for double-faced cards.
  • util/index.ts: Tightens getCardImage with optional chaining on card_faces[0].image_uris to avoid a runtime crash.

Confidence Score: 5/5

The change is a targeted crash fix for double-faced cards with no new dependencies or API surface changes; all modifications are additive fallback logic.

All changes are defensive — optional chaining, null coalescing, and type corrections that bring the interface in line with the actual Scryfall API. No existing happy-path behavior is altered.

No files require special attention.

Important Files Changed

Filename Overview
extensions/lotus-mtg-companion/src/components/Details/CardDetail.tsx Added oracle text, flavor text, mana cost, and artist fallbacks that read from card_faces when the parent card fields are absent; also added card.keywords null guard.
extensions/lotus-mtg-companion/src/types/index.ts Made image_uris, mana_cost, oracle_text, keywords, and artist optional to correctly reflect the Scryfall API shape for double-faced cards.
extensions/lotus-mtg-companion/src/util/index.ts Fixed getCardImage to use optional chaining card.card_faces?.[0]?.image_uris before accessing .png, preventing a crash when face image URIs are absent.
extensions/lotus-mtg-companion/CHANGELOG.md Added a new [Bug Fix] - {PR_MERGE_DATE} entry at the top describing the double-faced card crash fix; placeholder is correctly used.
extensions/lotus-mtg-companion/package-lock.json Minor version downgrades across several dev-only packages (brace-expansion, minimatch, ajv, etc.), with license fields stripped; consistent with a fresh lockfile regeneration.

Reviews (2): Last reviewed commit: "Update extensions/lotus-mtg-companion/CH..." | Re-trigger Greptile

Comment thread extensions/lotus-mtg-companion/CHANGELOG.md Outdated
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@MadMaxMcKinney
Copy link
Copy Markdown
Contributor

Looks good, appreciate the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extension fix / improvement Label for PRs with extension's fix improvements extension: lotus-mtg-companion Issues related to the lotus-mtg-companion extension platform: macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants