Skip to content

Add Type (Primary) sort variant - #3028

Open
haganbmj wants to merge 1 commit into
dekkerglen:masterfrom
haganbmj:sort-type-primary
Open

haganbmj wants to merge 1 commit into
dekkerglen:masterfrom
haganbmj:sort-type-primary

Conversation

@haganbmj

@haganbmj haganbmj commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Tired of the repeated question of why "Type" causes duplicates, so this is just a stab at a possible way to make a more logical Type sort by defining an opinionated order of types and ensuring that each card only falls into the first one it matches.

Artifact Creature -> Creature
Enchantment Artifact -> Artifact

I'm using the existing type display order here, but that's possibly questionable because Land gets put near the end of that which might be more confusing to people that expect their Ancient Den or Dryad Arbor to show up under Lands..

If there's a desire to rank Lands higher, but still display them last, then it might be best to create a secondary ordinal list - one for display and one for sort.

Type sort labels a card with every one of its card types, so Legendary Artifact Creatures show up in three buckets and the group headers add up to more than the cube's card count -- users routinely misread this as a bug. Add a Type (Primary) variant that reuses Type's ranked label list (CARD_TYPES priority order followed by custom types alphabetical) but returns only the card's first-matching bucket, so every card lands in exactly one group and the buckets sum to the cube total. Contraption and Plane keep their existing single-label overrides.
@github-actions

Copy link
Copy Markdown

📊 Server Code Coverage Report

Metric Coverage % Coverage Raw Delta % Delta Raw
Lines 19.8% 3098/15640 +0.00% +0
Statements 19.34% 3201/16543 +0.00% +0
Functions 14.06% 366/2603 +0.00% +0
Branches 13.43% 1280/9530 +0.00% +0

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant