fix: Offene Lebensmittel nach Listen-Import wieder anzeigen
Deploy Development / deploy (push) Successful in 1m1s
Build Test / pytest-backend (push) Failing after 2s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 27s

Unmapped ohne Kreuzjoin, Listen-GET kurz, Rebuild im Hintergrund.
Tandoor-Zugang (URL/Token) in den Einstellungen mit ausliefern.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-09-13 10:36:08 +02:00
1 parent fa542e0fb9
commit d6838abda7
23 files changed
+786 -114

No files matched your search

+9 -8
View File
@@ -65,7 +65,7 @@ function RecipePickModal({ recipes, sourceName, onPick, onClose }) {
<button key={r.id} type="button" className="btn btn-secondary btn-full" style={{ marginTop: 8, justifyContent: 'flex-start', textAlign: 'left', height: 'auto', padding: '10px 12px' }} onClick={() => onPick(r.id)}>
<span>
<strong style={{ display: 'block' }}>{r.name_raw}</strong>
<span style={{ fontSize: 12, color: 'var(--text3)' }}>{(r.ingredients || []).length} Zutaten</span>
<span style={{ fontSize: 12, color: 'var(--text3)' }}>{r.ingredient_count ?? (r.ingredients || []).length} Zutaten</span>
</span>
</button>
))}
@@ -149,16 +149,16 @@ export default function NutritionFoodMap({ onChanged, onMapped }) {
const load = async () => {
const gen = ++loadGen.current
try {
const [u, m, r, counts] = await Promise.all([
api.listUnmappedFoods(sinceDays),
const [u, m, r] = await Promise.all([
api.listUnmappedFoods(sinceDays, true),
api.listMyFoodMappings(),
api.listNutritionRecipes().catch(() => []),
api.listUnmappedFoodCount(sinceDays).catch(() => null),
api.listNutritionRecipes(true).catch(() => []),
])
if (gen !== loadGen.current) return
askedSuggest.current = new Set()
setUnmapped(Array.isArray(u) ? u : [])
setTotalOpen(Number(counts?.total) || (Array.isArray(u) ? u.length : 0))
const items = Array.isArray(u) ? u : (u?.items || [])
setUnmapped(items)
setTotalOpen(Number(u?.total) || items.length)
setLearned(m)
setRecipes(Array.isArray(r) ? r : [])
} catch (e) {
@@ -340,7 +340,8 @@ export default function NutritionFoodMap({ onChanged, onMapped }) {
const res = await api.importFddbLists(file)
await load()
onChanged?.()
setNotice(`${res.recipes} Listen importiert, ${res.items_linked || 0} Tagebuchzeilen verknüpft.`)
const pending = res.rebuild_pending ? ' Tageswerte werden im Hintergrund nachgerechnet.' : ''
setNotice(`${res.recipes} Listen importiert, ${res.items_linked || 0} Tagebuchzeilen verknüpft.${pending}`)
} catch (e) {
setError(e.message)
} finally {