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:
Arnaud
2026-07-20 23:23:01 +02:00
parent c5e1643d39
commit 274c50c2f6
17 changed files with 5906 additions and 14 deletions
+11 -1
View File
@@ -1,5 +1,5 @@
// Mirrors CHANGELOG.md at the repo root — update both together.
export const APP_VERSION = "0.61.0";
export const APP_VERSION = "0.62.0";
export type ChangelogEntry = {
version: string;
@@ -11,6 +11,16 @@ export type ChangelogEntry = {
};
export const CHANGELOG: ChangelogEntry[] = [
{
version: "0.62.0",
date: "2026-07-20 23:45",
added: [
"Settings → Features: new Chatbots toggle — hides both the recipe cooking-chat panel and the recipe-list cooking assistant when off.",
],
fixed: [
"Feature toggles (Settings → Features) were only respected by the mobile hamburger menu — the desktop horizontal nav still showed every item regardless of your saved preferences. Both now read the same visibility list.",
],
},
{
version: "0.61.0",
date: "2026-07-20 23:15",
+3 -2
View File
@@ -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,
};
}
+2 -1
View File
@@ -478,11 +478,12 @@ export function generateOpenApiSpec(): object {
}));
const FeaturePrefsRef = registry.register("FeaturePrefs", z.object({
nutrition: z.boolean(), pantry: z.boolean(), mealPlan: z.boolean(),
shoppingLists: z.boolean(), collections: z.boolean(), messages: z.boolean(),
shoppingLists: z.boolean(), collections: z.boolean(), messages: z.boolean(), chatbots: z.boolean(),
}).describe("Purely cosmetic — hides the feature from the user's own nav. Never restricts access to the underlying pages/routes."));
const UpdateFeaturePrefsRef = registry.register("UpdateFeaturePrefs", z.object({
nutrition: z.boolean().optional(), pantry: z.boolean().optional(), mealPlan: z.boolean().optional(),
shoppingLists: z.boolean().optional(), collections: z.boolean().optional(), messages: z.boolean().optional(),
chatbots: z.boolean().optional(),
}));
const NutritionGoalsRef2 = registry.register("NutritionGoalsMe", z.object({