Skip to content

Conversation

@gantoine
Copy link
Member

@gantoine gantoine commented Jan 15, 2026

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

This PR refactors how filters are loaded for certain groups of ROMs, and adds a new endpoint to fetch all available filters (which is currently unused by the frontend).

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

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @gantoine, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the ROM filtering capabilities by introducing a dedicated backend endpoint for retrieving filter options and integrating this functionality into the main ROM listing API. The changes streamline how filter values are presented to the user, moving the logic for generating these options from the frontend to the backend. This refactoring improves data consistency, reduces client-side processing, and sets the stage for more robust and dynamic filtering experiences.

Highlights

  • New ROM Filter Endpoint: A new protected API endpoint, /roms/filters, has been introduced to retrieve all available filter values (genres, franchises, platforms, etc.) across all ROMs. This allows the frontend to dynamically populate filter options.
  • Dynamic Filter Value Population: The main /roms endpoint now includes an optional with_filter_values query parameter. When enabled, the response will contain a filter_values dictionary, providing the unique filter options relevant to the current ROM query. This data is then used by the frontend to update filter dropdowns.
  • Backend Filter Method Refactoring: Numerous internal ROM filtering methods in roms_handler.py have been made private by prefixing them with an underscore (e.g., _filter_by_genres). This improves encapsulation and clarifies their intended use as internal helpers.
  • Frontend Filter Logic Simplification: The frontend's FilterDrawer/Base.vue component no longer fetches and processes ROMs to derive filter options. Instead, it now relies on the filter_values provided directly by the backend's fetchRoms call, simplifying the client-side logic and ensuring consistency with the server-side filtering.
  • Type Definition Updates: New RomFiltersDict type definitions have been added to both the backend (Python's TypedDict) and frontend (TypeScript) to accurately represent the structure of the ROM filter values.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 15, 2026

Test Results

703 tests  ±0   702 ✅ ±0   1m 28s ⏱️ +2s
  1 suites ±0     1 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 84fef2f. ± Comparison against base commit c012546.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 15, 2026

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
12249 7961 65% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
backend/endpoints/responses/rom.py 96% 🟢
backend/endpoints/rom.py 45% 🟢
backend/handler/database/roms_handler.py 57% 🟢
TOTAL 66% 🟢

updated for commit: 84fef2f by action🐍

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new API endpoint for fetching ROM filter values and integrates this functionality into the frontend. The change effectively offloads the client-side calculation of filter options to the backend, which is a good architectural improvement for efficiency and consistency. Additionally, several internal filter methods in the backend have been renamed to indicate their private nature, enhancing maintainability. The frontend code has been updated to consume these new backend capabilities and remove the redundant client-side logic for filter option generation.

@gantoine
Copy link
Member Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a significant and beneficial refactoring by moving the logic for generating filter options from the frontend to the backend. This should improve frontend performance and simplify the client-side code. The changes include a new /roms/filters endpoint and updates to the main /roms endpoint to return available filter values. The frontend code has been updated to use this new backend functionality, removing complex client-side logic.

My review has identified a critical bug in the backend that could cause a server error when calculating filter values. I've also included a few suggestions to improve code conciseness and maintainability in both the backend and frontend.

@gantoine gantoine changed the title Roms filter endpoint ROMs filter endpoint + refactor Jan 16, 2026
@gantoine gantoine marked this pull request as ready for review January 16, 2026 18:22
@gantoine gantoine requested a review from zurdi15 January 16, 2026 19:49
@gantoine gantoine merged commit b341175 into master Jan 17, 2026
9 checks passed
@gantoine gantoine deleted the roms-filter-endpoint branch January 17, 2026 00:14
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