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

@@ -469,4 +469,66 @@ class AppLocalizationsZh 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 => '已添加到储藏室';
}