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:
@@ -52,7 +52,7 @@ export function Nav() {
|
||||
// backend default — avoids a flash of items disappearing on load for the
|
||||
// (much more common) case where a user hasn't hidden anything.
|
||||
const [featurePrefs, setFeaturePrefs] = useState<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,
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
@@ -121,7 +121,7 @@ export function Nav() {
|
||||
<span>Epicure</span>
|
||||
</Link>
|
||||
<nav className="hidden md:flex items-center gap-1">
|
||||
{NAV_ITEMS.map(({ href, key, icon: Icon }) => (
|
||||
{visibleNavItems.map(({ href, key, icon: Icon }) => (
|
||||
<Link
|
||||
key={href}
|
||||
href={href}
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Switch } from "@/components/ui/switch";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import type { FeatureKey, FeaturePrefs } from "@/lib/feature-prefs";
|
||||
|
||||
const FEATURES: FeatureKey[] = ["nutrition", "pantry", "mealPlan", "shoppingLists", "collections", "messages"];
|
||||
const FEATURES: FeatureKey[] = ["nutrition", "pantry", "mealPlan", "shoppingLists", "collections", "messages", "chatbots"];
|
||||
|
||||
export function FeatureTogglesForm() {
|
||||
const t = useTranslations("settingsForm.featureToggles");
|
||||
|
||||
Reference in New Issue
Block a user