diff --git a/ai_docs/agent/web_v2/task_list.json b/ai_docs/agent/web_v2/task_list.json index 47f1cdc..ac51f8d 100644 --- a/ai_docs/agent/web_v2/task_list.json +++ b/ai_docs/agent/web_v2/task_list.json @@ -1,50 +1,25 @@ { "project": "mnemo_cards_web_v2", "component": "web_v2", - "version": "1.0", - "generated_at": "2025-01-21T07:20:03.537898+00:00", + "version": "1.1", + "generated_at": "2025-11-21T11:51:47.671045+00:00", "generated_by": "planning_agent", "tasks": [ { - "id": "WEB-002", - "title": "Integrate Ads Reward Button into Pack Purchase Flow", + "id": "WEB-001", + "title": "Integrate AdsRewardButton into PackDetailsPage", "priority": "high", - "status": "pending", - "estimated_hours": 2.5, - "description": "Add AdsRewardButton to PackDetailsPage and PurchasePage to show 'Unlock by watching ad' option when a pack has an adsKey available. Ensure the button appears conditionally, shows correct states, refreshes pack access after successful reward, and handles errors gracefully.", + "status": "in_progress", + "estimated_hours": 2.0, + "description": "Add AdsRewardButton to PackDetailsPage to display 'Watch Ad to Unlock' option when pack has ads reward available. The button should appear in pack controls section alongside Buy button. Service and state manager are already implemented.", "acceptance_criteria": [ - "AdsRewardButton appears on PackDetailsPage when pack has adsKey", - "AdsRewardButton appears on PurchasePage when pack has adsKey", - "Button shows correct state (loading, ready, claiming, success, error)", - "Successful ad reward refreshes pack access and updates UI", - "Error states show helpful messages and allow retry", - "Button is properly styled and positioned", - "5+ widget tests pass covering button integration" - ], - "dependencies": [ - "WEB-001" - ], - "files_to_modify": [ - "mnemo_cards_web_v2/lib/presentation/pages/pack_details/pack_details_page.dart", - "mnemo_cards_web_v2/lib/presentation/pages/purchase/purchase_page.dart", - "mnemo_cards_web_v2/test/presentation/pages/pack_details/pack_details_page_test.dart" - ], - "component": "web_v2" - }, - { - "id": "WEB-003", - "title": "Verify and Complete Buy Pack Button Implementation", - "priority": "high", - "status": "pending", - "estimated_hours": 1.5, - "description": "Verify that the Buy Pack button in PackDetailsPage works correctly, navigates to PurchasePage properly, handles edge cases (pack already purchased, network errors), and has proper test coverage. Complete any missing functionality.", - "acceptance_criteria": [ - "Buy Pack button appears when pack requires purchase", - "Button navigates to PurchasePage with correct packId", - "Button handles edge cases (already purchased, network errors)", - "Button shows loading state during navigation", - "Button is properly styled and positioned", - "5+ widget tests pass covering all button functionality and edge cases" + "AdsRewardButton appears on PackDetailsPage when pack has ad reward offer", + "Button is positioned correctly in pack controls section", + "Button shows all states correctly (loading, ready, claiming, success, error)", + "Successful ad reward refreshes pack access via packsStateManager", + "Pack becomes accessible after successful reward claim", + "Error states show helpful messages with retry option", + "5+ widget tests pass covering button visibility, states, and reward flow" ], "dependencies": [], "files_to_modify": [ @@ -54,24 +29,47 @@ "component": "web_v2" }, { - "id": "WEB-004", - "title": "Create Subscription Plans Display Widget", - "priority": "medium", + "id": "WEB-002", + "title": "Integrate AdsRewardButton into PurchasePage", + "priority": "high", "status": "pending", - "estimated_hours": 3.0, - "description": "Create a reusable SubscriptionPlansWidget that displays available subscription plans with features, pricing, and comparison. This widget will be used in SubscriptionPage. The SubscriptionService already exists and uses HttpRepositoryV2.", + "estimated_hours": 1.5, + "description": "Add AdsRewardButton to PurchasePage as an alternative to paid purchase. Button should appear above payment options section when pack has ad reward available.", "acceptance_criteria": [ - "SubscriptionPlansWidget displays all available plans", - "Each plan shows features, pricing, and duration", - "Plan comparison highlights differences between plans", - "Current user subscription is highlighted", - "Widget is responsive (mobile/tablet/desktop)", - "Loading and error states are handled", - "6+ widget tests pass covering plan display and selection" + "AdsRewardButton appears on PurchasePage when pack has ad reward", + "Button is positioned above payment options with clear separation", + "Button shows all states correctly (loading, ready, claiming, success, error)", + "Successful reward navigates back or shows success confirmation", + "Error handling works with retry functionality", + "4+ widget tests pass covering button integration and flow" ], "dependencies": [ - "backend:API-007" + "WEB-001" ], + "files_to_modify": [ + "mnemo_cards_web_v2/lib/presentation/pages/purchase/purchase_page.dart", + "mnemo_cards_web_v2/test/presentation/pages/purchase/purchase_page_test.dart" + ], + "component": "web_v2" + }, + { + "id": "WEB-003", + "title": "Create SubscriptionPlansWidget", + "priority": "high", + "status": "pending", + "estimated_hours": 2.5, + "description": "Create reusable SubscriptionPlansWidget that displays available subscription plans in card layout. Widget should fetch plans from SubscriptionService, show features comparison, highlight current plan, and emit selection events. Backend endpoint GET /api/v2/subscriptions/plans is ready.", + "acceptance_criteria": [ + "Widget displays all available subscription plans in responsive grid/list", + "Each plan card shows: title, price, duration, features list, CTA button", + "Current active plan is highlighted with badge/border", + "Plan comparison shows feature differences clearly", + "Widget handles loading state with skeleton loaders", + "Error state shows with retry option", + "Plan selection emits callback event", + "6+ widget tests pass covering display, selection, and states" + ], + "dependencies": [], "files_to_modify": [ "mnemo_cards_web_v2/lib/presentation/widgets/subscription_plans_widget.dart", "mnemo_cards_web_v2/test/presentation/widgets/subscription_plans_widget_test.dart" @@ -79,25 +77,73 @@ "component": "web_v2" }, { - "id": "WEB-005", - "title": "Create Subscription Management Page", - "priority": "medium", + "id": "WEB-004", + "title": "Create Subscription State Manager", + "priority": "high", "status": "pending", - "estimated_hours": 3.5, - "description": "Create SubscriptionPage UI that integrates SubscriptionPlansWidget, handles subscription purchase flow, displays current subscription status, and provides management options (cancel/renew). Use SubscriptionService for API calls.", + "estimated_hours": 2.0, + "description": "Create SubscriptionStateManager using yx_state to manage subscription plans loading, current status, and purchase flow state. Manager should use SubscriptionService for API calls and provide computed properties for UI.", "acceptance_criteria": [ - "SubscriptionPage displays subscription plans using SubscriptionPlansWidget", - "Purchase flow works for subscriptions", - "Current subscription status is displayed clearly", - "Subscription cancellation flow works", - "Subscription renewal flow works", - "Page is responsive (mobile/tablet/desktop)", - "Loading states and error handling are implemented", - "8+ widget tests pass covering all UI interactions" + "State manager created with yx_state patterns", + "Manages subscription plans list with loading/loaded/error states", + "Tracks current user subscription status", + "Provides method to refresh subscription data", + "Implements proper error handling", + "Exports computed properties for UI convenience", + "8+ unit tests pass covering all state transitions and API calls" + ], + "dependencies": [], + "files_to_modify": [ + "mnemo_cards_web_v2/lib/domain/state/subscription_state_manager.dart", + "mnemo_cards_web_v2/test/domain/state/subscription_state_manager_test.dart" + ], + "component": "web_v2" + }, + { + "id": "WEB-005", + "title": "Add SubscriptionModule to UserScope", + "priority": "high", + "status": "pending", + "estimated_hours": 1.0, + "description": "Create SubscriptionModule and integrate it into UserScope DI container. Module should provide SubscriptionStateManager and connect it to SubscriptionService. Follow existing module patterns in UserScope.", + "acceptance_criteria": [ + "SubscriptionModule created following UserScope patterns", + "Module provides SubscriptionStateManager instance", + "Module properly wired with SubscriptionService dependency", + "Module registered in UserScope container", + "Module disposal implemented correctly", + "3+ integration tests verify module initialization and disposal" ], "dependencies": [ - "WEB-004", - "backend:API-007" + "WEB-004" + ], + "files_to_modify": [ + "mnemo_cards_web_v2/lib/di/user_scope/subscription_module.dart", + "mnemo_cards_web_v2/lib/di/user_scope/user_scope.dart", + "mnemo_cards_web_v2/test/di/user_scope/subscription_module_test.dart" + ], + "component": "web_v2" + }, + { + "id": "WEB-006", + "title": "Create SubscriptionPage UI", + "priority": "high", + "status": "pending", + "estimated_hours": 3.0, + "description": "Create SubscriptionPage that displays subscription plans using SubscriptionPlansWidget and current subscription status. Include purchase flow initiation (note: backend purchase/cancel endpoints are TODO). Page should be responsive and follow Material Design.", + "acceptance_criteria": [ + "SubscriptionPage displays plans using SubscriptionPlansWidget", + "Current subscription status shown clearly (active/inactive, dates)", + "Purchase button initiates flow (shows TODO message if backend not ready)", + "Cancel/manage subscription options visible for active subscriptions", + "Page is responsive for mobile/tablet/desktop layouts", + "Loading states use skeleton loaders", + "Error states show with retry functionality", + "8+ widget tests pass covering page layout and interactions" + ], + "dependencies": [ + "WEB-003", + "WEB-005" ], "files_to_modify": [ "mnemo_cards_web_v2/lib/presentation/pages/subscription/subscription_page.dart", @@ -107,22 +153,23 @@ "component": "web_v2" }, { - "id": "WEB-006", - "title": "Add Subscription Status to Profile Page", + "id": "WEB-007", + "title": "Add Subscription Status to ProfilePage", "priority": "medium", "status": "pending", - "estimated_hours": 2.0, - "description": "Display current subscription status on ProfilePage with plan name, expiry date, active status, and a link to SubscriptionPage for management. Ensure status updates when subscription changes.", + "estimated_hours": 1.5, + "description": "Display current subscription status on ProfilePage with plan name, expiry date, active badge, and navigation link to SubscriptionPage. Use SubscriptionStateManager from UserScope for data.", "acceptance_criteria": [ - "Subscription status is displayed on ProfilePage", - "Status shows plan name, expiry date, and active status", - "Link to SubscriptionPage is provided", - "Status updates when subscription changes", - "Loading and error states are handled", + "Subscription status card added to ProfilePage", + "Shows plan name, active status badge, expiry date", + "Inactive state shows 'No active subscription' message", + "Tapping status card navigates to SubscriptionPage", + "Status updates reactively when subscription changes", + "Loading state shows skeleton loader", "4+ widget tests pass covering status display and navigation" ], "dependencies": [ - "WEB-005" + "WEB-006" ], "files_to_modify": [ "mnemo_cards_web_v2/lib/presentation/pages/profile/profile_page.dart", @@ -131,45 +178,91 @@ "component": "web_v2" }, { - "id": "WEB-007", - "title": "Create Promocode Input Widget", + "id": "WEB-008", + "title": "Create PromocodeInput Widget", "priority": "medium", "status": "pending", - "estimated_hours": 3.0, - "description": "Create a reusable PromocodeInput widget with text field, apply button, validation feedback, discount display, and success/error states. The widget should integrate with PromocodeService (which already uses HttpRepositoryV2) and be usable in PurchasePage and SubscriptionPage.", + "estimated_hours": 2.5, + "description": "Create reusable PromocodeInput widget with text field, apply button, validation feedback (success/error), and discount display. Widget should use PromocodeService (already exists) for validation and application. Backend promocode API is fully implemented.", "acceptance_criteria": [ - "PromocodeInput widget is created with text field and apply button", - "Widget validates promocode before applying", - "Widget displays discount amount when promocode is applied", - "Success and error states are shown with appropriate messages", - "Widget can be cleared and reset", - "Widget integrates with PurchasePage", - "Widget integrates with SubscriptionPage", - "8+ widget tests pass covering all functionality" + "Widget has text field for promocode entry with validation", + "Apply button validates and applies promocode", + "Success state shows discount amount and green checkmark", + "Error state shows error message in red with retry option", + "Loading state during validation/application", + "Widget can be cleared/reset to initial state", + "Widget properly styled with Material Design", + "7+ widget tests pass covering all states and interactions" ], "dependencies": [], "files_to_modify": [ "mnemo_cards_web_v2/lib/presentation/widgets/promocode_input.dart", - "mnemo_cards_web_v2/lib/presentation/pages/purchase/purchase_page.dart", - "mnemo_cards_web_v2/lib/presentation/pages/subscription/subscription_page.dart", "mnemo_cards_web_v2/test/presentation/widgets/promocode_input_test.dart" ], "component": "web_v2" }, { - "id": "WEB-008", - "title": "Fix Failing Tests", + "id": "WEB-009", + "title": "Integrate PromocodeInput into PurchasePage", "priority": "medium", "status": "pending", - "estimated_hours": 3.0, - "description": "Resolve 24 failing tests (mostly empty test files) to ensure all tests pass. Investigate each failing test, implement proper test cases or mark as skipped with clear reasons, and ensure no empty test files remain.", + "estimated_hours": 1.0, + "description": "Add PromocodeInput widget to PurchasePage below pack information and above payment options. Integrate promocode discount into price calculation display.", "acceptance_criteria": [ - "All 24 failing tests are fixed or properly skipped with clear reasons", - "All tests compile without errors", - "All tests pass successfully", - "Test coverage is maintained or improved", - "No empty test files remain", - "Test failures are documented with root cause analysis" + "PromocodeInput widget integrated into PurchasePage layout", + "Widget positioned below pack info, above payment section", + "Applied promocode discount updates displayed price", + "Original price shown with strikethrough when discount applied", + "Discount badge/label shows percentage or amount saved", + "3+ widget tests pass covering promocode integration" + ], + "dependencies": [ + "WEB-008" + ], + "files_to_modify": [ + "mnemo_cards_web_v2/lib/presentation/pages/purchase/purchase_page.dart", + "mnemo_cards_web_v2/test/presentation/pages/purchase/purchase_page_test.dart" + ], + "component": "web_v2" + }, + { + "id": "WEB-010", + "title": "Integrate PromocodeInput into SubscriptionPage", + "priority": "medium", + "status": "pending", + "estimated_hours": 1.0, + "description": "Add PromocodeInput widget to SubscriptionPage in subscription purchase flow. Display promocode discount in plan pricing.", + "acceptance_criteria": [ + "PromocodeInput widget integrated into SubscriptionPage", + "Widget appears in purchase flow section", + "Applied promocode updates subscription price display", + "Discount shown on selected plan card", + "3+ widget tests pass covering promocode integration" + ], + "dependencies": [ + "WEB-008", + "WEB-006" + ], + "files_to_modify": [ + "mnemo_cards_web_v2/lib/presentation/pages/subscription/subscription_page.dart", + "mnemo_cards_web_v2/test/presentation/pages/subscription/subscription_page_test.dart" + ], + "component": "web_v2" + }, + { + "id": "WEB-011", + "title": "Fix Empty Test Files", + "priority": "medium", + "status": "pending", + "estimated_hours": 2.0, + "description": "Fix 24 failing tests caused by empty test files. Identify all empty test files, either implement basic smoke tests or remove empty files. Focus on test_page_test.dart and other critical test files first.", + "acceptance_criteria": [ + "All empty test files identified and documented", + "test_page_test.dart has basic smoke tests implemented", + "Empty test files either have tests or are removed", + "All remaining test files compile without errors", + "Test count increases (no test regressions)", + "Document test coverage gaps for future work" ], "dependencies": [], "files_to_modify": [ @@ -179,22 +272,21 @@ "component": "web_v2" }, { - "id": "WEB-009", - "title": "Create Settings Page", + "id": "WEB-012", + "title": "Create Settings Page Foundation", "priority": "low", "status": "pending", - "estimated_hours": 3.0, - "description": "Create a dedicated SettingsPage to separate settings from ProfilePage. Include theme toggle (light/dark), language selection, sound effects toggle, notifications settings, and account settings. Settings should persist using SharedPreferences.", + "estimated_hours": 2.5, + "description": "Create SettingsPage with theme toggle (light/dark), language selection, and sound effects toggle. Settings should persist using SharedPreferences. This is foundation for more settings in future.", "acceptance_criteria": [ - "SettingsPage UI is complete with all settings options", - "Theme toggle (light/dark) works and persists", - "Language selection works and persists", - "Sound effects toggle works and persists", - "Notifications settings work and persist", - "Account settings are accessible", - "Settings are persisted using SharedPreferences", - "Page is responsive (mobile/tablet/desktop)", - "6+ widget tests pass covering all settings functionality" + "SettingsPage created with Material Design layout", + "Theme toggle (light/dark) with icon switches theme", + "Language selection dropdown with supported languages", + "Sound effects toggle with on/off state", + "All settings persist using SharedPreferences", + "Settings apply immediately on change", + "Page added to app navigation/router", + "6+ widget tests pass covering settings functionality" ], "dependencies": [], "files_to_modify": [ @@ -206,23 +298,22 @@ "component": "web_v2" }, { - "id": "WEB-010", + "id": "WEB-013", "title": "Increase Test Coverage for Purchase Flow", "priority": "medium", "status": "pending", - "estimated_hours": 3.5, - "description": "Add comprehensive unit and widget tests for the purchase flow including PurchasesService, PurchaseStateManager, PurchasePage, payment verification logic, and error handling for all edge cases.", + "estimated_hours": 3.0, + "description": "Add comprehensive unit and widget tests for purchase flow. Focus on PurchasesService, PurchaseStateManager, and PurchasePage edge cases (network errors, payment failures, success scenarios).", "acceptance_criteria": [ - "PurchasesService has 12+ unit tests with >80% coverage", - "PurchaseStateManager has 8+ unit tests covering all state transitions", - "PurchasePage has 10+ widget tests covering all UI interactions", - "Payment verification flow has comprehensive test coverage", - "Error handling is tested for all edge cases", + "PurchasesService has 10+ unit tests with >80% coverage", + "PurchaseStateManager has 8+ unit tests covering state transitions", + "PurchasePage has 8+ widget tests covering UI interactions", + "Payment verification flow has edge case tests", + "Error handling tested for network failures, timeouts", + "Success flow tested end-to-end", "All tests pass with zero flaky tests" ], - "dependencies": [ - "WEB-003" - ], + "dependencies": [], "files_to_modify": [ "mnemo_cards_web_v2/test/domain/services/purchases_service_test.dart", "mnemo_cards_web_v2/test/domain/state/purchase_state_manager_test.dart", @@ -231,19 +322,20 @@ "component": "web_v2" }, { - "id": "WEB-011", + "id": "WEB-014", "title": "Verify API v2 Migration Completeness", "priority": "medium", "status": "pending", "estimated_hours": 2.0, - "description": "Audit all services and verify that no v1 API dependencies remain. Ensure all services use HttpRepositoryV2, all API calls use v2 endpoints, and remove any deprecated v1 code. Create a migration audit document.", + "description": "Audit all services to verify complete migration to HttpRepositoryV2. Search for any remaining v1 API usage, deprecated imports, or old endpoint references. Create migration audit report.", "acceptance_criteria": [ - "All services use HttpRepositoryV2 (no HttpRepository v1 usage)", - "All API calls use v2 endpoints", - "No deprecated v1 dependencies remain", - "All v1 code is removed or marked as deprecated", - "Migration audit document is created with findings", - "All functionality verified working with v2 API" + "All services verified to use HttpRepositoryV2 exclusively", + "No references to old HttpRepository v1 found", + "All API endpoints use /api/v2/ paths", + "Deprecated v1 code removed or clearly marked", + "Migration audit document created with findings", + "Grep search confirms no v1 API usage remains", + "All functionality tested with v2 API" ], "dependencies": [], "files_to_modify": [ @@ -252,6 +344,34 @@ "mnemo_cards_web_v2/API_V2_MIGRATION_AUDIT.md" ], "component": "web_v2" + }, + { + "id": "WEB-015", + "title": "Add Analytics Events for Ads Reward Flow", + "priority": "low", + "status": "pending", + "estimated_hours": 1.5, + "description": "Enhance ads reward flow with comprehensive analytics events tracking: ad impressions, completions, failures, reward claims. Events are already partially implemented in AdsRewardButton, verify coverage and add missing events.", + "acceptance_criteria": [ + "Ad impression event fired when button shown", + "Ad start event fired when user clicks button", + "Ad completion event fired on successful ad view", + "Ad failure event fired with error details", + "Reward claim event fired with success/failure", + "Pack unlock event fired after successful reward", + "All events include relevant parameters (packId, productType)", + "5+ tests verify analytics event emissions" + ], + "dependencies": [ + "WEB-001", + "WEB-002" + ], + "files_to_modify": [ + "mnemo_cards_web_v2/lib/presentation/widgets/ads_reward_button.dart", + "mnemo_cards_web_v2/lib/domain/state/ads_reward_state_manager.dart", + "mnemo_cards_web_v2/test/presentation/widgets/ads_reward_button_test.dart" + ], + "component": "web_v2" } ] -} \ No newline at end of file +}