From 339bbaae2da8501f65de1d86754b197bb338e1e9 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 19 Dec 2025 00:31:51 +0300 Subject: [PATCH] stuff --- PROGRESS.md | 22 +- TODO.md | 13 +- mnemo_cards_admin/src/api/packs.ts | 42 ++ .../src/components/BulkCardEditor.tsx | 56 +- .../src/components/JSONQuestionEditor.tsx | 48 +- .../src/components/QuestionEditorDialog.tsx | 137 +++-- .../src/components/TestPacksManager.test.tsx | 89 ++++ .../src/components/TestPacksManager.tsx | 241 +++++++++ .../forms/InputButtonsQuestionForm.tsx | 18 - .../components/forms/MatrixQuestionForm.tsx | 75 +++ .../components/forms/SimpleQuestionForm.tsx | 17 - mnemo_cards_admin/src/lib/error-utils.ts | 24 +- mnemo_cards_admin/src/pages/TestsPage.tsx | 136 +++-- mnemo_cards_admin/src/types/models.ts | 3 +- mnemo_cards_admin/src/types/questions.test.ts | 41 ++ mnemo_cards_admin/src/types/questions.ts | 75 ++- .../lib/api/v2/admin_cards_api_v2.dart | 40 +- .../lib/api/v2/admin_tests_api_v2.dart | 2 + .../lib/api/v2/packs_api_v2.dart | 144 +++-- .../lib/database/daos/pack_dao.dart | 9 +- .../lib/packs/card_image_storage.dart | 350 ++++++++++++ .../lib/packs/voice_storage.dart | 260 +++++++++ .../tests/generators/pack_test_generator.dart | 8 +- .../matrix_question_generator.dart | 96 ++++ .../lib/tests/test_manager.dart | 133 +++-- .../lib/mnemo_cards_common.dart | 1 + .../test_bodies/abstract_test_question.dart | 3 +- .../matrix_test_question_body.dart | 65 +++ .../matrix_test_question_body.g.dart | 263 +++++++++ .../lib/domain/models/game_question.dart | 34 +- .../domain/models/game_question.freezed.dart | 219 ++++---- .../lib/domain/models/game_question.g.dart | 44 +- .../models/matrix_image_select_answer.dart | 13 + .../domain/services/game_session_manager.dart | 50 +- .../domain/services/http_repository_v2.dart | 30 ++ .../lib/domain/state/tests_state_manager.dart | 93 +++- .../presentation/pages/game/game_page.dart | 7 +- .../widgets/card_flipper/card_flipper.dart | 85 +-- .../lib/presentation/widgets/card_viewer.dart | 405 ++++++++------ .../widgets/card_voice_controls.dart | 111 ++-- .../widgets/game/matrix_widget.dart | 502 +++++++++++------- .../widgets/game/question_display.dart | 6 +- .../widgets/pack_details_header.dart | 1 - .../modules/storage_module_test.dart | 10 - .../domain/models/game_question_test.dart | 50 +- .../services/card_flipper_service_test.dart | 32 +- .../services/game_session_manager_test.dart | 45 ++ .../http_repository_v2_voices_test.dart | 40 +- .../card_flipper_state_manager_test.dart | 16 +- .../pack_details/pack_details_page_test.dart | 362 +++---------- .../pages/tasks/create_task_page_test.dart | 81 ++- .../widgets/ads_reward_button_test.dart | 1 + .../card_flipper_responsive_test.dart | 21 +- .../widgets/card_viewer_test.dart | 63 ++- .../widgets/game/answer_options_test.dart | 193 +++---- .../game/input_letters_widget_test.dart | 104 ++-- .../widgets/game/match_widget_test.dart | 104 ++-- .../widgets/game/matrix_widget_test.dart | 363 ++++++------- .../widgets/game/progress_indicator_test.dart | 171 +++--- .../widgets/game/question_display_test.dart | 122 ++--- 60 files changed, 3905 insertions(+), 1884 deletions(-) create mode 100644 mnemo_cards_admin/src/components/TestPacksManager.test.tsx create mode 100644 mnemo_cards_admin/src/components/TestPacksManager.tsx create mode 100644 mnemo_cards_admin/src/components/forms/MatrixQuestionForm.tsx create mode 100644 mnemo_cards_admin/src/types/questions.test.ts create mode 100644 mnemo_cards_backend/lib/packs/card_image_storage.dart create mode 100644 mnemo_cards_backend/lib/packs/voice_storage.dart create mode 100644 mnemo_cards_backend/lib/tests/generators/question_generators/matrix_question_generator.dart create mode 100644 mnemo_cards_common/lib/src/dtos/game_tests/test_bodies/matrix_test_question_body.dart create mode 100644 mnemo_cards_common/lib/src/dtos/game_tests/test_bodies/matrix_test_question_body.g.dart create mode 100644 mnemo_cards_web_v2/lib/domain/models/matrix_image_select_answer.dart diff --git a/PROGRESS.md b/PROGRESS.md index c9b5634..013f287 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -39,6 +39,9 @@ - **Admin Packs: Color Palette Picker**: Added palette-based color selection for packs - Replaced free-text color input with swatches + native color picker - Added unit tests for the new color picker component (`mnemo_cards_admin`) +- **Admin Tests: Pack Linking**: Added ability to link tests to packs in admin + - Test editor now supports selecting packs and syncing links on Save + - Added unit test coverage for the new pack-linking component (`mnemo_cards_admin`) - **Service Reliability**: Enhanced service management and monitoring - Port conflict detection and resolution @@ -70,9 +73,12 @@ - **Key Features**: Vocabulary learning, testing, statistics - **Recent Updates**: - Added card voice support (metadata, API, web playback with error UI) - - New voices collection linked to cards and public endpoints for list/mp3 - - Web CardViewer now fetches voices and plays audio via audioplayers - - Added unit tests for API config and voice fetching + - New voices collection linked to cards and protected endpoints for list/mp3 (Bearer) + - Web playback: download bytes via authenticated API and play from memory (fixes 401 on `