feat: general cooking-question chatbot on the recipes homepage

The existing recipe chat (RecipeChatPanel) is tightly scoped to one
recipe — recipeId is required and its system prompt embeds that recipe's
full ingredient/step context. Added a sibling, not a modification: a new
floating assistant on the recipes list page for questions that aren't
about any specific recipe (technique, substitutions, timing, food safety).

New /api/v1/ai/cooking-chat route (same quota/rate-limit/model-resolution
pattern as recipe-chat, minus the recipe lookup) and CookingAssistantPanel
component (same floating-button + Sheet UI). Positioned at bottom-24
rather than bottom-6 so it doesn't sit in the same band as the recipe
list's floating bulk-action bar during select mode.

Verified locally: asked a real cooking question through the actual UI,
got a correctly-formatted markdown answer with no recipe context leaking
in (confirmed the request payload only carries the question, no recipeId).
This commit is contained in:
Arnaud
2026-07-12 19:35:00 +02:00
parent 9a448ef34d
commit 2ffa05e4cf
5 changed files with 260 additions and 0 deletions
+3
View File
@@ -7,6 +7,7 @@ import { eq, desc, asc, and, ilike, or, inArray } from "@epicure/db";
import { RecipesHeader } from "@/components/recipe/recipes-header";
import { RecipesEmptyState } from "@/components/recipe/recipes-empty-state";
import { RecipesGrid } from "@/components/recipe/recipes-grid";
import { CookingAssistantPanel } from "@/components/recipe/cooking-assistant-panel";
import { getMessages } from "@/lib/i18n/server";
export const metadata: Metadata = {};
@@ -139,6 +140,8 @@ export default async function RecipesPage({ searchParams }: { searchParams: Sear
)}
</div>
)}
<CookingAssistantPanel />
</div>
);
}