Deck importer improvements - Commander detection heuristic / misc fixes#9923
Open
MostCromulent wants to merge 5 commits intoCard-Forge:masterfrom
Open
Deck importer improvements - Commander detection heuristic / misc fixes#9923MostCromulent wants to merge 5 commits intoCard-Forge:masterfrom
MostCromulent wants to merge 5 commits intoCard-Forge:masterfrom
Conversation
- Add ? to card name regex (fixes cards like Continue?) - Strip Moxfield *F*/*E* foil/etched markers - Recognize Companion section header (maps to Sideboard) - Suppress ignorable sections (Maybeboard, Tokens, etc.) - Accept space separator in deck name lines (Name Turtle Power!) - Auto-detect Commander format from deck composition heuristic (98-102 singleton cards + blank-line commander separator) - Auto-detect Commander from explicit section headers in input - Auto-select Commander format in UI and switch editor on import Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
identifyCommanderFromBlankLineSeparator now returns whether it found a valid commander. commanderAutoDetected is only set on successful match, preventing Canadian Highlander and other 100-card singleton formats from triggering Commander format auto-selection. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Unrecognized section headers already become UNKNOWN_TEXT tokens which are not imported. Token cards don't exist in the card database so they fail recognition naturally. The added complexity isn't worth the minor cosmetic benefit of suppressing warnings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Several improvements to the deck importer:
Commander detection heuristics: Two-tier heuristic for automatically detecting and assigning to Commander format.
Commander,//Commander,CM:) - add Commander to allowed sectionsDeckSection.Commander.validate(). The blank-line heuristic guards against false positives on other 100-card singleton formats (e.g. Canadian Highlander) by requiring the trailing card(s) to be valid commander candidates (legendary creatures, eligible planeswalkers).Companion section: Map
Companionheader to Sideboard (Forge auto-detects companions at game start). Without this, companion cards fall into the preceding section (typically Commander), creating a bogus second commander.Card name regex: Added
?to support cards likeContinue?Foil/etched markers: Strip Moxfield
*F*/*E*suffixes so cards are recognizedDeck name with space separator: Accept
Name Turtle Power!formatKnown limitations
FDeckImportDialog) does not have format selection UI or editor switching. Commander cards are silently dropped when importing into a Constructed editor on mobile. This is a pre-existing limitation, not a regression.🤖 Generated with Claude Code