From ce564924f239cf8f6c65ebe9b9eaaadb7c102535 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Sat, 24 Jan 2026 15:31:47 +0300 Subject: [PATCH] paths --- .../DATABASE_IMPROVEMENT_PLAN_DETAILED.md | 1 + .../FINAL_VERIFICATION_REPORT.md | 1 + .../docs/SHOULD_EXTRACT_DATABASE.md | 1 + .../fix_is_blacklisted_nulls.sql | 1 + .../lib/api/v2/packs_api_v2.dart | 40 +++++++++++++++---- .../001_remove_deprecated_fields.sql | 1 + .../migrations/002_add_enum_types.sql | 1 + .../migrations/003_add_composite_indexes.sql | 1 + mnemo_cards_web_v2/generate_icons.sh | 1 + .../pages/pack_details/pack_details_page.dart | 4 +- .../presentation/pages/tasks/tasks_page.dart | 2 +- .../presentation/pages/test/test_page.dart | 2 +- .../lib/presentation/widgets/game_card.dart | 2 +- .../lib/presentation/widgets/pack_card.dart | 4 +- .../widgets/pack_card_vertical.dart | 6 +-- .../lib/presentation/widgets/task_card.dart | 2 +- 16 files changed, 51 insertions(+), 19 deletions(-) diff --git a/mnemo_cards_backend/DATABASE_IMPROVEMENT_PLAN_DETAILED.md b/mnemo_cards_backend/DATABASE_IMPROVEMENT_PLAN_DETAILED.md index dc778e6..49369fc 100644 --- a/mnemo_cards_backend/DATABASE_IMPROVEMENT_PLAN_DETAILED.md +++ b/mnemo_cards_backend/DATABASE_IMPROVEMENT_PLAN_DETAILED.md @@ -966,3 +966,4 @@ void main() { + diff --git a/mnemo_cards_backend/FINAL_VERIFICATION_REPORT.md b/mnemo_cards_backend/FINAL_VERIFICATION_REPORT.md index f5d9c34..e337e85 100644 --- a/mnemo_cards_backend/FINAL_VERIFICATION_REPORT.md +++ b/mnemo_cards_backend/FINAL_VERIFICATION_REPORT.md @@ -282,3 +282,4 @@ Built with build_runner/jit in 1s; wrote 0 outputs. + diff --git a/mnemo_cards_backend/docs/SHOULD_EXTRACT_DATABASE.md b/mnemo_cards_backend/docs/SHOULD_EXTRACT_DATABASE.md index ee7dd5f..19dc0d1 100644 --- a/mnemo_cards_backend/docs/SHOULD_EXTRACT_DATABASE.md +++ b/mnemo_cards_backend/docs/SHOULD_EXTRACT_DATABASE.md @@ -322,3 +322,4 @@ import 'package:mnemo_cards_backend/database/database.dart'; + diff --git a/mnemo_cards_backend/fix_is_blacklisted_nulls.sql b/mnemo_cards_backend/fix_is_blacklisted_nulls.sql index af2ba05..f08a65b 100644 --- a/mnemo_cards_backend/fix_is_blacklisted_nulls.sql +++ b/mnemo_cards_backend/fix_is_blacklisted_nulls.sql @@ -31,3 +31,4 @@ GROUP BY is_blacklisted; + diff --git a/mnemo_cards_backend/lib/api/v2/packs_api_v2.dart b/mnemo_cards_backend/lib/api/v2/packs_api_v2.dart index 6dd4fd8..6d6b381 100644 --- a/mnemo_cards_backend/lib/api/v2/packs_api_v2.dart +++ b/mnemo_cards_backend/lib/api/v2/packs_api_v2.dart @@ -558,14 +558,20 @@ class PacksApiV2 { objectId: imageValue, ); if (presignedUrl != null) { - return Response.found(presignedUrl); + return Response.found( + presignedUrl, + headers: {'Cache-Control': 'public, max-age=86400'}, + ); } return _notFound('Image not found in storage'); } // Remote URL: redirect if (CardImageStorage.isRemoteUrl(imageValue)) { - return Response.found(imageValue); + return Response.found( + imageValue, + headers: {'Cache-Control': 'public, max-age=86400'}, + ); } // Not a UUID and not a remote URL - image not found @@ -631,14 +637,20 @@ class PacksApiV2 { objectId: imageValue, ); if (presignedUrl != null) { - return Response.found(presignedUrl); + return Response.found( + presignedUrl, + headers: {'Cache-Control': 'public, max-age=86400'}, + ); } return _notFound('Back image not found in storage'); } // Remote URL: redirect if (CardImageStorage.isRemoteUrl(imageValue)) { - return Response.found(imageValue); + return Response.found( + imageValue, + headers: {'Cache-Control': 'public, max-age=86400'}, + ); } // Not a UUID and not a remote URL - image not found @@ -683,14 +695,20 @@ class PacksApiV2 { objectId: coverValue, ); if (presignedUrl != null) { - return Response.found(presignedUrl); + return Response.found( + presignedUrl, + headers: {'Cache-Control': 'public, max-age=86400'}, + ); } return _notFound('Cover image not found in storage'); } // Remote URL: redirect if (CardImageStorage.isRemoteUrl(coverValue)) { - return Response.found(coverValue); + return Response.found( + coverValue, + headers: {'Cache-Control': 'public, max-age=86400'}, + ); } // Not a UUID and not a remote URL - image not found @@ -862,7 +880,10 @@ class PacksApiV2 { // Remote voice: redirect to remote storage URL if (VoiceStorage.isRemoteUrl(voiceValue)) { - return Response.found(voiceValue); + return Response.found( + voiceValue, + headers: {'Cache-Control': 'public, max-age=86400'}, + ); } // If it's a valid UUID (object ID in MinIO), redirect to presigned URL @@ -872,7 +893,10 @@ class PacksApiV2 { objectId: voiceValue, ); if (presignedUrl != null) { - return Response.found(presignedUrl); + return Response.found( + presignedUrl, + headers: {'Cache-Control': 'public, max-age=86400'}, + ); } return _notFound('Voice file not found in storage'); } diff --git a/mnemo_cards_backend/migrations/001_remove_deprecated_fields.sql b/mnemo_cards_backend/migrations/001_remove_deprecated_fields.sql index 2c6226c..9882e6b 100644 --- a/mnemo_cards_backend/migrations/001_remove_deprecated_fields.sql +++ b/mnemo_cards_backend/migrations/001_remove_deprecated_fields.sql @@ -51,3 +51,4 @@ VACUUM FULL ANALYZE payments; + diff --git a/mnemo_cards_backend/migrations/002_add_enum_types.sql b/mnemo_cards_backend/migrations/002_add_enum_types.sql index 48a8939..70868ab 100644 --- a/mnemo_cards_backend/migrations/002_add_enum_types.sql +++ b/mnemo_cards_backend/migrations/002_add_enum_types.sql @@ -124,3 +124,4 @@ DROP TYPE IF EXISTS grant_type CASCADE; + diff --git a/mnemo_cards_backend/migrations/003_add_composite_indexes.sql b/mnemo_cards_backend/migrations/003_add_composite_indexes.sql index 1676df2..a94f8b8 100644 --- a/mnemo_cards_backend/migrations/003_add_composite_indexes.sql +++ b/mnemo_cards_backend/migrations/003_add_composite_indexes.sql @@ -196,3 +196,4 @@ PRINT 'Migration 003 completed successfully!'; + diff --git a/mnemo_cards_web_v2/generate_icons.sh b/mnemo_cards_web_v2/generate_icons.sh index bb433da..cdd7444 100755 --- a/mnemo_cards_web_v2/generate_icons.sh +++ b/mnemo_cards_web_v2/generate_icons.sh @@ -56,3 +56,4 @@ echo " - favicon.png (32x32)" + diff --git a/mnemo_cards_web_v2/lib/presentation/pages/pack_details/pack_details_page.dart b/mnemo_cards_web_v2/lib/presentation/pages/pack_details/pack_details_page.dart index 6f7c706..ac66525 100644 --- a/mnemo_cards_web_v2/lib/presentation/pages/pack_details/pack_details_page.dart +++ b/mnemo_cards_web_v2/lib/presentation/pages/pack_details/pack_details_page.dart @@ -282,7 +282,7 @@ class _PackDetailsPageState extends State { } log('Launching test: ${test.name}', name: 'PackDetailsPage'); - context.push('/game/${test.id}', extra: '/pack/${widget.packId}'); + context.go('/game/${test.id}', extra: '/pack/${widget.packId}'); } @override @@ -412,7 +412,7 @@ class _PackDetailsPageState extends State { try { await Future.delayed(const Duration(milliseconds: 100)); if (mounted) { - await context.push('/purchase/${widget.packId}'); + context.go('/purchase/${widget.packId}'); } } finally { if (mounted) { diff --git a/mnemo_cards_web_v2/lib/presentation/pages/tasks/tasks_page.dart b/mnemo_cards_web_v2/lib/presentation/pages/tasks/tasks_page.dart index afebf74..506eaf7 100644 --- a/mnemo_cards_web_v2/lib/presentation/pages/tasks/tasks_page.dart +++ b/mnemo_cards_web_v2/lib/presentation/pages/tasks/tasks_page.dart @@ -142,7 +142,7 @@ class _TasksPageState extends State with TickerProviderStateMixin { mainAxisSize: MainAxisSize.min, children: [ FloatingActionButton( - onPressed: () => context.push('/tasks/create'), + onPressed: () => context.go('/tasks/create'), tooltip: 'Создать задание', heroTag: 'create_task', child: const Icon(Icons.add), diff --git a/mnemo_cards_web_v2/lib/presentation/pages/test/test_page.dart b/mnemo_cards_web_v2/lib/presentation/pages/test/test_page.dart index 785886b..254d507 100644 --- a/mnemo_cards_web_v2/lib/presentation/pages/test/test_page.dart +++ b/mnemo_cards_web_v2/lib/presentation/pages/test/test_page.dart @@ -219,7 +219,7 @@ class _TestPageState extends State { } void _playGame(BuildContext context) { - context.push('/game/${widget.testId}'); + context.go('/game/${widget.testId}'); } void _handleBack() { diff --git a/mnemo_cards_web_v2/lib/presentation/widgets/game_card.dart b/mnemo_cards_web_v2/lib/presentation/widgets/game_card.dart index 23d811c..870f745 100644 --- a/mnemo_cards_web_v2/lib/presentation/widgets/game_card.dart +++ b/mnemo_cards_web_v2/lib/presentation/widgets/game_card.dart @@ -21,7 +21,7 @@ class GameCard extends StatelessWidget { onTap ?? () { // Navigate to game page - context.push('/game/${game.id}'); + context.go('/game/${game.id}'); }, child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/mnemo_cards_web_v2/lib/presentation/widgets/pack_card.dart b/mnemo_cards_web_v2/lib/presentation/widgets/pack_card.dart index 46f8181..cbe1b8a 100644 --- a/mnemo_cards_web_v2/lib/presentation/widgets/pack_card.dart +++ b/mnemo_cards_web_v2/lib/presentation/widgets/pack_card.dart @@ -37,9 +37,9 @@ class PackCard extends StatelessWidget { GestureDetector( onTap: () { if (pack.isAvailable) { - context.push('/pack/${pack.id}'); + context.go('/pack/${pack.id}'); } else { - context.push('/purchase/${pack.id}'); + context.go('/purchase/${pack.id}'); } }, child: Container( diff --git a/mnemo_cards_web_v2/lib/presentation/widgets/pack_card_vertical.dart b/mnemo_cards_web_v2/lib/presentation/widgets/pack_card_vertical.dart index 48bcd7a..d16d75b 100644 --- a/mnemo_cards_web_v2/lib/presentation/widgets/pack_card_vertical.dart +++ b/mnemo_cards_web_v2/lib/presentation/widgets/pack_card_vertical.dart @@ -30,12 +30,12 @@ class PackCardVertical extends StatelessWidget { child: Semantics( label: 'Pack: ${pack.title}. Tap to view details.', button: true, - child: GestureDetector( + child: GestureDetector( onTap: () { if (pack.isAvailable) { - context.push('/pack/${pack.id}'); + context.go('/pack/${pack.id}'); } else { - context.push('/purchase/${pack.id}'); + context.go('/purchase/${pack.id}'); } }, child: Container( diff --git a/mnemo_cards_web_v2/lib/presentation/widgets/task_card.dart b/mnemo_cards_web_v2/lib/presentation/widgets/task_card.dart index ac799a0..e026709 100644 --- a/mnemo_cards_web_v2/lib/presentation/widgets/task_card.dart +++ b/mnemo_cards_web_v2/lib/presentation/widgets/task_card.dart @@ -35,7 +35,7 @@ class TaskCard extends StatelessWidget { onTap ?? () { // Default navigation to task details - context.push('/tasks/${task.id}'); + context.go('/tasks/${task.id}'); }, child: Container( margin: const EdgeInsets.symmetric(vertical: 6.0, horizontal: 4.0),