Skip to content

Conversation

gantoine
Copy link
Member

@gantoine gantoine commented Jul 22, 2025

Description
Explain the changes or enhancements you are proposing with this pull request.

This PR introduces SmartCollections, a new type of collection who's roms are populated by a preset collection of filters. Users create smart collections from the search page, filtering down their games until they a set of filters they want, which are stored on the model as JSON.

For performance reasons, member roms are calculated at access time, meaning the actual list of roms (and rom count) are only updated whenever the collection content is accessed. While this isn't optimal, it allows us to create many collections without pre-computing membership and slowing down db calls.

Checklist
Please check all that apply.

  • I've tested the changes locally
  • I've updated relevant comments
  • I've assigned reviewers for this PR
  • I've added unit tests that cover the changes

Screenshots

Screenshot 2025-07-27 at 3 39 39 PM

Copy link

trunk-io bot commented Jul 22, 2025

Running Code Quality on PRs by uploading data to Trunk will soon be removed. You can still run checks on your PRs using trunk-action - see the migration guide for more information.

Copy link

github-actions bot commented Jul 22, 2025

Test Results

546 tests  ±0   545 ✅ ±0   58s ⏱️ ±0s
  1 suites ±0     1 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 39f6ae1. ± Comparison against base commit 1d73c0a.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jul 22, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
8696 6156 71% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
backend/endpoints/collections.py 29% 🟢
backend/endpoints/responses/collection.py 98% 🟢
backend/endpoints/rom.py 39% 🟢
backend/handler/database/collections_handler.py 55% 🟢
backend/handler/database/roms_handler.py 50% 🟢
backend/models/collection.py 73% 🟢
backend/models/user.py 90% 🟢
TOTAL 62% 🟢

updated for commit: 39f6ae1 by action🐍

@gantoine gantoine marked this pull request as ready for review July 27, 2025 19:48
@gantoine gantoine requested a review from Copilot July 27, 2025 19:49
Copy link
Contributor

@Copilot Copilot AI left a comment

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 introduces smart collections functionality - a new type of collection that dynamically filters games based on saved filter criteria rather than manually curated ROM lists. Smart collections complement the existing regular and virtual collections by allowing users to create collections that automatically update as games are added or metadata changes.

  • Adds smart collections with dynamic ROM filtering based on saved criteria
  • Refactors collection components to support multiple collection types using a unified architecture
  • Updates the UI to display smart collections alongside regular and virtual collections with proper routing

Reviewed Changes

Copilot reviewed 68 out of 73 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
backend/models/collection.py Adds SmartCollection model with filter criteria and dynamic ROM fetching
backend/endpoints/collections.py Implements CRUD operations for smart collections
backend/handler/database/collections_handler.py Adds database operations for smart collections
frontend/src/stores/collections.ts Updates collections store to handle smart collections
frontend/src/views/Gallery/Collection/ Creates unified collection view architecture with BaseCollection component
frontend/src/components/common/Collection/ Updates collection components to support multiple collection types
frontend/src/locales/ Adds translations for smart collection UI elements
Files not reviewed (4)
  • frontend/src/generated/index.ts: Language not supported
  • frontend/src/generated/models/CollectionSchema.ts: Language not supported
  • frontend/src/generated/models/SmartCollectionSchema.ts: Language not supported
  • frontend/src/generated/models/VirtualCollectionSchema.ts: Language not supported

@gantoine gantoine requested review from adamantike and zurdi15 July 27, 2025 23:45
@gantoine gantoine merged commit 5f0e626 into master Aug 2, 2025
11 checks passed
@gantoine gantoine deleted the smart-collections branch August 2, 2025 13:17
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