feat: adapt recipe surfaces for batch-cook sessions

- Recipes page action buttons reordered/restyled to push AI generation
  and batch cooking ahead of manual recipe creation.
- Recipe detail page hides meal/drink pairing (doesn't make sense for
  a multi-dish batch session).
- Print pages force light mode regardless of app theme (dark bg +
  hardcoded dark text was unreadable) and render sectioned steps +
  dishes/storage for batch-cook recipes.
- Markdown export mirrors the same sectioned structure.
- Cooking mode tags each step with which dish(es) it belongs to.
- Meal planner: mealPlanEntries.batchDishId lets a slot point at one
  specific dish within a batch session; picking a batch-cook recipe
  now prompts for which dish, and the grid shows the dish name.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Arnaud
2026-07-12 02:32:57 +02:00
parent 8e83cc0dc7
commit ba1614073b
16 changed files with 4867 additions and 36 deletions
+4 -2
View File
@@ -58,14 +58,15 @@ export default async function MealPlanPage({
where: and(eq(mealPlans.userId, session.user.id), eq(mealPlans.weekStart, weekStart)),
with: {
entries: {
with: { recipe: { with: { photos: true } } },
with: { recipe: { with: { photos: true } }, batchDish: true },
},
},
}),
db.query.recipes.findMany({
where: eq(recipes.authorId, session.user.id),
orderBy: desc(recipes.updatedAt),
columns: { id: true, title: true },
columns: { id: true, title: true, isBatchCook: true },
with: { batchDishes: { columns: { id: true, name: true }, orderBy: (t, { asc }) => asc(t.order) } },
}),
db.query.mealPlanMembers.findMany({
where: eq(mealPlanMembers.userId, session.user.id),
@@ -88,6 +89,7 @@ export default async function MealPlanPage({
servings: e.servings,
note: e.note,
recipe: e.recipe ? { id: e.recipe.id, title: e.recipe.title } : null,
batchDish: e.batchDish ? { id: e.batchDish.id, name: e.batchDish.name } : null,
}));
const label = `${monday.toLocaleDateString("en-US", { month: "short", day: "numeric" })} ${sunday.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" })}`;
@@ -41,6 +41,7 @@ export default async function CookPage({ params }: Params) {
id: s.id,
instruction: s.instruction,
timerSeconds: s.timerSeconds,
appliesTo: recipe.isBatchCook ? s.appliesTo : undefined,
}))}
ingredients={recipe.ingredients.map((i) => ({
rawName: i.rawName,
+8 -2
View File
@@ -151,8 +151,12 @@ export default async function RecipePage({ params }: Params) {
</Tooltip>
)}
<FavoriteButton recipeId={id} initialFavorited={isFavorited} />
<MealPairingButton recipeId={id} />
<DrinkPairingButton recipeId={id} />
{!recipe.isBatchCook && (
<>
<MealPairingButton recipeId={id} />
<DrinkPairingButton recipeId={id} />
</>
)}
{recipe.visibility === "public" && (
<Tooltip>
<TooltipTrigger render={
@@ -217,6 +221,8 @@ export default async function RecipePage({ params }: Params) {
sourceUrl: recipe.sourceUrl,
ingredients: recipe.ingredients,
steps: recipe.steps,
isBatchCook: recipe.isBatchCook,
batchDishes: recipe.batchDishes,
})}
filename={recipe.title}
/>