feat: improved receipt recognition, batch product add, and scan UX

- Rewrite receipt OCR prompt: completes truncated names, preserves fat%
  and flavour attributes, extracts weight/volume from line, infers
  typical package sizes for solid goods with quantity_confidence field
- Add quantity_confidence to RecognizedItem, EnrichedItem, and
  ProductJobResultItem; propagate through item enricher and worker
- Replace per-item create loop with single POST /user-products/batch call
  from RecognitionConfirmScreen
- Rebuild RecognitionConfirmScreen: amber qty border for low
  quantity_confidence, tappable product name → catalog picker,
  sort items by confidence, full L10n (no hardcoded strings)
- Add timestamps (HH:mm / d MMM HH:mm) to recent scan chips
- Show close-app hint on ProductJobWatchScreen (queued + processing)
- Refresh recentProductJobsProvider on watch screen init so new job
  appears without a manual pull-to-refresh
- App-level WidgetsBindingObserver refreshes product and dish job lists
  on resume, fixing stale lists after background/foreground transitions
- Add 9 new L10n keys across all 12 locales

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
dbastrikin
2026-03-26 23:09:57 +02:00
parent b2bdcbae6f
commit 5c5ed25e5b
38 changed files with 1221 additions and 115 deletions

View File

@@ -201,5 +201,35 @@
"fat": "脂肪",
"carbs": "碳水化合物",
"fiber": "膳食纤维",
"productAddedToShelf": "已添加到储藏室"
"productAddedToShelf": "已添加到储藏室",
"recognitionFoundProducts": "找到 {count} 个产品",
"@recognitionFoundProducts": {
"placeholders": {
"count": {
"type": "int"
}
}
},
"recognitionAddAll": "全部添加",
"recognitionAddToStock": "加入储藏室",
"recognitionAdded": "已添加 {count} 个产品",
"@recognitionAdded": {
"placeholders": {
"count": {
"type": "int"
}
}
},
"recognitionProductsFailed": "添加产品失败",
"recognitionEmpty": "未找到产品",
"recognitionConfidence": "{percent}% 置信度",
"@recognitionConfidence": {
"placeholders": {
"percent": {
"type": "int"
}
}
},
"recognitionReplaceProduct": "替换产品",
"scanJobCloseHint": "您可以关闭应用 — 此扫描将显示在产品页面的最近扫描中"
}