feat: extra abilities column + search fixes + data corrections#31
Merged
Conversation
- Add extra_attributes column to webUI table (right of Abilities) - Fix spawnable filter: use set=OnlySpawnable instead of can_create check - Fix text search: use uni_lower() for Cyrillic case-insensitive matching, search EN title as fallback for cards with Latin chars in RU locale - Verify and correct extra_abilities.toml via EN API (pincer 16→17, destruction 70→79); clear naval pending manual research - Register uni_lower() SQL function in get_connection(); update test fixture to use get_connection() so uni_lower is available in tests
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the webUI card table by adding an “Extra abilities” column, fixes the “spawnable” filter semantics to avoid hiding cards that create spawnables, and improves text search for Cyrillic by introducing Unicode-aware case folding plus an English-title fallback.
Changes:
- Added an “Extra abilities” column to the webUI table and populated it via
lang_config.extra_ability_names. - Updated spawnable filtering to exclude only cards from the
OnlySpawnableset. - Improved text search by using a new SQLite
uni_lower()function (Pythoncasefold) and searching localized title/text plusen-ENtitle as fallback. - Updated
extra_abilities.tomldata for pincer/destruction.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tests/web/test_queries.py |
Uses get_connection() for in-memory DB (so custom SQL functions exist) and updates the spawnable fixture row to OnlySpawnable. |
kardscm/web/translate.py |
Adds extra_attributes to the card view model, translating via extra_ability_names. |
kardscm/web/templates/_table.html |
Adds a new “Extra abilities” column to the rendered card table. |
kardscm/web/queries.py |
Adjusts spawnable filter logic and implements Unicode-aware text search with en-EN fallback. |
kardscm/storage/database.py |
Registers the new SQLite scalar function uni_lower() for Unicode-aware case folding. |
kardscm/data/extra_abilities.toml |
Updates curated card-id lists for extra abilities (notably pincer/destruction). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Bind 'OnlySpawnable' as a parameter instead of a literal string - Add regression test: can_create card is visible without include_spawnable - Add tests: Cyrillic case-insensitive search and EN title fallback in ru locale
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lang_config.extra_ability_namescan_create IS NULLтеперь фильтрует поset != 'OnlySpawnable'; ранее скрывались карты, которые создают спаунаблов (Resistance-карты и др.)uni_lower()на базе Pythonstr.casefold()для корректного поиска по кирилличе; поиск теперь охватывает и EN-заголовок как запасной вариант (карты с латинскими тайтлами в RU-локали)protect_the_pocket), destruction 70→79 (9 новых карт); naval очищен (данные требуют уточнения)Test plan
uv run kardscm --lang ru web→ колонка «Доп-способности» отображаетсяmake checkпроходит без ошибок