Skip to content

Conversation

oliveror
Copy link
Member

Changes

  • Creation and API validation allowed 1–1 000 servings, but the detail page's control stopped at 20, so a recipe for 40 could not even be shown at its own size via the buttons.
  • MIN_SERVINGS / MAX_SERVINGS now live in the shared package (@t31/validation/recipe) and are used by the API's Zod schema, the recipe form and the detail page.
  • New ServingsStepper replaces the two duplicated stepper blocks (mobile and desktop): the −/+ buttons stay, and the number is now a labelled number field ("Servings (1–1000)"). Valid whole numbers apply while typing; out-of-range values are clamped and empty/invalid input restores the last value when the field is left (or on Enter). Button changes are announced in a polite live region. Visually unchanged.

Validation

  • npm run check passes (212 unit tests), incl. a new test: a 40-serving recipe, +1, typing 250, typing 5000 → clamped to 1000 (+ disabled), clearing → restored.
  • Real-database browser test passes.

AI usage

Written with Claude Code (Anthropic) to address a teammate's review of the final-delivery findings. Please review the diff as you would any other contribution.

Closes #101

The API and the recipe form allowed 1-1000 servings, but the detail page
stopped at 20 and only had -/+ buttons. MIN_SERVINGS/MAX_SERVINGS now
live in @t31/validation/recipe and are used by the API, the form and the
detail page. A shared ServingsStepper keeps the -/+ buttons and makes the
number a field: valid whole numbers apply while typing; out-of-range or
empty input is clamped or restored when leaving the field.

Closes #101
@oliveror oliveror requested a review from a team as a code owner November 16, 2026 14:13
# Conflicts:
#	apps/web/src/features/recipe-detail/RecipeDetailPage.tsx
@oliveror oliveror merged commit 608fdf6 into dev Nov 17, 2026
2 checks passed
@oliveror oliveror deleted the fix/recipe-serving-limits branch November 17, 2026 00:30
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants