managarten/apps/mana/apps/web/src/lib/modules/nutriphi
Till JS 5480a8dfdf feat(mana/web/nutriphi): global quick-input adapter for the search bar
Adds nutriphi to the unified quick-input registry so the global search
bar gains meal-aware behaviour whenever the user is on a /nutriphi route.

Adapter contract (mirrors planta / todo / calendar):

  - onSearch: decrypts meals (description is in the encrypted allowlist)
    and substring-matches by description, sorted newest-first, capped at 10
  - onCreate: parses an optional meal-type prefix from the query
    ("frühstück: müsli mit beeren", "snack: apfel", english + ASCII
    variants accepted) and falls back to suggestMealType() based on
    time-of-day when no prefix is given
  - onParseCreate: shows a preview line so users see which meal type
    will be picked before they hit enter

Persistence goes through mealMutations.create — same code path the
workbench card uses, so encryption + sync work for free.

Tests: 13 cases covering parser branches (German + English prefixes,
case insensitivity, time-of-day fallback for the three meal windows,
edge cases like unknown prefixes, far-away colons, empty descriptions
after a prefix). Parser is exported to keep the test independent of
the adapter's network-touching hooks.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 16:14:37 +02:00
..
stores feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
api.ts feat(mana/web/nutriphi): photo capture + AI meal recognition flow 2026-04-09 15:14:07 +02:00
collections.ts feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
constants.ts feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
index.ts feat(mana/web/nutriphi): extend meal schema (foods + thumbnail) + update mutation 2026-04-09 15:44:55 +02:00
ListView.svelte feat(mana/web/nutriphi): inline text + photo quick-add in workbench ListView 2026-04-09 16:05:13 +02:00
module.config.ts fix(mana/web): commit module-registry + module.config.ts files (build-critical) 2026-04-07 19:49:58 +02:00
mutations.test.ts test(mana/web/nutriphi): cover mealMutations.update 2026-04-09 15:45:35 +02:00
mutations.ts feat(mana/web/nutriphi): extend meal schema (foods + thumbnail) + update mutation 2026-04-09 15:44:55 +02:00
queries.ts feat(mana/web/nutriphi): extend meal schema (foods + thumbnail) + update mutation 2026-04-09 15:44:55 +02:00
quick-input-adapter.test.ts feat(mana/web/nutriphi): global quick-input adapter for the search bar 2026-04-09 16:14:37 +02:00
quick-input-adapter.ts feat(mana/web/nutriphi): global quick-input adapter for the search bar 2026-04-09 16:14:37 +02:00
types.ts feat(mana/web/nutriphi): extend meal schema (foods + thumbnail) + update mutation 2026-04-09 15:44:55 +02:00