Skip to content

sort cards whose names exactly match the search query#3108

Merged
mercury233 merged 1 commit into
Fluorohydride:masterfrom
mercury233:patch-exact-match-sort
Jun 19, 2026
Merged

sort cards whose names exactly match the search query#3108
mercury233 merged 1 commit into
Fluorohydride:masterfrom
mercury233:patch-exact-match-sort

Conversation

@mercury233

Copy link
Copy Markdown
Collaborator

Currently, cards whose names exactly match the search query are moved to the front. However, the processing order may default to ID order, causing alternate-art cards to be handled last and finally making an alternate-art card always appear first.

This change adds a secondary sort to reorder the exact-match cards by ID, ensuring they are displayed in the correct order.

Copilot AI left a comment

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.

Pull request overview

This PR makes the deck builder’s search results deterministic when multiple cards exactly match the search query (notably alternate-art / reprint variants), by sorting that exact-match “front” group by card ID after it is moved to the front of the results list.

Changes:

  • After partitioning exact-name matches to the front of results, sorts that exact-match subrange by card ID.
  • Adds a dedicated DataManager::deck_sort_id comparator and exposes it in DataManager’s header.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
gframe/deck_con.cpp Sorts the exact-match prefix of the filtered results by ID to ensure stable ordering.
gframe/data_manager.h Declares a new deck_sort_id comparator for reuse in sorting.
gframe/data_manager.cpp Implements deck_sort_id as an ID (code) ascending comparator.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mercury233 mercury233 merged commit 612eb7d into Fluorohydride:master Jun 19, 2026
15 checks passed
@mercury233 mercury233 deleted the patch-exact-match-sort branch June 19, 2026 01:01
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.

2 participants