Commit 6f0abd3
Wire canonical foods search into event logging pipeline
Connect the existing search-foods Edge Function to the product search
flow so generic foods like "banana" surface canonical entries (with prep
states and real serving sizes) instead of only branded catalog products.
- Add searchCanonicalAndAdapt() to productSearch.ts that calls the Edge
Function, batch-fetches product_servings, and maps to ProductSearchResult
- Modify searchAllProducts() pipeline: canonical search as Priority 3,
catalog fallback as Priority 4, merged results deduped by name
- Pass canonical_food_id and preparation_state through confirm flow into
saved event data and user_product_registry
- Add canonicalFoodId parameter to updateUserProductRegistry()
- Recreate ivfflat vector index dropped in earlier index cleanup migration
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent d13549b commit 6f0abd3
File tree
8 files changed
+693
-1212
lines changed- docs/planning
- mobile
- __tests__/utils
- src
- components/confirm/flows
- utils
- supabase/migrations
8 files changed
+693
-1212
lines changedLarge diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
379 | | - | |
| 379 | + | |
| 380 | + | |
380 | 381 | | |
381 | 382 | | |
382 | 383 | | |
| |||
402 | 403 | | |
403 | 404 | | |
404 | 405 | | |
405 | | - | |
| 406 | + | |
| 407 | + | |
406 | 408 | | |
407 | 409 | | |
408 | 410 | | |
| |||
428 | 430 | | |
429 | 431 | | |
430 | 432 | | |
431 | | - | |
| 433 | + | |
| 434 | + | |
432 | 435 | | |
433 | 436 | | |
434 | 437 | | |
| |||
512 | 515 | | |
513 | 516 | | |
514 | 517 | | |
515 | | - | |
| 518 | + | |
| 519 | + | |
516 | 520 | | |
517 | 521 | | |
518 | 522 | | |
| |||
547 | 551 | | |
548 | 552 | | |
549 | 553 | | |
550 | | - | |
| 554 | + | |
| 555 | + | |
551 | 556 | | |
552 | 557 | | |
553 | 558 | | |
| |||
Lines changed: 35 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
299 | 302 | | |
300 | 303 | | |
301 | 304 | | |
| |||
453 | 456 | | |
454 | 457 | | |
455 | 458 | | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
456 | 487 | | |
457 | 488 | | |
458 | 489 | | |
459 | | - | |
| 490 | + | |
460 | 491 | | |
461 | 492 | | |
462 | | - | |
| 493 | + | |
| 494 | + | |
463 | 495 | | |
464 | 496 | | |
465 | 497 | | |
| |||
495 | 527 | | |
496 | 528 | | |
497 | 529 | | |
| 530 | + | |
498 | 531 | | |
499 | 532 | | |
500 | 533 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
| 151 | + | |
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | | - | |
| 287 | + | |
| 288 | + | |
288 | 289 | | |
289 | 290 | | |
290 | 291 | | |
| |||
323 | 324 | | |
324 | 325 | | |
325 | 326 | | |
326 | | - | |
| 327 | + | |
327 | 328 | | |
328 | | - | |
| 329 | + | |
| 330 | + | |
329 | 331 | | |
330 | 332 | | |
331 | 333 | | |
| |||
354 | 356 | | |
355 | 357 | | |
356 | 358 | | |
| 359 | + | |
357 | 360 | | |
358 | 361 | | |
359 | 362 | | |
| |||
0 commit comments