Add search history with saved results

Saves each mood search and its recommendations to SQLite per user.
Recent searches appear below the results area with mood text, top
movie titles, and timestamp. Click any entry to reload those results.
Entries can be deleted individually. History toggleable via show/hide.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-14 19:57:50 -07:00
parent 3d5de06b44
commit d8c8b473ad
4 changed files with 178 additions and 10 deletions
+9
View File
@@ -59,6 +59,15 @@ async def init_database():
key TEXT PRIMARY KEY,
value TEXT
);
CREATE TABLE IF NOT EXISTS search_history (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id TEXT NOT NULL,
mood TEXT NOT NULL,
results TEXT NOT NULL,
meta TEXT,
created_at TEXT NOT NULL
);
""")
await db.commit()
finally: