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
+13
View File
@@ -97,6 +97,19 @@
class="mt-4 text-sm text-gray-400 hover:text-gray-200">Try again</button>
</div>
<!-- Search History -->
<div id="history-section" class="hidden mt-12">
<div class="flex items-center justify-between mb-4">
<h2 class="text-lg font-semibold text-gray-300">Recent Searches</h2>
<button id="toggle-history-btn" class="text-sm text-indigo-400 hover:text-indigo-300 transition-colors">Hide</button>
</div>
<div id="history-list" class="space-y-3"></div>
</div>
<div id="history-toggle" class="hidden mt-8 text-center">
<button id="show-history-btn" class="text-sm text-gray-500 hover:text-gray-300 transition-colors">Show search history</button>
</div>
<!-- Footer -->
<div class="mt-12 pt-6 border-t border-gray-800 flex items-center justify-between text-sm text-gray-600">
<span id="library-stats"></span>