feat: restructure menu and add file import

- Consolidate "Add word" menu with submenu (Manual, Thematic, Import)
- Add file import support (.txt, .md) with AI batch translation
- Add vocabulary pagination with navigation buttons
- Add "Add word" button in tasks for new words mode
- Fix undefined variables bug in vocabulary confirm handler
- Add localization keys for add_menu in ru/en/ja

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-05 20:15:47 +03:00
parent 2097950c60
commit 63e2615243
12 changed files with 883 additions and 47 deletions

View File

@@ -0,0 +1,28 @@
"""add ai_task value to wordsource enum
Revision ID: 20251205_wordsource_ai_task
Revises: 20251205_levels_by_lang
Create Date: 2025-12-05
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = '20251205_wordsource_ai_task'
down_revision = '20251205_levels_by_lang'
branch_labels = None
depends_on = None
def upgrade():
# Добавляем новое значение в enum wordsource
# SQLAlchemy отправляет имя enum (uppercase), а не значение
op.execute("ALTER TYPE wordsource ADD VALUE IF NOT EXISTS 'AI_TASK'")
def downgrade():
# PostgreSQL не поддерживает удаление значений из enum напрямую
# Для отката нужно пересоздать enum, что сложно и опасно
# Оставляем значение в enum (оно просто не будет использоваться)
pass