Skip to content

Add more vault search options#1154

Merged
Gatsik merged 5 commits intoFAForever:developfrom
Gatsik:ui-additions
Feb 14, 2026
Merged

Add more vault search options#1154
Gatsik merged 5 commits intoFAForever:developfrom
Gatsik:ui-additions

Conversation

@Gatsik
Copy link
Contributor

@Gatsik Gatsik commented Feb 13, 2026

Summary by CodeRabbit

  • New Features

    • Added ETFREEMAN as a third unit database option and button
    • Advanced search filters for maps (dimensions, max players) and mods (author, uploader, type)
    • Expanded vault search UI with a dedicated parameter panel and improved keyboard navigation
  • Bug Fixes

    • Improved missing thumbnail handling with clearer "No image" message
  • Chores

    • Updated dependency versions for stability

game process is not actually starting here
also, there are messages about starting ICE adapter
immediately after it which made this message to be
seen only for a fraction of a second
@coderabbitai
Copy link

coderabbitai bot commented Feb 13, 2026

📝 Walkthrough

Walkthrough

Adds ETFREEMAN as a third unit-db option, new search parameter UIs for map and mod vaults, centralizes vault filter construction, updates related CSS/theme and UI files, introduces MapSize.from_side_km, and minor client UI/thumbnail tweaks.

Changes

Cohort / File(s) Summary
Dependencies
requirements.txt
Bumped cx_Freeze, pyqt6, and websockets versions.
Themes & Client CSS
res/client/client.css, res/themes/Dark Blue/client/client.css, res/themes/unthemed/client/..., res/themes/unthemed/client/client_light.css
Added/expanded selectors for new inputs and db buttons (including etfreemanDbButton), increased specificity to QPushButton#..., adjusted hover rules and padding.
Unit DB UI
res/unitdb/unitdb.ui
Added etfreemanDbButton to unit database UI.
Vault UIs
res/vaults/mapfilters.ui, res/vaults/modfilters.ui, res/vaults/vault.ui
Added dedicated map/mod filter UI forms and restructured vault layout to embed a search-params panel and adjust tab order/navigation.
Config
src/config/production.py
Added UNITDB_ETFREEMAN_URL production default.
UnitDB Integration
src/unitdb/unitdbtab.py
Consolidated URLs into _db_urls, added open_db_url(index) method, wired buttons to indexed lambdas to support ETFREEMAN.
Map Vault Implementation
src/vaults/mapvault/mapvault.py, src/api/models/MapVersion.py
Initialized map search UI, populated size/max-player selectors, added construct_search_filters() and reset_search_params(), and added MapSize.from_side_km() factory.
Mod Vault Implementation
src/vaults/modvault/modvault.py
Initialized mod search UI and type radio buttons, added construct_search_filters() and reset_search_params().
Vault Infrastructure
src/vaults/vault.py
Introduced _search_params_ui, wired search UI into base class, added abstract construct_search_filters() and reset_search_params() contract, and updated search() to use constructed filters.
Misc / Client
src/vaults/listwidget.py, src/client/_clientwindow.py
Tightened thumbnail validation to reject null/empty QPixmaps and changed fallback text; removed one status-bar update in game launch handling.

Sequence Diagram(s)

sequenceDiagram
    participant User as User
    participant UI as Vault UI (map/mod)
    participant Vault as Vault controller
    participant API as ApiClient
    participant Browser as External Browser/UnitDB

    User->>UI: enter filters / click Search
    UI->>Vault: construct_search_filters()
    Vault->>API: query with QueryOptions
    API-->>Vault: results
    Vault-->>UI: render results
    User->>UI: click ETFREEMAN button
    UI->>Browser: open_db_url(index) (UNITDB_ETFREEMAN_URL)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 A button hops in, ETFREEMAN bold and bright,
Filters sprout wings, maps and mods take flight,
Widgets lined up, radios all in tune,
Queries leap out beneath the moon,
Hoppity-hop—search results delight! 🥕

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add more vault search options' accurately reflects the main changes across multiple files, including new search UI components, filter construction methods, and expanded search parameters for both map and mod vaults.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into develop

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@requirements.txt`:
- Line 1: The requirements currently include pinned packages but must not
include pytest==9.0.2 due to CVE-2025-71176; update requirements.txt to either
pin pytest to a safe version (e.g., pytest==8.4.2), remove or delay adding
pytest 9.0.2, or document using a secure basetemp invocation (pytest
--basetemp=/secure/path) as a temporary mitigation; ensure the change is applied
where pytest is declared (requirements.txt) and mention the chosen mitigation in
the PR so reviewers know which option was taken.
- Line 13: requirements.txt pins pytest==9.0.2 which requires Python ≥3.10 and
introduces breaking changes; update CI/test matrix to use Python 3.10+ (or pin
pytest lower), search the codebase for deprecated pytest patterns (e.g., calls
to pytest.importorskip() without exc_type and any usages that may trigger
PytestRemovedIn9Warning), bump test-related plugins to compatible versions
(pytest-cov ≥7.0.0, pytest-mock ≥3.15, pytest-qt ≥4.5.0) in requirements/dev
files, and run the full test suite with pytest==9.0.2 to identify and fix any
failing tests or deprecation-as-error issues before merging.

In `@src/vaults/mapvault/mapvault.py`:
- Around line 64-86: construct_search_filters interpolates raw user input into
filter expressions (displayName and author.login) which can break the filter
syntax; sanitize or escape special characters before building the filter
strings. In construct_search_filters (and the analogous method in modvault.py)
read the text from searchParams.searchInput and authorInput, normalize it, then
escape or remove characters that can break the query (at minimum: single quote
', semicolon ;, equals signs ==, and wildcard *), or better yet implement a
quoting/escaping helper (e.g., escape_filter_value(value: str) used by
construct_search_filters) that replaces/escapes these chars and ensures the
final value is wrapped/quoted correctly before embedding into
f"displayName=='*{escaped}*'" and f"author.login=='*{escaped}*'". Ensure you
update both displayName and author.login usages to call this helper and add unit
tests for inputs containing ', ;, =, * to verify correct behavior.
🧹 Nitpick comments (2)
src/vaults/vault.py (2)

41-41: Empty-string default for _search_params_ui could silently break subclasses.

If a new vault subclass forgets to assign _search_params_ui before calling super().setup(), util.THEME.loadUi("") will fail at runtime with an unhelpful error. Consider raising explicitly if the value is still empty at setup() time.

💡 Proposed defensive check in setup()
     def setup(self) -> None:
         self.setupUi(self)
 
+        if not self._search_params_ui:
+            raise ValueError(
+                f"{type(self).__name__} must set _search_params_ui before calling setup()",
+            )
         self.searchParams = util.THEME.loadUi(self._search_params_ui)

257-258: Consider using abc.abstractmethod instead of raising NotImplementedError.

Using @abc.abstractmethod would catch missing implementations at class instantiation time rather than at call time, providing earlier and clearer error feedback.

@Gatsik Gatsik merged commit 2b3e7b8 into FAForever:develop Feb 14, 2026
3 checks passed
@Gatsik Gatsik deleted the ui-additions branch February 14, 2026 11:00
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