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:
@@ -9,6 +9,7 @@ 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";
|
||||
import { getFeaturePrefs } from "@/lib/feature-prefs";
|
||||
|
||||
export const metadata: Metadata = {};
|
||||
|
||||
@@ -40,6 +41,7 @@ export default async function RecipesPage({ searchParams }: { searchParams: Sear
|
||||
const session = await auth.api.getSession({ headers: await headers() });
|
||||
if (!session) return null;
|
||||
const m = getMessages((session.user as { locale?: string }).locale);
|
||||
const featurePrefs = await getFeaturePrefs(session.user.id);
|
||||
|
||||
const { q, sort, visibility, difficulty, tag, page: pageParam, batchCook, recipeType } = await searchParams;
|
||||
const query = (q ?? "").trim().slice(0, 200);
|
||||
@@ -160,7 +162,7 @@ export default async function RecipesPage({ searchParams }: { searchParams: Sear
|
||||
</div>
|
||||
)}
|
||||
|
||||
<CookingAssistantPanel />
|
||||
{featurePrefs.chatbots && <CookingAssistantPanel />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user