Skip to content

feat: extra abilities column + search fixes + data corrections#31

Merged
AABur merged 2 commits into
mainfrom
feat/webui-extra-abilities-and-search
May 7, 2026
Merged

feat: extra abilities column + search fixes + data corrections#31
AABur merged 2 commits into
mainfrom
feat/webui-extra-abilities-and-search

Conversation

@AABur
Copy link
Copy Markdown
Owner

@AABur AABur commented May 7, 2026

Summary

  • Extra abilities column — добавлена колонка «Доп-способности» в таблицу webUI (справа от «Способности»), отображает переведённые названия через lang_config.extra_ability_names
  • Исправлен фильтр «спаунятся» — вместо can_create IS NULL теперь фильтрует по set != 'OnlySpawnable'; ранее скрывались карты, которые создают спаунаблов (Resistance-карты и др.)
  • Исправлен полнотекстовый поиск — добавлена SQL-функция uni_lower() на базе Python str.casefold() для корректного поиска по кирилличе; поиск теперь охватывает и EN-заголовок как запасной вариант (карты с латинскими тайтлами в RU-локали)
  • Данные extra_abilities.toml — верифицированы через EN/RU API: pincer 16→17 (protect_the_pocket), destruction 70→79 (9 новых карт); naval очищен (данные требуют уточнения)

Test plan

  • Запустить uv run kardscm --lang ru web → колонка «Доп-способности» отображается
  • Фильтр «Сопротивление» показывает 9 карт (не скрывает те что создают resistance_b)
  • Поиск «т-34» в RU-локали возвращает результаты
  • Поиск «T-34» в EN-локали возвращает результаты
  • make check проходит без ошибок

- 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
Copilot AI review requested due to automatic review settings May 7, 2026 18:58
Copy link
Copy Markdown
Contributor

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 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 OnlySpawnable set.
  • Improved text search by using a new SQLite uni_lower() function (Python casefold) and searching localized title/text plus en-EN title as fallback.
  • Updated extra_abilities.toml data 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.

Comment thread kardscm/web/queries.py
Comment thread kardscm/web/queries.py
Comment thread kardscm/web/queries.py Outdated
- 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
@AABur AABur merged commit 2ff2473 into main May 7, 2026
1 check passed
@AABur AABur deleted the feat/webui-extra-abilities-and-search branch May 7, 2026 20:24
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