feat: product search screen with catalog add and success feedback

- Add product search screen (/products/search) as primary add flow;
  "Add" button on products list opens search, manual entry remains as fallback
- Add to shelf bottom sheet with AnimatedSwitcher success view (green checkmark)
  and SnackBar confirmation on the search screen via onAdded callback
- Manual add (AddProductScreen) shows SnackBar on success before popping back
- Extend AddProductScreen with optional nutrition fields (calories, protein,
  fat, carbs, fiber); auto-fills from catalog selection and auto-expands section
- Auto-upsert catalog product on backend when nutrition data is provided
  without a primary_product_id, linking the user product to the catalog
- Add fiber_per_100g field to CatalogProduct model and CreateRequest
- Add 16 new L10n keys across all 12 locales (addProduct, addManually,
  searchProducts, quantity, storageDays, addToShelf, nutritionOptional,
  calories, protein, fat, carbs, fiber, productAddedToShelf, etc.)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
dbastrikin
2026-03-26 14:04:58 +02:00
parent 16d944c80e
commit 8d33a4eb30
40 changed files with 2167 additions and 74 deletions

View File

@@ -473,4 +473,66 @@ class AppLocalizationsAr extends AppLocalizations {
@override
String get processingProducts => 'جارٍ المعالجة...';
@override
String get clearAllProducts => 'مسح الكل';
@override
String get clearAllConfirmTitle => 'مسح جميع المنتجات؟';
@override
String get clearAllConfirmMessage => 'سيتم حذف جميع المنتجات نهائياً.';
@override
String get addManually => 'يدويًا';
@override
String get scan => 'مسح ضوئي';
@override
String get addProduct => 'إضافة';
@override
String get searchProducts => 'البحث عن المنتجات';
@override
String get searchProductsHint => 'اكتب اسم المنتج أو أضف يدويًا';
@override
String noSearchResults(String query) {
return 'لا توجد نتائج لـ\"$query\"';
}
@override
String get quantity => 'الكمية';
@override
String get storageDays => 'أيام التخزين';
@override
String get addToShelf => 'إضافة إلى المخزن';
@override
String get errorGeneric => 'حدث خطأ ما';
@override
String get nutritionOptional => 'القيم الغذائية لكل 100 جم (اختياري)';
@override
String get calories => 'سعرات حرارية';
@override
String get protein => 'بروتين';
@override
String get fat => 'دهون';
@override
String get carbs => 'كربوهيدرات';
@override
String get fiber => 'ألياف';
@override
String get productAddedToShelf => 'تمت الإضافة إلى المخزن';
}