fix: desktop nav ignored feature toggles; add chatbots toggle (v0.62.0)
Feature toggles (Settings -> Features) were filtered into visibleNavItems but the desktop horizontal nav still mapped over the raw NAV_ITEMS list, so hiding a feature only worked on mobile. Both nav renders now read the same filtered list. Also adds a Chatbots toggle covering the recipe cooking-chat panel and the recipe-list cooking assistant, wired end-to-end (schema, migration, feature-prefs lib, API route, settings form, i18n, openapi). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -35,6 +35,7 @@ import { CommentsSection } from "@/components/social/comments-section";
|
||||
import { getPublicUrl } from "@/lib/storage";
|
||||
import { cn, stripMarkdown } from "@/lib/utils";
|
||||
import { RecipeChatPanel } from "@/components/recipe/recipe-chat-panel";
|
||||
import { getFeaturePrefs } from "@/lib/feature-prefs";
|
||||
import { BatchCookSteps } from "@/components/recipe/batch-cook-steps";
|
||||
import { BatchCookDishes } from "@/components/recipe/batch-cook-dishes";
|
||||
import { KeepScreenAwake } from "@/components/recipe/keep-screen-awake";
|
||||
@@ -71,7 +72,7 @@ export default async function RecipePage({ params }: Params) {
|
||||
const DIETARY_LABELS = m.recipe.dietary;
|
||||
const unitPref = (session.user as { unitPref?: string }).unitPref === "imperial" ? "imperial" : "metric";
|
||||
|
||||
const [recipe, ratingData, favoriteData, myRating, forkedFrom, myNote, dishCookLog, featureFlags] = await Promise.all([
|
||||
const [recipe, ratingData, favoriteData, myRating, forkedFrom, myNote, dishCookLog, featureFlags, featurePrefs] = await Promise.all([
|
||||
db.query.recipes.findFirst({
|
||||
where: and(
|
||||
eq(recipes.id, id),
|
||||
@@ -102,6 +103,7 @@ export default async function RecipePage({ params }: Params) {
|
||||
columns: { batchDishId: true, cookedAt: true },
|
||||
}),
|
||||
getFeatureFlagMatrix(),
|
||||
getFeaturePrefs(session.user.id),
|
||||
]);
|
||||
|
||||
if (!recipe) notFound();
|
||||
@@ -507,7 +509,7 @@ export default async function RecipePage({ params }: Params) {
|
||||
<Separator />
|
||||
<RecipeNotes recipeId={id} initialContent={myNote?.content ?? ""} />
|
||||
|
||||
<RecipeChatPanel recipeId={id} recipeTitle={recipe.title} />
|
||||
{featurePrefs.chatbots && <RecipeChatPanel recipeId={id} recipeTitle={recipe.title} />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user