forked / Architecture

ADR-030: Food Flag on Categories

Status: Accepted Date: 2026-10-16

Context

Ingredients are shared between recipes and the shopping list, so non-food items such as aluminum foil, diapers, or pet food live in the same pool as eggs and flour. Recipe search and the recipe editor’s ingredient picker therefore suggested household, baby, pet, and personal-care items, which can never be part of a recipe.

Decision

  1. Every categories document carries a required food: boolean. true means its ingredients can be used in recipes.
  2. Recipe ingredient search and the recipe editor’s ingredient picker hide ingredients whose category has food: false. Ingredients without a known category count as food. The shopping list is unaffected.
  3. The flag is editable per category in the category settings. New categories default to food: true.
  4. The seeded defaults mark Personal Care, Baby, Pet, and Household as non-food. The seed version is bumped so existing installs reseed their default categories.

Consequences

  • Recipe search and editing offer only ingredients that make sense in a recipe, and the classification replicates to every device of the household.
  • The category schema changed without a migration. A user-created category stored before the change has no food field until edited; the read path treats a missing flag as food.
  • Food status is per category, so a single non-food ingredient in a food category cannot be hidden on its own.

View source on GitHub