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

@@ -475,4 +475,68 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get processingProducts => 'Procesando...';
@override
String get clearAllProducts => 'Borrar todo';
@override
String get clearAllConfirmTitle => '¿Borrar todos los productos?';
@override
String get clearAllConfirmMessage =>
'Todos los productos serán eliminados permanentemente.';
@override
String get addManually => 'Manual';
@override
String get scan => 'Escanear';
@override
String get addProduct => 'Agregar';
@override
String get searchProducts => 'Buscar productos';
@override
String get searchProductsHint =>
'Escribe el nombre del producto o agrega manualmente';
@override
String noSearchResults(String query) {
return 'Sin resultados para \"$query\"';
}
@override
String get quantity => 'Cantidad';
@override
String get storageDays => 'Días de almacenamiento';
@override
String get addToShelf => 'Agregar a despensa';
@override
String get errorGeneric => 'Algo salió mal';
@override
String get nutritionOptional => 'Nutrición por 100g (opcional)';
@override
String get calories => 'Calorías';
@override
String get protein => 'Proteína';
@override
String get fat => 'Grasas';
@override
String get carbs => 'Carbohidratos';
@override
String get fiber => 'Fibra';
@override
String get productAddedToShelf => 'Agregado a la despensa';
}