mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-19 21:01:25 +02:00
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>
|
||
|---|---|---|
| .. | ||
| stores | ||
| api.ts | ||
| collections.ts | ||
| constants.ts | ||
| index.ts | ||
| ListView.svelte | ||
| module.config.ts | ||
| mutations.test.ts | ||
| mutations.ts | ||
| queries.ts | ||
| quick-input-adapter.test.ts | ||
| quick-input-adapter.ts | ||
| types.ts | ||