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:
@@ -1,11 +1,11 @@
|
||||
import { db, userFeaturePrefs, eq } from "@epicure/db";
|
||||
|
||||
export type FeatureKey = "nutrition" | "pantry" | "mealPlan" | "shoppingLists" | "collections" | "messages";
|
||||
export type FeatureKey = "nutrition" | "pantry" | "mealPlan" | "shoppingLists" | "collections" | "messages" | "chatbots";
|
||||
|
||||
export type FeaturePrefs = Record<FeatureKey, boolean>;
|
||||
|
||||
const DEFAULT_PREFS: FeaturePrefs = {
|
||||
nutrition: true, pantry: true, mealPlan: true, shoppingLists: true, collections: true, messages: true,
|
||||
nutrition: true, pantry: true, mealPlan: true, shoppingLists: true, collections: true, messages: true, chatbots: true,
|
||||
};
|
||||
|
||||
/** No row yet means every feature defaults to on — same default the DB columns encode. */
|
||||
@@ -15,5 +15,6 @@ export async function getFeaturePrefs(userId: string): Promise<FeaturePrefs> {
|
||||
return {
|
||||
nutrition: row.nutrition, pantry: row.pantry, mealPlan: row.mealPlan,
|
||||
shoppingLists: row.shoppingLists, collections: row.collections, messages: row.messages,
|
||||
chatbots: row.chatbots,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user