From 3de7c5eed5ba262abf0d746211e33800db6d66df Mon Sep 17 00:00:00 2001 From: Tyler Hoang Date: Fri, 8 May 2026 03:24:36 -0700 Subject: Add recipe suggestions, chat tab, and major workflow improvements - Replace 7-day grid menu with browsable recipe suggestion cards (swap, remove, make this) - Add Chat tab: conversational AI with full pantry/menu/grocery context - Grocery list works without a menu (pantry-only mode) - Individual grocery checkboxes auto-add items to pantry - Swap modal with optional preference input - User notes textarea on menu and grocery generation - Clear button for menu and grocery list - LLM notes/summary displayed after generation, persisted to DB - Favicon linked in HTML - Category dropdown styled for dark theme - System prompt configurable via SYSTEM_PROMPT in .env - Fix startup error (ollama_timeout default), DB migration for menu_plans.notes - Simplify: batch N+1 queries, extract _current_monday(), merge chat sync fns, asyncio.get_running_loop(), fix currentGroceryId bug, cap chat history Co-Authored-By: Claude Sonnet 4.6 --- main.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'main.py') diff --git a/main.py b/main.py index fdbdea9..65b8271 100644 --- a/main.py +++ b/main.py @@ -2,6 +2,7 @@ from contextlib import asynccontextmanager import asyncio from fastapi import FastAPI from fastapi.staticfiles import StaticFiles +from sqlalchemy import text from database import engine, Base from config import settings from routers import pantry, meals, recipes, menus, grocery @@ -11,6 +12,11 @@ from routers import pantry, meals, recipes, menus, grocery async def lifespan(app: FastAPI): # Startup Base.metadata.create_all(bind=engine) + with engine.connect() as conn: + result = conn.execute(text("PRAGMA table_info(menu_plans)")) + if 'notes' not in [row[1] for row in result]: + conn.execute(text("ALTER TABLE menu_plans ADD COLUMN notes TEXT")) + conn.commit() yield # Shutdown pass -- cgit v1.3-2-g0d8e