Skip to content

Add 'My Collection Only' filter to card search#200

Open
robertclayh wants to merge 1 commit into
seastan:masterfrom
robertclayh:feature/my-collection-filter
Open

Add 'My Collection Only' filter to card search#200
robertclayh wants to merge 1 commit into
seastan:masterfrom
robertclayh:feature/my-collection-filter

Conversation

@robertclayh

@robertclayh robertclayh commented Mar 20, 2026

Copy link
Copy Markdown

Summary

Adds a "My Collection Only" toggle button to the card search results page that filters results to show only cards from packs the user has saved in their collection.

  • Toggle is only visible to logged-in users
  • Filter persists across pagination
  • Uses the existing owned_packs data from the user's saved collection settings

Addresses #114 (specifically the "My Collection" search category suggestion)

Changes

  • SearchController.php — reads collection query parameter, fetches user's owned packs, passes them through search and pagination
  • searchbar.html.twig — adds the toggle checkbox button to the search bar
  • CardsData.php — adds optional $ownedPacks parameter to get_search_rows() to filter by pack IDs

Test plan

  • Log in and go to /search, search for any cards (e.g. t:hero)
  • Verify "My Collection Only" toggle appears next to sort/view options
  • Check the toggle and search again — results should only include cards from owned packs
  • Verify pagination links preserve the collection filter
  • Verify the toggle does not appear when logged out

Adds a toggle button on the search results page that filters cards
to only show those from packs the user owns in their saved collection.
Only visible to logged-in users.

Closes seastan#114

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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