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

@@ -474,4 +474,68 @@ class AppLocalizationsHi 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 => 'पेंट्री में जोड़ा गया';
}